MySQL Heartbeats

Setup MySQL heartbeats for low volume databases

For low volume MySQL sources, it is possible that the log becomes stale due to a lack of change events. As a result, events may not be captured by the Connector.

To address this, the heartbeat process involves writing an insert or update to a heartbeat table every 1 second to generate a change event.

Setup MySQL Heartbeats

Create the heartbeat table

CREATE TABLE heartbeat (
    id INT AUTO_INCREMENT PRIMARY KEY,
    text TEXT
);

Grant permission to the Streamkap user

GRANT INSERT, UPDATE ON heartbeat TO STREAMKAP_USER;

Insert the first row into the heartbeat table

INSERT INTO heartbeat (text) VALUES ('test_heartbeat');

Verify it's working

  • Streamkap should start updating the record in the heartbeat table using this command every 1 second
UPDATE heartbeat SET text = 'updated_heartbeat' WHERE id = 1;
  • Look for entries in the heartbeat table to verify this is working