ElasticSearch as primary database and other solutions

I am using elasticsearch as primary database. But due to the lack of the ACID properties, I want to:

  • or replace it with another database with similar or better performances ( maybe postgresql or kafka/ksql ).
  • or use other solution together with elasticsearch to avoid the loss of data ( due to the lack of the ACID properties ).

So what is the better solution? and how can I check what are the performance differences between ElasticSearch and the other solution?

The performance numbers are hard to tell without telling anything about your use-case. Also, just because of lacking ACID properties does not mean, there are no guarantees. You can do optimistic locking for example, that maybe sufficient for certain use-cases.

So maybe telling a bit more about your use-case and what features and guarantees you need in the context of your application/data will increase the likelihood of getting a useful answer.

Thank you!

My requirements are speed in searching, distribution, resilience and high availability.
The lack of the ACID properties is not good in my case because there could be a loss of data.
Thanks :slight_smile:

what makes you think that dataloss can happen just because it is not ACID? Can you elaborate?

Some people says that there could be loss of data:

Other people says that it's not a good idea to use ElasticSearch as primary database in general.

Are they wrong?

That topic is from 4 years ago, there's been tonnes of improvements around this area in that time. With replicas and snapshots and good planning, you will be ok.

PS - it's Elasticsearch, not ElasticSearch :wink: