An app that uses both elastic search and mysql An app that uses both elastic search and mysql elasticsearch elasticsearch

An app that uses both elastic search and mysql


my suggestion would be to stick to mysql as primary storage and utilize the power of triggers to handle background jobs and maintain sync data between mysql and elastic.I would suggest not to go with elastic-mongo combinations as there is no official connector out there.

Having mysql as primary storage will also insure data backup for you, in case of any disaster happens to your clusters.Make sure to maintain proper queue size for bulk indexing to the cluster.

or keep elastic as only primary storage if you don't have anything other than search and keep backs on S3 or file system.


ES is almost real-time storage, so you cannot replace a real-time storage engine. For production, an Elasticsearch cluster should have a minimum of 3 master-eligible nodes.

Synchronizing MySql with ES may become cumbersome at one moment.I recommend you to give a try to MongoDB, Mongo2ES connector can automatically replicate data to ES when a change occurs in database.

In the end, you can use a mix of Mysql, MongoDB and ElasticSearch

  1. Mysql for users, permissions, activity log
  2. MongoDB for permanent classified rich data
  3. ES for fast search of classified rich data