Hey Josh, Chris,
Thank you so much for this conversation, this has helped me gain a better understanding of how the heartbeat mechanism is implemented for MongoDB and PostgreSQL connectors.
I want some help understanding how heartbeat works in case of a MySQL connector and why it is required for MySQL.
Both MongoDB and PostgreSQL, as far as I understand, notify the client when there is a write operation on the subscribed collections/tables. There might be a case where the there might be changes happening frequently to other databases and collections/tables in the cluster but not to the subscribed collections/tables. In that case, the connector's recorded resume token/LSN might be lost. To avoid this, the heartbeat mechanism can be enabled for both types of connectors.
As far as I understand, a MySQL connector works by reading the binlog files from the database but the database doesn't notify the client of the changes, the connector is responsible for reading the binlog files, filtering out the records pertaining to the subscribed tables and managing till what binlog file and position it has read. In such a case, even if there is no change in the subscribed table, the connector will read the binlog files, realize that there are no changes and record till what binlog file and position it has read. Is this understanding correct? If yes, then why do we need heartbeats for a MySQL connector? If no, could you please help me understand how a MySQL connector works?
Thanks a ton,