MySQL synchronization inserts, updates and deletes operations using ElasticSearch

Here is a fairly common case for elasticsearch (ES): since the ES is almost real-time, we want to synchronize it with our MySQL as close to real time as possible. The initial tables are imported into the index, and it works fine, but now we need to track the insertion, updating and deletion of new records, and here is the place we have a question for. Import is carried out by the importer elasticsearch-jdbc. It may have an interval parameter for periodically polling data, but:

  • we cannot add fields to db that will be responsible for fetching new / updated rows,
  • we want to have more atomic operations like DB insert row-> ES insert document, DB update row-> ES update document, etc.

Two options that can satisfy our needs:

Other solutions are welcome!

+4
source share
1 answer

Logstash with the logstash-input-jdbc plugin can simply synchronize the insert and update operation. The error removal operation cannot be synchronized directly. We talked more about how to synchronize the Mysql delete operation with logstash-input-jdbc? at https://discuss.elastic.co/t/delete-elasticsearch-document-with-logstash-jdbc-input/47490/9 .

0
source

All Articles