Should I use Elastic Search as my data store instead of MySQL? Should I use Elastic Search as my data store instead of MySQL? elasticsearch elasticsearch

Should I use Elastic Search as my data store instead of MySQL?


I would recommend keeping MySQL as the system of record and do all CRUD operations from your application against MySQL. Then start an ElasticSearch machine and periodically move data from MySQL to ElasticSearch (only the data you need to search against).

Then if ElasticSearch goes down, you only lose the search feature - your primary data store is still ok.

ElasticSearch can be configured as a cluster and can scale very large, so it'll handle the number of rows.

To get data into Elastic, you can do a number of things:

  1. Do an initial import (very slow, very big) and then just copy diffs with a process. You might consider something like Mule ESB to move data (http://www.mulesoft.org/).

  2. When you write data from your app, you can write once to MySQL and also write the same data to Elastic. This provides real time data in Elastic, but of course if the second write to Elastic fails, then you'll be missing the data.