Skip to content
New

Introducing Scale: SurrealDB Cloud for high availability and scale

Learn more

1/4

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.

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

SurrealDB vs. Elasticsearch

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 about a structured migration workshop for your workload.

1-- Search is an index definition, not a second system
2DEFINE ANALYZER report_text TOKENIZERS class FILTERS lowercase, snowball(english);
3DEFINE INDEX report_search ON report FIELDS content SEARCH ANALYZER report_text BM25 HIGHLIGHTS;
4DEFINE INDEX report_vectors ON report FIELDS embedding HNSW DIMENSION 768;
5
6-- Hybrid retrieval: keyword relevance and vector similarity in one query
7LET $q = "credential stuffing incident reports";
8LET $vec = fn::embed($q);
9
10SELECT id, title,
11 search::score(1) AS keyword_score,
12 vector::similarity::cosine(embedding, $vec) AS semantic_score,
13 (keyword_score * 0.4) + (semantic_score * 0.6) AS score
14FROM report
15WHERE content @1@ $q OR embedding <|10,COSINE|> $vec
16ORDER BY score DESC
17LIMIT 10;

TRUSTED BY

Enterprise teams building on SurrealDB

From knowledge graphs to AI assistants - how enterprise teams are building on the context layer.

FREQUENTLY ASKED QUESTIONS

SurrealDB vs. Elasticsearch

GET STARTED

Evaluate SurrealDB against Elasticsearch

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

SamsungNVIDIAAppleVerizonTencent

SOC 2 Type 2

GDPR

Cyber Essentials Plus

ISO 27001

SurrealDB

The context layer for AI agents.

Documents, graphs, vectors, time-series, and memory.
One transaction, one query, one deployment.

Explore with AI

Stay in the loop

Tutorials, AI agent recipes, and product updates, every two weeks.

Independently verified

SOC 2 Type 2

GDPR

Cyber Essentials Plus

ISO 27001

Trust Centre

Copyright © 2026 SurrealDB Ltd. Registered in England and Wales. Company no. 13615201

Registered address: 3rd Floor 1 Ashley Road, Altrincham, Cheshire, WA14 2DT, United Kingdom

Trading address: Huckletree Oxford Circus, 213 Oxford Street, London, W1D 2LG, United Kingdom