I have seen many similar question to this topic (including this one, which talks about how ElasticSearch version 6 has overcome many of its limitations as the primary data store), but I am still not clear on the following:
I am creating an online shopping website and I am using MySQL as my DB.
This is a simplified version of my DB (Users can post Product on the website for sale)
I am learning about ElasticSearch and I want to use it to search the products on my website. I don't need User and ProductReview to be searched - only Product table.
I can think of 2 solutions to achieve this:
- Periodically copy Product table from MySQL to ES
- Keep User and ProductReview in MySQL and Product in ES
As far as I know, if I use option 1, then I can use go-mysql-elasticsearch to sync ES with MySQL: Is this a good solution?
I am more tempted to use option 2, as it is easier and I don't need to worry about data synchronization. What concerns me about this option is:
- Is ES reliable to be the primary source of data?
- At some point in time, if I have to modify the Product table structure, would I be able to do so without deleting and recreating the Product Index?
- In case of MySQL, I normally take a backup of Prod DB and Restore it on Test DB... Is it still possible to do a Backup and Restore from Prod to Test using ES?
I have no experience with ES/NoSQL and would appreciate any advice.