One database that's relational, document, graph, and time-series at once.
O

One database that's relational, document, graph, and time-series at once.

One database that's relational, document, graph, and time-series at once.

32,567 stars
N/A forks
N/A contributors

README

Project documentation from GitHub

SurrealDB: One Database to Rule Relational, Document, Graph, and Time-Series Data

You've probably seen the tweet: "One database that's relational, document, graph, and time-series at once." Sounds like marketing fluff, right? But then you look at the GitHub repo and realize it's actually real. Meet SurrealDB.

SurrealDB is an open-source, multi-model database that combines the best parts of relational, document, graph, and time-series databases into a single engine. No more stitching together PostgreSQL for structured data, MongoDB for flexibility, Neo4j for relationships, and InfluxDB for time-series. One database, one query language, one deployment.

What It Does

SurrealDB is a database that treats all data as first-class citizens. You can store JSON documents, run SQL-like queries, traverse graph relationships with ->friends->posts, and automatically append timestamps to data for time-series analysis — all in the same database. It uses a custom query language called SurrealQL (pronounced "surreal QL") that feels familiar if you've ever used SQL, but extends it with document, graph, and time-series operators.

Under the hood, it's built in Rust, so performance is solid, and it supports both embedded (libSQL-style) and client-server modes. It also handles real-time subscriptions, so you can get live updates on queries without polling.

Why It's Cool

Here's what makes SurrealDB unique:

Multi-model by default. You're not forced to pick one data model upfront. Define a table like a relational schema, then store arbitrary JSON in a field for flexibility. Add edges between records for graph traversal, and query them with SELECT * FROM person WHERE ->owns->car.brand = 'Tesla'. No joins on foreign keys — just graph-style path expressions.

Time-series built-in. Every record can be automatically timestamped, and you can query "time bucketed" aggregations with SELECT count(), avg(temp) FROM sensor WHERE time > d'2024-01-01' GROUP BY time(1h). No separate pipeline or special table needed.

Real-time subscriptions. Push data to clients without WebSocket gymnastics. LIVE SELECT * FROM person gives you a stream of insert/update/delete events to your app. Great for dashboards, collaborative tools, or live feeds.

Single-node and distributed. Start with a single binary for development, scale to a cluster for production. The API is the same.

ACID transactions. Yes, even with documents and graphs. No eventual consistency surprises.

Use cases? Anywhere you'd want a flexible schema with strong consistency: SaaS backends, IoT apps with time-series sensors, soci

Did you like this issue?

Join our weekly newsletter

Love discovering amazing projects?

Help us continue bringing you the best open-source discoveries every week.

Back to Projects
Last updated: May 20, 2026