Elasticsearch Index Lifecycle Management in a Nutshell
Understanding its Application Scenarios and Limitations
When we develop data-intensive applications, we usually classify data into frequently used and infrequently used, i.e. hot data and cold data. We have different ways of handling data at different “temperatures”, for example, cold data is stored in lower-cost storage, but with a lower access performance.
If the databases we use have this kind of temperature management built in, then the operation effort will be greatly reduced.
Fortunately, Elasticsearch has such a feature, called index lifecycle management (ILM).
Before we get into ILM, let’s jump to the conclusion.
There are two common ways to use Elasticsearch, one is to treat Elasticsearch as an OLTP database, just like a regular database where we CRUD each document. The scenario is we need the search capabilities provided by Elasticsearch, so each document will be a corresponding entity.
Take an e-commerce website as an example, in order to be able to search for product titles, content, etc., we will add a product as a document to Elasticsearch, and when there are any changes to the product, we will directly find out the corresponding document and modify the fields in it.