What is Elasticsearch and why is it so fast
Let’s start our journey with Elasticsearch
Elasticsearch is the most popular open-source enterprise search engine based on the Lucene library, which allows the creation of indices on every field of a document by default. Another popular search engine based on the Lucene library is Apache Solr.
Solr is a mature and also widely used search engine. We can’t easily say which one is better and there have been fierce quarrels about this issue. Nonetheless, Elasticsearch is becoming more and more popular and has become the first choice for many companies. Elasticsearch is very easy to install and get started. There is even a company called elastic.co which is dedicated to the creation and maintenance of Elasticsearch deployments.
Besides being a search engine, Elasticsearch is also a distributed document store. Unlike relational databases like MySQL which stores data as rows and columns, Elasticsearch is a NoSQL data store that stores data as JSON documents.
In the aspect of data storage, Elasticsearch is similar to MongoDB which also stores data as JSON documents. However, Elasticsearch and MongoDB are quite different. First, MongoDB is dedicated to data storage, whereas Elasticsearch is to search. Or we can understand in this way that MongoDB is optimized for writing and…