For years, we’ve been told to pick our poison: the rigid structure of SQL, the flexibility of NoSQL, or the complex relationship mapping of Graph databases. But after spending a few weeks with SurrealDB, I’m starting to think that choice is becoming obsolete. In this surrealdb review and tutorial, I’ll break down whether this ‘multi-model’ database actually delivers on its promise or if it’s just another piece of hype in the data landscape.

When I first started exploring the beginner guide to nosql vs sql databases, the trade-off was always about consistency versus scalability. SurrealDB claims to solve this by being a relational database, a document store, and a graph database all in one. More importantly, it acts as its own API layer, potentially eliminating the need for a separate backend server in some architectures.

The Strengths: Why SurrealDB is Impressive

After integrating SurrealDB into a small internal tool project, a few things immediately stood out to me:

The Weaknesses: Where It Falls Short

No tool is perfect, and SurrealDB has some growing pains that you should be aware of:

Quick Tutorial: Getting Started with SurrealDB

Let’s move from the review to the practical side. Here is how to get a basic instance running and perform your first operations.

Step 1: Installation

The fastest way to start is via the terminal. Run this command to install the SurrealDB binary:

curl -sSf https://install.surrealdb.com | sh

Step 2: Starting the Server

Start a local development server in memory for speed:

surreal start --user root --pass root memory

Step 3: Creating Data with Relations

One of the most powerful features is the ability to create relations without join tables. Here is how I set up a simple ‘User’ and ‘Post’ relationship:

-- Create a user
CREATE user:jane SET name = 'Jane Doe', email = 'jane@example.com';

-- Create a post
CREATE post:hello_world SET title = 'Hello SurrealDB', content = 'This is amazing!';

-- Relate them (Graph approach)
RELATE user:jane -> wrote -> post:hello_world SET date = time::now();
Visual representation of SurrealDB graph relations showing a user linked to a post via a 'wrote' edge
Visual representation of SurrealDB graph relations showing a user linked to a post via a ‘wrote’ edge

As shown in the image below, the way SurrealDB handles these relations is visually different from traditional foreign keys, treating the connection as a first-class entity.

Step 4: Querying the Graph

Now, let’s fetch all posts written by Jane using a graph traversal:

SELECT ->wrote->post.* FROM user:jane;

This single line replaces what would typically be a complex JOIN statement in SQL.

Performance and User Experience

In my experience, read speeds for document-style queries are on par with MongoDB. However, the real performance win happens during deep relationship queries. In a traditional SQL DB, joining five tables is a nightmare for the optimizer; in SurrealDB, traversing those same five links is a native operation.

The developer experience (DX) is top-notch. The Surrealist GUI provides a clean interface for managing data, though I still find myself spending 90% of my time in the CLI for precise control.

Comparison: SurrealDB vs. The Giants

Feature PostgreSQL MongoDB SurrealDB
Model Relational Document Multi-Model
Schema Strict Flexible Both (Hybrid)
Graph Support Via Extensions Limited Native
API Layer External Required External Required Built-in

Who Should Use SurrealDB?

I wouldn’t recommend SurrealDB for every project. If you are building a simple CRUD app with a very stable schema, stick with PostgreSQL. However, you should consider SurrealDB if:

Final Verdict

SurrealDB is an ambitious project that successfully collapses the distance between the database and the API. While the ecosystem is still maturing, the ability to perform complex graph queries with SQL-like ease is a game-changer. It has significantly streamlined my development workflow by removing the ‘middle-man’ code. My rating: 4.5/5 for innovation, 3.5/5 for ecosystem maturity.