My take on Elasticsearch as Primary Database?

A Software Product Engineer, Cloud enthusiast | Blogger | DevOps | SRE | Python Developer. I usually automate my day-to-day stuff and Blog my experience on challenging items.
Search for a command to run...

A Software Product Engineer, Cloud enthusiast | Blogger | DevOps | SRE | Python Developer. I usually automate my day-to-day stuff and Blog my experience on challenging items.
No comments yet. Be the first to comment.
The way we consume tech content has changed - my blog is changing with it. Introducing the Prompts series.

Deep metrics, log shipping, and a ready dashboard before your performance test starts - plus the war story of why it matters.
One prompt that lets an LLM read, draft, and publish on your Hashnode blog - token stays safe in an env var.
Hello All, If you've been running Argo CD on EKS, you know the drill — install the helm chart, manage the controllers, handle upgrades, configure SSO, worry about HA, and repeat for every cluster. It'

Introduction If you've spent any time managing data pipelines in the real world, you know the pain of deploying changes manually — copy-pasting notebooks, praying nothing breaks in prod, and maintaini

Elasticsearch(ES) is a distributed, full-text document store, search engine which is based on Apache Lucene as a core library. ES was originally designed for rich text-based search with advanced features to support complex queries, filters, analyzers with multiple languages. ES indexes and stores data so that it can be retrieved/searched in near real-time.
Distributed: ES saves the data in multiple nodes, data can be retrieved from any node at any time
Highlights of Lucene core:
It depends on a lot of factors, such as,
(One ongoing WIP from the elastic team is that they are constantly working towards improving the resiliency)
○ Size of document
○ Number of concurrent requests of read per second
○ Writes per second
ES always does best in read requests, as the name suggests it is indexed data store.
If we prefer to increase the write (aka indexing rate) it can be achieved in several ways. refresh_interval, flush_threshold_size are some of the key parameters to be considered while improving writes.
Below are the pointers out of my experience in using ES as a database in production.
It is not preferred to use ES as the primary database when you have (WPS) writes per second dominant reads (RPS).
ES is very helpful when one of your primary use cases is to read, visualize the data using the complex combination.
Best works for structured data set with less number of nested items.
To mitigate the concerns of write in elastic search, add another layer over ES, that can be REDIS or KAFKA buffer to queue the incoming data and to avoid data loss.

The main question is it worth adding more complexity to architecture? Which adds maintenance and other ad-hoc items related to the new services.
The use-cases which use this architecture are;
And if your primary goal is to save JSON data and with the best performance in writes and reads, (considering all the points above in this section )please go ahead with mainstream NoSQL databases like MongoDB.
Invention and Discovery always being the part of human nature,
I always love the idea of extending the capabilities of any such machine with a pinch of salt and pepper to adapt to our complex use-cases in our daily. However, this should happen without killing the nature, purpose for which the tool is built since we might have straight forward alternative for any such use case.
EOB (End-of-Blog)
Reference:
https://medium.com/@merrinkurian/elasticsearch-as-the-primary-database-5e41b2a0189d https://cloud.netapp.com/blog/cvo-blg-elasticsearch-vs-mongodb-6-key-differences https://aws.amazon.com/premiumsupport/knowledge-center/opensearch-indexing-performance/