abhi-g.dev
SearchOct 20245 min read

OpenSearch vs Elasticsearch

Forked from the same code in 2021, the two now differ on licence, vector search, query language, and managed-service cost. A decision rule for new deployments and for teams already on one.

OpenSearch was forked from Elasticsearch 7.10.2 in 2021 after Elastic changed its licence from Apache 2.0 to SSPL and the Elastic License. Three years on, both are actively developed, both are used at scale, and the choice between them is no longer just about the licence.

Licence

ElasticsearchOpenSearch
LicenceSSPL or Elastic License 2.0; AGPL 3.0 announced August 2024, shipping in 8.16Apache 2.0
Offer as a managed servicepermitted under AGPL with source obligations; restricted under the otherspermitted
GovernanceElastic N.V.Linux Foundation (OpenSearch Software Foundation, since 2024)

Elastic announced AGPL as an option in August 2024, which addresses the "not open source" objection for most users. For a company that wants to embed search in a product it sells as a service, Apache 2.0 remains simpler to reason about.

Features

Both cover the core: inverted index, aggregations, index lifecycle management, snapshot and restore, security, alerting, and dashboards (Kibana and OpenSearch Dashboards respectively). Differences that matter in practice:

Vector search. Both support k-NN. Elasticsearch's implementation is built into Lucene's HNSW with dense_vector; OpenSearch's k-NN plugin supports Lucene, FAISS, and NMSLIB engines, with more tuning options and the ability to use approximate search on larger indexes. OpenSearch also ships a neural search plugin that runs embedding models in-cluster.

Query language. Elasticsearch has ES|QL, a piped query language introduced in 8.11. OpenSearch has PPL (piped processing language) and SQL through a plugin. The two are not compatible.

Machine learning. Elasticsearch ML (anomaly detection, inference) is a paid feature. OpenSearch's anomaly detection and ML Commons are Apache-licensed.

Search relevance. Elasticsearch has more mature semantic and learned-sparse retrieval (ELSER) in the commercial tier. OpenSearch's equivalents are newer.

Performance. Benchmarks from each vendor favour that vendor. Independent measurements show Elasticsearch ahead on some indexing and aggregation workloads by tens of percent, with the gap varying by version and workload. For most deployments the difference is smaller than the difference between a well-tuned and a badly-tuned cluster of either.

Operations

Managed services. Elastic Cloud runs on AWS, Azure, and GCP. Amazon OpenSearch Service is the AWS-native option and integrates with IAM, CloudWatch, and VPC directly. Other providers (Aiven, Instaclustr) offer OpenSearch.

Clients. Elasticsearch clients after 7.10 include a product check that refuses to connect to OpenSearch. OpenSearch maintains its own client libraries. A codebase on Elasticsearch 7.x clients works against either; moving to 8.x clients locks in Elasticsearch.

Upgrade path. Elasticsearch 7.10 to OpenSearch is a supported in-place upgrade. OpenSearch to Elasticsearch is a reindex.

Cost

Self-hosted, the software cost is zero for both; the difference is in paid features. Elasticsearch gates ML, some security features, and cross-cluster replication behind a subscription. OpenSearch includes equivalents at no cost. Managed, Amazon OpenSearch Service is typically priced below Elastic Cloud for comparable instances, but Elastic Cloud's serverless tier changes the comparison for bursty workloads.

Decision

New deployment on AWS, standard search and logging: OpenSearch. Native integration, Apache 2.0, no feature gating, and the cost advantage on the managed service.

New deployment needing Elastic's commercial ML or relevance features, or already on Elastic Cloud: Elasticsearch. The commercial features are ahead and the AGPL option resolves most licence concerns.

Existing Elasticsearch 7.x: either is reachable. Decide by the two points above before upgrading past 7.10, because after that the clients diverge.

Existing OpenSearch: stay, unless a specific Elasticsearch-only feature is required. The migration cost is a full reindex and client rewrite.

The projects are more alike than the marketing on either side suggests. The decision is mostly about where the cluster will run and whether any gated feature is needed.