Skip to content

Stop choosing. SurrealDB launch week, 12-16 October

See what's coming

SurrealDB vs.
MongoDB

MongoDB. A document database with specialised subsystems around it.
SurrealDB. A unified, transactional, multi-model database.
The difference. One engine and one transaction across every model.

01 |THE DIFFERENCE

Where MongoDB adds subsystems, SurrealDB runs natively

MongoDB added search, vector and limited graph features as separate systems. SurrealDB runs all of them in one engine, in one transaction.

02 |THE SAME QUERY

Similar documents, from one team, this quarter. A staged aggregation with a search stage and a lookup in MongoDB. One statement in SurrealQL.

MongoDB Atlas

1// Atlas: $vectorSearch first, then a $lookup, then the filter
2db.documents.aggregate([
3 { $vectorSearch: { index: "vec", path: "embedding", queryVector: q,
4 numCandidates: 100, limit: 10 } },
5 { $lookup: { from: "people", localField: "authorId",
6 foreignField: "_id", as: "author" } },
7 { $match: { "author.team": team, published: { $gt: since } } },
8 { $project: { title: 1, score: { $meta: "searchScore" } } }
9])

SurrealQL

1-- SurrealQL: the similarity and the path, together
2SELECT
3 title,
4 vector::similarity::cosine(embedding, $q) AS score
5FROM document
6WHERE embedding <|10|> $q
7 AND <-authored<-person->member_of->team CONTAINS $team
8 AND published > time::now() - 90d
9ORDER BY score DESC;

03 |HOW IT COMPARES

How SurrealDB and MongoDB differ

Richer models, temporal logic and AI retrieval push document stores with external subsystems to their composability limits. SurrealDB runs everything in one distributed engine.

Data and relationships

SurrealDB

MongoDB

Models
NativeNative support for document, relational, graph, key-value, time-series, vector, full-text search, and geospatial.
Document-firstDocument-first. Graph traversal support is limited. Relational semantics are not planner-driven.
Indexing
UnrestrictedIndexing across arrays, nested fields, vectors, and relationships without compound multikey restrictions.
RestrictedCompound indexes may include only one array field. Deeply nested or multi-array document models cannot be efficiently indexed.
Temporal capabilities
First-classTemporal querying is first-class. Time constraints participate directly in graph traversal.
NoneNo temporal graph querying. Time filters cannot participate directly in traversal semantics.
Consistency and queries
Transactional consistency
Every modelACID transactions across documents, relational joins, graph traversal, vector search, and full-text search.
LimitedACID transactions are limited, costly under contention, and do not extend to search, vectors, or graph traversal.
Query execution
One planSingle declarative query language with a unified execution plan. All retrieval primitives are co-planned.
StagedQueries split into multiple stages, with $search required first. No unified planner across document, search, vector, and graph operations.
Operations and cost
Architecture
One engineUnified, distributed multi-model engine. Query execution, indexing, storage, and transactions operate inside a single system.
SubsystemsDocument-first with secondary views, full-text search, and vectors requiring duplicated data and separate async pipelines.
Pricing
UsageUnified engine eliminates the need for separate search, vector, and graph systems. Costs scale linearly.
InfrastructureCosts increase with sharding, coordination overhead, Atlas dependency, and duplicated subsystems.

TRUSTED BY

Enterprise teams building on SurrealDB

MongoDB,answered

MongoDB is a document database that adds search, vector and limited graph features through separate subsystems. SurrealDB is one engine for documents, graphs, vectors, full-text, temporal and relational queries.

THE PLATFORM

Everything an application and its agents know. Five surfaces, one engine.

IN PRODUCTION

Trusted at scale. Samsung, Nvidia, Verizon, Tencent, and Walmart run on SurrealDB.

14,000+

Developers building on SurrealDB Cloud

4M+

Developers building on SurrealDB worldwide

FROM THE TEAMS

SurrealDB gives us a foundation where we can unify semantic search, knowledge graphs, and AI-driven decision making without stitching together multiple systems. Collapsing responsibility into SurrealDB has become our default engineering posture.
Justin Foley

VP of Engineering, Later

GET STARTED

Migrate from MongoDB. Documents, plus the graphs, vectors and SQL MongoDB leaves to other systems.

SurrealDB

The context and memory layer for AI agents

Database. Graphs, vectors, documents and relational data in one engine, in a single ACID transaction.
Agent Memory. Connects and retrieves context wherever your data lives, every fact carrying its source.
Cloud. Fully managed, in the cloud provider and region you choose.

Explore with AI

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