Postgres supports parts of this through extensions and workarounds. With pgvector, it can handle vectors, full-text search, and relational queries - but not native graph traversal, temporal graph queries, or unified multi-model execution. As complexity grows, teams juggle joins, indexes, and loosely connected features.
SurrealDB runs all of this natively in one system.
Vector + graph retrieval: Vectors identify similar items. Graphs add relationship context during retrieval.
Higher accuracy through context: Graph-based retrieval improves relevance by incorporating relationship-aware reasoning.
Lower cost at scale: SurrealDB typically compresses Postgres/SQL datasets by 70-80%, significantly reducing storage and infrastructure costs.
Operational simplicity: One engine replaces kNN, multi-store SQL pipelines, and distributed instance coordination.
SurrealDB is used where retrieval accuracy, operational efficiency, and scale matter.
SurrealDB vs. Postgres + pgvector at a glance
Postgres is a powerful relational database, but AI and retrieval workloads stretch it beyond its original design. Combining vectors, search, constraints, and relationships adds indexing and operational complexity.
SurrealDB:handles these workloads natively - no workarounds required.
Retrieval capability
Postgres + pgvector supports vectors, full-text search, and relational queries, but retrieval requires manual joins, CTEs, multi-stage pipelines, and extra tooling.
SurrealDB provides vectors, full-text search, document filters, and graph traversal in a single native query - no plugins or frameworks required.
Accuracy and relevance
Postgres + pgvector: Relationships are expressed indirectly through joins and cannot participate naturally in retrieval semantics.
SurrealDB: Native graph traversal brings relationship-aware context directly into retrieval.
Cost and efficiency
Postgres + pgvector: Storage and compute costs grow with index count, replicas, and data duplication.
SurrealDB: Typically compresses PostgreSQL data by 70-80%, reducing storage, network, and compute costs.
SurrealDB delivers relationship-aware retrieval
Relationship queries without joins
Postgres expresses relationships through foreign keys and joins. As queries grow more complex, joins increase planning time, execution cost, and index dependency.
SurrealDB:performs relationship-style querying without joins. Relationships are first-class and traversed directly, eliminating join planning and reducing query complexity.
Native graph model
Postgres + pgvector:
Relationships expressed through joins
Query cost increases with join depth
Heavy reliance on secondary indexes
SurrealDB:
Native graph model
Direct traversal without joins
Relationships participate directly in retrieval logic
SurrealDB scales without operational overhead
Distributed by design
Postgres scaling relies on primary/replica setups and manual sharding, increasing complexity and risk.
SurrealDB:scales horizontally without sharding or manual coordination.
Fewer indexes by design
Postgres depends on secondary indexes for performant joins and filters, which grow costly as schemas evolve.
SurrealDB:encodes record location in its primary keys, resolving relationships directly and reducing the need for secondary indexes.
Live schema evolution
Postgres + pgvector: Schema changes on large tables are disruptive and difficult to perform safely.
SurrealDB: Schema can be introduced incrementally and evolved live without downtime.
Indexing without blocking
Postgres + pgvector: Index rebuilds can block writes and impact availability. Index composition is limited.
SurrealDB: Indexes are built and maintained concurrently without locking, across vectors, documents, and relationships.
Native full-text search
Postgres + pgvector: Full-text search relies on specialised functions and patterns that do not compose cleanly with vectors and joins.
SurrealDB: Full-text search is native and fully composable with vector similarity and relationship traversal.
Platform comparison
Postgres with pgvector can be extended to approximate modern retrieval - but at the cost of joins, indexes, sharding, and operational complexity.
SurrealDB:delivers relationship-aware retrieval, lower cost, and simpler scaling in one unified engine.
Business model
| PostgreSQL | SurrealDB |
|---|---|
| Fully open source database with a large ecosystem of extensions required to support modern workloads. | Fully open source and available for use. Commercial offering is built on the same core engine without fragmenting capabilities. |
Availability
| PostgreSQL | SurrealDB |
|---|---|
| Runs locally, on-premises, and on all major public clouds. Distributed deployments require external tooling and differ significantly from single-node behaviour. | Runs locally, on-premises, and on all major public clouds. Deployable as embedded, single-node, or distributed. Identical capabilities in all environments. |
Architecture
| PostgreSQL | SurrealDB |
|---|---|
| Monolithic relational engine originally designed for single-node operation. Extensions (pgvector, FTS, JSON) bolt additional capabilities onto a core not designed for multi-model execution. | Distributed, multi-model database with a decoupled query and storage layer. Designed to be efficient both as a single node and as a distributed system. Excels at heavy read/write workloads. |
Scale
| PostgreSQL | SurrealDB |
|---|---|
| Scaling beyond a single node requires manual primary/replica coordination. Write scaling is limited. Large deployments commonly require manual sharding, increasing operational and application complexity. | Horizontally scalable for both reads and writes by adding query nodes and scaling the underlying distributed storage layer. Designed to eliminate the need for sharding. Suitable for very large datasets and high throughput. |
Resilience
| PostgreSQL | SurrealDB |
|---|---|
| Primary/replica architectures introduce failover complexity. Loss of the primary impacts write availability until recovery. | High availability and fault tolerance provided by the distributed backend. No single node failure brings down the system. |
Transactional consistency
| PostgreSQL | SurrealDB |
|---|---|
| Strong ACID guarantees within a single node. Distributed consistency depends on external tooling and architecture choices. | Supports distributed ACID transactions with strong consistency guarantees across all supported models. |
Models
| PostgreSQL | SurrealDB |
|---|---|
| Relational database with JSON, full-text search, and vector support via extensions. No native graph model or temporal graph querying. | Native multi-model database supporting document, relational, graph, key-value, time-series, vector, full-text search, and geospatial access patterns in one system. |
Relationship querying
| PostgreSQL | SurrealDB |
|---|---|
| Relationships expressed through foreign keys and joins. Query complexity and cost increase with join depth and cardinality. | First-class relationships traversed directly without joins. Relationship queries do not require join planning or join indexes. |
Indexing model
| PostgreSQL | SurrealDB |
|---|---|
| Heavy reliance on secondary indexes for joins and filters. Index rebuilds can block writes and increase operational overhead as schemas evolve. | Fewer secondary indexes required. The primary key of each record encodes its location, enabling direct access and relationship traversal without join indexes. Indexes are built and maintained concurrently without locking. |
Schema evolution
| PostgreSQL | SurrealDB |
|---|---|
| Schema changes on large tables are disruptive and operationally risky. Migrations often require maintenance windows. | Schema-flexible by design. Teams can start schemaless and incrementally enforce schema without downtime. |
Pricing and cost efficiency
| PostgreSQL | SurrealDB |
|---|---|
| Infrastructure and operational costs grow with index count, replicas, and sharding. Storage and compute costs scale with data duplication and coordination overhead. | Straightforward pricing with architectural efficiency. Typically provides 70-80% compression of PostgreSQL data, significantly reducing storage and infrastructure costs. Costs scale linearly with usage. |
