---
title: "SurrealDB vs. Elasticsearch | Database comparison"
description: "A comparison of SurrealDB and Elasticsearch: full-text and vector search, transactions, operations, on-prem pricing, and what migration looks like."
url: https://surrealdb.com/comparison/elasticsearch
---

# SurrealDB vs. Elasticsearch

Elasticsearch is a search cluster you run beside your database. SurrealDB builds full-text and vector search into the database itself - one engine, one query language, ACID consistency.

[Try SurrealDB](https://studio.surrealdb.com/current/instances/deploy) [Contact us](https://surrealdb.com/contact)

1. ![Babcock](https://surrealdb.com/assets/static/babcock.lo4rnVg1.svg)
2. ![ING](https://surrealdb.com/assets/static/ing.X3I6S3_V.svg)
3. ![British Airways](https://surrealdb.com/assets/static/british-airways.KEsZiwV-.svg)
4. ![Nvidia](https://surrealdb.com/assets/static/nvidia.DaIEuMil.svg)
5. ![Apple](https://surrealdb.com/assets/static/apple.D5pq4flY.svg)
6. ![SpaceX](https://surrealdb.com/assets/static/spacex.CQJEk-IL.svg)
7. ![Samsung](https://surrealdb.com/assets/static/samsung.CH-vQgnb.svg)
8. ![adidas](https://surrealdb.com/assets/static/adidas.DdTC5qhk.svg)
9. ![Tencent](https://surrealdb.com/assets/static/tencent.paQmLxyy.svg)
10. ![Alibaba](https://surrealdb.com/assets/static/alibaba.B16idgfM.svg)
11. ![PolyAI](https://surrealdb.com/assets/static/poly-ai.c3w_fAg6.svg)
12. ![Later](https://surrealdb.com/assets/static/later.Ds736jFO.svg)
13. ![Verizon](https://surrealdb.com/assets/static/verizon.BI7CajdX.svg)
14. ![Liberty Mutual](https://surrealdb.com/assets/static/liberty-mutual.B7qOU1pd.svg)
15. ![Walmart](https://surrealdb.com/assets/static/walmart.BjDg_Sr8.svg)
16. ![Carrier](https://surrealdb.com/assets/static/carrier.D21gC6NX.svg)
17. ![Saks Fifth Avenue](https://surrealdb.com/assets/static/saks-fifth-avenue.COIDpLSb.svg)
18. ![San Francisco Compute Company](https://surrealdb.com/assets/static/sfcc.B7jlImq4.svg)
19. ![Shield AI](https://surrealdb.com/assets/static/shield-ai.pINZ0KJr.svg)
20. ![Wix](https://surrealdb.com/assets/static/wix.DvHhmoBi.svg)

KEY ADVANTAGES

## Why teams choose SurrealDB over Elasticsearch

Elasticsearch is a dedicated search layer that data must be synced into. SurrealDB makes search an index on the transactional data itself - so relevance, freshness, and consistency come from one system.

### Search where the data lives

Full-text (BM25) and vector (HNSW) search are native index types on transactional tables - no separate cluster to deploy, sync, or reconcile.

### Every signal in one query

Combine keyword relevance, vector similarity, graph traversal, and structured filters in a single SurrealQL statement.

### Simpler to operate

A single Rust binary with no JVM - no heap tuning, shard planning, or index lifecycle policies to manage.

### Lower on-prem cost

The engine is free to self-host with every feature included - no per-node subscription tiers. Support and managed cloud are optional.

HOW IT COMPARES

## How SurrealDB and Elasticsearch differ

Modern applications need search that is consistent with the data underneath it. Running a search cluster beside the primary database means an ingest pipeline to build, monitor, and reconcile - and search results that lag the source of truth.

Feature

Elasticsearch

SurrealDB

Role in the stack

A secondary search layer. Data is copied in from a primary database through an ingest pipeline you build and monitor.

The primary database. Full-text and vector search are index types on the transactional data itself - nothing to sync.

Architecture

Lucene-based distributed search cluster on the JVM. Data lives in index shards that operators size, allocate, and rebalance.

Multi-model database in a single Rust binary, with compute-storage separation for distributed deployments.

Full-text search

Mature BM25 full-text with analysers and highlighting - its core strength.

Native BM25 full-text with custom analysers and highlighting, queried in SurrealQL alongside every other data model.

Vector search

dense_vector fields with HNSW-based kNN, queried through the search API.

Native HNSW vector indexes, combined with keyword scores, graph traversal, and structured predicates in one statement.

Consistency & transactions

No multi-document ACID transactions. Single-document reads are realtime, but search only reflects writes after an index refresh (near-real-time).

ACID transactions with read-your-writes - search results always reflect committed data.

Relationships

No general-purpose joins or graph traversal. Nested documents, parent-child mappings, and limited ES|QL lookup joins emulate relationships, with well-known performance costs.

Record links and native graph traversal with typed, queryable edges - relationships are first-class.

Live updates

No push-based query subscriptions - clients poll for changes.

Native live queries stream result changes to clients over WebSocket.

Security & permissions

TLS and role-based access in the free tier; document-level and field-level security sit in paid subscription tiers.

Record-level permissions defined in the schema and enforced by the engine - included in the open source core.

Query language

JSON Query DSL plus ES|QL for search and aggregations, with administration through separate REST APIs.

One SQL-like language - SurrealQL - across every model, plus SDKs, REST, WebSocket, and live queries.

Operations

JVM heap tuning, shard sizing, index lifecycle management, and cluster rebalancing as routine operator work.

Single binary, no JVM. Runs embedded, single-node, or clustered without manual shard planning.

On-prem pricing & licensing

Free Basic tier with advanced features gated behind paid self-managed subscription tiers, priced per node and negotiated with sales.

Open source engine, free to self-host with every feature included. Paid support and managed cloud are optional.

MIGRATION

## What moving off Elasticsearch looks like

Migration is mechanical rather than architectural: export documents with the scroll or point-in-time API and bulk-insert them into SurrealDB; translate index mappings into table and field definitions; recreate analysers and search settings as analyzer and index definitions; and port Query DSL queries to SurrealQL. Most teams run both systems in parallel behind their search interface until results match, then cut over - and retire the ingest pipeline that kept the two stores in sync. [Talk to us](https://surrealdb.com/contact) about a structured migration workshop for your workload.

```
1-- Search is an index definition, not a second system2DEFINE ANALYZER report_text TOKENIZERS class FILTERS lowercase, snowball(english);3DEFINE INDEX report_search ON report FIELDS content FULLTEXT ANALYZER report_text BM25 HIGHLIGHTS;4DEFINE INDEX report_vectors ON report FIELDS embedding HNSW DIMENSION 768;56-- Hybrid retrieval: keyword relevance and vector similarity7LET $q = "credential stuffing incident reports";8LET $vec = fn::embed($q);910-- Vector11LET $vec_results = SELECT id, title,12    (1 - vector::distance::knn()) as vec_score13FROM report14WHERE embedding <|10,40|> $vec;1516-- BM2517LET $bm25_results = SELECT id, title, content,18    search::score(1) as bm25_score19FROM report20WHERE content @1@ $q ORDER BY bm25_score DESC;2122-- Re-ranking23search::rrf([$bm25_results, $vec_results], 10);
```

TRUSTED BY

## Enterprise teams building on SurrealDB

From knowledge graphs to AI assistants - how enterprise teams are building on SurrealDB.

![Samsung](https://surrealdb.com/assets/static/4c58b81e7b3c9466.C_Hv0eml.svg) DATABASE

### [Unlocking insights with knowledge graphs](https://surrealdb.com/customer/samsung)

Samsung Ads uses SurrealDB to build dynamic, real-time knowledge graphs for smarter campaign execution - collapsing three legacy data stores into one.

Read case study

![Verizon](https://surrealdb.com/assets/static/18b99996c689000f.B5PQ-nI9.svg) DATABASE

### [AI assistant empowering 10,000 technicians](https://surrealdb.com/customer/verizon)

Verizon uses SurrealDB to power a generative AI assistant for 10,000 field technicians, delivering instant access to documentation, outage updates, and workflows.

Read case study

![Tencent](https://surrealdb.com/assets/static/401d8346058682c8.DqM87mst.svg) DATABASE

### [Unified infrastructure monitoring](https://surrealdb.com/customer/tencent)

Tencent consolidated nine backend tools into one real-time monitoring platform powered by SurrealDB's multi-model context graph.

Read case study

![PolyAI](https://surrealdb.com/assets/static/c5fa07c66cd05131.BnC7wHcc.svg) DATABASE

### [High-performance customer service AI powered by RAG](https://surrealdb.com/customer/polyai)

PolyAI connects SurrealDB to Agent Studio for low-latency, customer-controlled RAG across voice AI experiences.

Read case study

![Saks Fifth Avenue](https://surrealdb.com/assets/static/saks-fifth-avenue-white.pDJ9HGmf.svg) DATABASE

### [AI-powered personalisation at massive scale](https://surrealdb.com/customer/saks)

Saks Fifth Avenue uses SurrealDB's vector search and graph capabilities to deliver real-time, AI-powered personalisation across 5 million luxury customers and 45 million monthly product-recommendation queries.

Read case study

FREQUENTLY ASKED QUESTIONS

## Common questions about Elasticsearch

Can SurrealDB replace Elasticsearch for full-text search?

How does vector search compare between the two?

What does migrating from Elasticsearch to SurrealDB involve?

How does on-prem pricing compare?

When is Elasticsearch the better choice?

GET STARTED

## Evaluate SurrealDB against Elasticsearch

Full-text, vector, graph, and structured data in one engine - with the consistency your search layer never had.

![Samsung](https://surrealdb.com/assets/static/4c58b81e7b3c9466.C_Hv0eml.svg)![NVIDIA](https://surrealdb.com/assets/static/nvidia.DaIEuMil.svg)![Apple](https://surrealdb.com/assets/static/f7dc2519e0d212bc.Cn8MYAK7.svg)![Verizon](https://surrealdb.com/assets/static/18b99996c689000f.B5PQ-nI9.svg)![Tencent](https://surrealdb.com/assets/static/401d8346058682c8.DqM87mst.svg)

SOC 2 Type 2

GDPR

Cyber Essentials Plus

ISO 27001

[Start free with SurrealDB](https://studio.surrealdb.com/current/instances/deploy) [Talk to us](https://surrealdb.com/contact)

```json
{"@context":"https://schema.org","@type":"Organization","name":"SurrealDB","url":"https://surrealdb.com","logo":"https://surrealdb.com/assets/static/logo.BG7_TG2b.svg","description":"SurrealDB is the unified data layer for AI. A multi-model database for documents, graphs, vectors, and time-series.","foundingDate":"2022","legalName":"SurrealDB Ltd","identifier":{"@type":"PropertyValue","propertyID":"GB-COH","value":"13615201"},"address":{"@type":"PostalAddress","streetAddress":"3rd Floor, 1 Ashley Road","addressLocality":"Altrincham","addressRegion":"Cheshire","postalCode":"WA14 2DT","addressCountry":"GB"},"contactPoint":[{"@type":"ContactPoint","contactType":"customer support","email":"support@surrealdb.com","url":"https://surrealdb.com/contact","availableLanguage":"English"},{"@type":"ContactPoint","contactType":"sales","email":"info@surrealdb.com","url":"https://surrealdb.com/contact","availableLanguage":"English"},{"@type":"ContactPoint","contactType":"security","email":"security@surrealdb.com","url":"https://surrealdb.com/.well-known/security.txt","availableLanguage":"English"},{"@type":"ContactPoint","contactType":"legal","email":"legal@surrealdb.com","url":"https://surrealdb.com/legal","availableLanguage":"English"}],"hasCertification":[{"@type":"Certification","name":"SOC 2 Type 2"},{"@type":"Certification","name":"GDPR"},{"@type":"Certification","name":"Cyber Essentials Plus"},{"@type":"Certification","name":"ISO 27001"}],"owns":[{"@type":"SoftwareApplication","name":"SurrealDB","url":"https://surrealdb.com/surrealdb"},{"@type":"SoftwareApplication","name":"Agent Memory","url":"https://surrealdb.com/agent-memory"}],"knowsAbout":["multi-model databases","document databases","graph databases","vector search","time-series databases","SurrealQL","Agent Memory","real-time databases","embedded databases","context layer","graph ontology","distributed database","knowledge graphs","distributed transaction protocols","highly-scalable databases"],"sameAs":["https://www.wikidata.org/wiki/Q124316308","https://github.com/surrealdb/surrealdb","https://twitter.com/surrealdb","https://www.youtube.com/@surrealdb","https://www.linkedin.com/company/surrealdb","https://discord.gg/surrealdb","https://www.reddit.com/r/surrealdb","https://www.instagram.com/surrealdb","https://medium.com/surrealdb","https://dev.to/surrealdb"]}
```

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://surrealdb.com"},{"@type":"ListItem","position":2,"name":"Elasticsearch","item":"https://surrealdb.com/comparison/elasticsearch"}]}
```

```json
{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"Can SurrealDB replace Elasticsearch for full-text search?","acceptedAnswer":{"@type":"Answer","text":"For application and product search, yes. SurrealDB provides native BM25 full-text search with custom analysers, tokenizers, filters, and highlighting, defined as indexes on transactional tables and queried in SurrealQL. Because search runs on the primary data, results are always consistent with committed writes - there is no ingest pipeline or refresh lag. For petabyte-scale log analytics and observability pipelines built around Kibana, Elasticsearch remains a strong fit."}},{"@type":"Question","name":"How does vector search compare between the two?","acceptedAnswer":{"@type":"Answer","text":"Both use HNSW indexes for approximate nearest-neighbour search. The difference is composition: in Elasticsearch, kNN runs through the search API against synced copies of your data; in SurrealDB, vector similarity is a native SurrealQL expression that combines with BM25 keyword scores, graph traversal, and structured filters in a single statement, over data that is transactionally current."}},{"@type":"Question","name":"What does migrating from Elasticsearch to SurrealDB involve?","acceptedAnswer":{"@type":"Answer","text":"Four steps. Export documents with the scroll or point-in-time API and bulk-insert them into SurrealDB. Translate index mappings into DEFINE TABLE and DEFINE FIELD statements. Recreate analysers and search configuration as DEFINE ANALYZER and DEFINE INDEX (SEARCH for full-text, HNSW for vectors). Port Query DSL queries to SurrealQL. Teams typically run both systems in parallel behind their search interface until results match, then cut over."}},{"@type":"Question","name":"How does on-prem pricing compare?","acceptedAnswer":{"@type":"Answer","text":"Elasticsearch offers a free Basic tier, with advanced security, machine learning, and platform features gated behind paid self-managed subscription tiers priced per node and negotiated with sales. The SurrealDB engine is open source and free to self-host - including in air-gapped environments - with every feature included; you pay only for optional enterprise support or the managed cloud."}},{"@type":"Question","name":"When is Elasticsearch the better choice?","acceptedAnswer":{"@type":"Answer","text":"If your workload is centralised log analytics or observability at very large ingest volumes, with dashboards and alerting built on Kibana and the wider Elastic ecosystem, Elasticsearch is purpose-built for it. SurrealDB's advantage is application search: when the documents you search are also the operational data you read, write, relate, and secure, one engine replaces the database, the search cluster, and the pipeline between them."}}]}
```
