Benchmarking SurrealDB 3.x vs. Postgres, Mongo, Neo4j and Redis (With Fsync)
SurrealDB 3.x unveils rigorous benchmarks, showcasing significant performance leaps over competitors like Postgres, MongoDB, and Neo4j, especially with full durability. This post details its multi-model capabilities and ambitious goal to be a single, performant database for diverse workloads, including future AI agent memory. It appeals to HN's interest in foundational tech challenging the status quo with transparent, reproducible results.
The Lowdown
SurrealDB has released comprehensive benchmarks for its 3.x version, meticulously comparing its performance against established database systems like PostgreSQL, MongoDB, Neo4j, Redis, and SQLite. The report emphasizes a rigorous, transparent methodology to ensure fair and production-relevant comparisons, focusing on full disk durability (fsync enabled).
- Benchmarking Methodology: All databases were tested on identical hardware using an open-source harness (
crud-bench), with workloads translated to native query languages. Crucially, every engine was configured for production-grade durability withfsyncenabled, avoiding in-memory shortcuts. - Internal Improvements: SurrealDB 3.x shows massive internal performance gains over 2.x, including a 31% faster mean CRUD throughput, 58% faster batch operations, and an astounding 11,894% (164x) faster non-indexed full-table scans due to a re-engineered query planner and storage engine.
- Comparisons Against Competitors:
- PostgreSQL/MySQL: SurrealDB is approximately 1.5x faster on write operations (creates, updates, deletes) than Postgres, though Postgres still leads on raw single-record reads. It's 5-7x faster on writes than MySQL.
- MongoDB/ArangoDB: SurrealDB is 1.3x faster on reads than MongoDB and about 2.7x faster on unindexed filter scans, while MongoDB still leads on single-record writes. Against ArangoDB, SurrealDB is 100-150x faster on writes.
- Neo4j/ArangoDB (Graph): SurrealDB outperforms Neo4j by 2-3.5x on writes and 1.5x on reads, and is roughly 35x faster on indexed predicate filter queries for graph traversals.
- Redis/KeyDB (Key-Value): SurrealDB's in-memory engine is about 3x faster than Redis on writes, updates, and deletes, while Redis retains an edge on single-record reads and large batch operations.
- SQLite (Embedded): SurrealDB embedded is significantly faster (85-110x) on writes than SQLite, with comparable single-record reads.
- Future Development: SurrealDB acknowledges current gaps where competitors excel (e.g., large batch operations, single-record writes for Mongo, indexed predicate filtering for Postgres) and outlines plans for 3.1 to address these through query planner improvements, storage layer optimizations, and batch path rewrites.
- Multi-Model Vision: The core value proposition is a single database engine (SurrealQL) handling relational, document, graph, key-value, time-series, vector, and full-text search data with transactional guarantees, deployable embedded, on a single server, at the edge, or distributed.
- AI Agent Relevance: This multi-model, performant, and flexible architecture is presented as ideal for AI agent memory, which requires a single, transactionally consistent store for diverse data types, performant access, and adaptability across local, edge, and centralized deployments.
- Expansion Plans: Future benchmarks will include CockroachDB, TiDB, Aerospike, and expand to cover graph traversals, vector search, and full-text search workloads.
By positioning itself as a unified solution for multi-model data, SurrealDB aims to eliminate the need for specialized databases across various workloads, including future-forward applications like AI agent memory. The company commits to continuous improvement, addressing current performance gaps and expanding its benchmarking scope, providing an open-source harness for reproducibility.