Elasticsearch
- Problem solved: near real-time (under one second) full-text search and analytics on very large volumes of documents and logs, with a cluster that distributes itself.
- Era: written from 2009, first release (0.4.0) on February 8, 2010, Elastic company founded in 2012, ELK stack in 2013.
- Publisher: Elastic (non-Apache project). Apache 2.0 licence until 2021, then SSPL or Elastic License, with AGPL as an option since 2024.
- Category: distributed search and analytics engine.
- Created by: Shay Banon, author of the Compass library.
Historical context
In the mid-2000s, the reference for full-text search in Java is the Apache Lucene library. But Lucene is a library, not a server: you embed it in your application and handle distribution yourself. In 2005, Shay Banon releases Compass, a Java framework on top of Lucene, first written for a recipe app for his wife.
Around 2009, Banon thinks about "Compass 3.0" and concludes that everything must be rebuilt. His diagnosis: "The proper way to solve the scalability problem is by running a 'local' index (a shard) on each node, and do map reduce when you execute a search, and routing when you index". He also wants an engine usable from any language, "which basically means JSON over HTTP".
On February 8, 2010, he announces "ElasticSearch" on his blog, "an open source, distributed, RESTful search engine", under the Apache 2.0 licence. In 2012, he founds the company that will become Elastic, with Steven Schuurman, Uri Boness and Simon Willnauer, a major Lucene contributor. In 2013, Logstash (Jordan Sissel) and Kibana (Rashid Khan) join the company: this is the ELK stack, already "the most popular open source solution to logs management" according to Banon. Elastic goes public in New York in October 2018 (ticker ESTC).
Success attracts the clouds. In January 2021, pointing at services that "profit from our open source software without contributing back" (Amazon Elasticsearch Service is named), Elastic moves the code to a dual SSPL and Elastic License licence, and stops presenting it as open source. AWS answers in April 2021 with OpenSearch, a fork derived from Elasticsearch 7.10.2 under the Apache 2.0 licence, handed to the Linux Foundation in 2024. In August 2024, Elastic adds the AGPL as a third option: "Elasticsearch Is Open Source. Again!", writes Banon, for whom "Being able to call Elasticsearch Open Source again is pure joy".
Key idea
Turn a search library into a distributed service: each index is split into shards, and each shard is a full Lucene index. A search is sent to all shards (the "map"), then results are merged (the "reduce"). A write is routed to a single shard. Everything is driven with JSON over HTTP, with no proprietary driver.
The core remains Lucene's inverted index: for each term, the list of documents that contain it. This is what makes full-text search fast, where a relational database would have to scan the texts.
How it works
- Cluster, nodes, indices: a cluster groups nodes; JSON documents are stored in indices.
- Primary shards and replicas: each index is split into primary shards (their number is fixed when the index is created), copied as replicas on other nodes for fault tolerance and reads.
- Segments and refresh: Lucene writes immutable segments. By default, Elasticsearch refreshes indices every second (for recently searched indices): a document becomes searchable "within 1 second". This is near real time.
- Queries and aggregations: a JSON DSL for search (relevance, filters) and aggregations (counts, histograms) used by Kibana.
- Ecosystem: Logstash then Beats to collect, Kibana to visualize (Elastic Stack since 2016).
# index a document
curl -X PUT "localhost:9200/logs/_doc/1" -H 'Content-Type: application/json' \
-d '{"service": "api", "message": "timeout on upstream"}'
# full-text search
curl "localhost:9200/logs/_search" -H 'Content-Type: application/json' \
-d '{"query": {"match": {"message": "timeout"}}}'
By the numbers
| Figure | Context | Source |
|---|---|---|
| 0.4.0 | Version number of the very first release (February 2010) | Elastic blog, 15 years |
| 1 second | Default delay before an indexed document is searchable (current docs) | Elastic docs |
| 8,050,000 shares at 36 dollars | Elastic's initial public offering on the NYSE (October 2018) | Elastic press release 2018 |
| Over 90% | Share of new downloads choosing the Elastic License distribution (January 2021) | Elastic blog 2021 |
| 1.45 billion | Cumulative downloads, an average of 3 per second since 2010 (February 2025) | Elastic blog, 15 years |
| Up to 65% | Log storage reduction with the LogsDB index mode (2024) | Elastic blog, 15 years |
| Over 700 million | Downloads of OpenSearch, the AWS fork (September 2024) | Linux Foundation press release |
Milestones
- 2005: Shay Banon releases Compass, a Java framework on top of Lucene.
- 2009: work on Elasticsearch begins.
- February 8, 2010: first public release, 0.4.0.
- July 13, 2012: the company is announced, with Steven Schuurman, Uri Boness and Simon Willnauer.
- August 27, 2013: Logstash and Kibana join the company, birth of the ELK stack.
- 2014: Elasticsearch 1.0, the first stable release.
- March 10, 2015: acquisition of Found (cloud hosting) and rebrand as Elastic.
- October 5, 2018: listing on the NYSE.
- January 14, 2021: move to SSPL and Elastic License announced (from 7.11); AWS announces OpenSearch on April 12, 2021.
- August 29, 2024: AGPL option announced; on September 16, 2024, OpenSearch joins the Linux Foundation.
Did you know?
- It all started with recipes: Compass, the ancestor of Elasticsearch, was born while Shay Banon was writing a recipe app for his wife.
- "You Know, for Search": the tagline of the 2010 announcement gave its name to the 2012 company launch post, "You Know, for Search (inc)".
- A confession in 2024: when returning to open source, Banon admitted the reason for the 2021 change: "We had issues with AWS and the market confusion their offering was causing".
- Skipped versions: in 2016, Elasticsearch jumped straight from 2 to 5 to align version numbers across the whole stack.
Strengths and limitations
| Strengths | Limitations |
|---|---|
| Full-text search at scale, distributed automatically | Not a transactional database |
| Fast aggregations, near real time (about 1 s) | High memory and disk cost |
| JSON over HTTP API, usable from any language | Number of primary shards fixed at index creation |
| Complete ELK ecosystem for logs | Turbulent licence history (OpenSearch fork) |
Place in the system
- Complements analytical databases such as ClickHouse and Druid: Elasticsearch excels at text search, they excel at massive aggregation.
- Often fed by Kafka streams.
- Shares with Cassandra a story of distribution without a central point, but for search rather than key-based storage.
Sources
raw-data/ecosysteme/elasticsearch/elasticsearch.md- https://thedudeabides.com/articles/elasticsearch
- https://thedudeabides.com/articles/the_future_of_compass
- https://www.elastic.co/blog/you-know-for-search-inc
- https://web.archive.org/web/2013/http://www.elasticsearch.com/blog/welcome-jordan-logstash/
- https://www.elastic.co/blog/welcome-found
- https://www.elastic.co/blog/ze-bell-has-rung-thank-you-users-customers-and-partners
- https://www.elastic.co/about/press/elastic-announces-closing-of-initial-public-offering-and-full-exercise-of-the-underwriters-option-to-purchase-additional-shares
- https://www.elastic.co/blog/licensing-change
- https://www.elastic.co/blog/elasticsearch-is-open-source-again
- https://www.elastic.co/search-labs/blog/elasticsearch-history-15-years
- https://aws.amazon.com/blogs/opensource/introducing-opensearch/
- https://www.linuxfoundation.org/press/linux-foundation-announces-opensearch-software-foundation-to-foster-open-collaboration-in-search-and-analytics
- https://www.elastic.co/docs/manage-data/data-store/near-real-time-search
- https://www.elastic.co/docs/deploy-manage/distributed-architecture/clusters-nodes-shards
- Exact release date of Elasticsearch 1.0 (the 15-year blog only says 2014).
- First release published under AGPL and OpenSearch 1.0 release date: not verified.
- "Not a transactional database" and "high memory and disk cost": limitations kept from the previous page, plausible but not sourced.
- OSI status of SSPL and the Elastic License: not documented here (only Elastic's 2024 post is cited).