go-mysql-elasticsearch: Syncing MySQL Data to Elasticsearch
Project GitHub address: https://github.com/siddontang/go-mysql-elasticsearch The basic principle of go-mysql-elasticsearch is: when the program starts for the first time, it first uses the mysqldump tool to perform a full sync of the source MySQL database, then writes data to ES through the elasticsearch client; then it implements a mysql client that connects to the source MySQL as a slave. The source MySQL as master will synchronize all data update operations to the slave via binlog events. By parsing the binlog events, you can obtain the updated content of the data, and then write it to ES.