NOTE
1.9 Elasticsearch and MySQL Synchronization
English translation of the original VNote ‘Elasticsearch and MySQL Synchronization’, preserving its structure and historical notes.
This is a historical learning note and may contain outdated or incomplete understanding.
1. Scheduled Synchronization
Use a scheduled task to pull data from MySQL page by page and write it into Elasticsearch.
Added and modified data is straightforward: just reindex it.
But what about deleted data? Add an extra update_time field. After the update finishes, delete everything with a value less than update_time.
2. cannel
Use cannel to parse the MySQL binlog and then send it to Kafka. Elasticsearch consumes Kafka. For add/update messages, reindex directly; for delete messages, delete the document.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub