Both a database and server combined into one, serves with lightning speed.
B

Both a database and server combined into one, serves with lightning speed.

Both a database and server combined into one, serves with lightning speed.

24,759 stars
N/A forks
N/A contributors

README

Project documentation from GitHub

SpacetimeDB: Your Database Is Now Also Your Server

Imagine you're building a multiplayer game or a real-time collaborative app. You've got your database (Postgres, maybe) and your server (Node, Python, etc.) talking to each other. Now, picture removing the server entirely and having the database handle the logic, respond to client queries directly, and push real-time updates on its own. That's the wild premise of SpacetimeDB.

It's a single binary that combines a SQL database with a compute layer that runs your application logic via WebAssembly modules. Clients connect directly to it, and it streams changes to subscribed clients instantly. The result? A dramatically simpler architecture with potentially blistering performance.

What It Does

In essence, SpacetimeDB is a relational database with a built-in, event-driven compute runtime. You define your tables with SQL and your application logic—called "modules"—in Rust (with more languages planned). These modules contain functions that clients can call remotely. When called, these functions execute within the database, have direct, low-latency access to the data, and can broadcast changes to all connected clients in real-time.

It handles the networking, the subscription model, and the consistency, letting you focus on the state and logic of your application. The "server" you'd typically build is now just business logic living inside the database.

Why It's Cool

The cool factor is all about collapsing layers. The traditional round-trip—client to server, server to database, database back to server, server back to client—is gone. The logic runs where the data lives. This is a game-changer for specific use cases:

  • Multiplayer Game Servers: Game state is the database state. Player actions trigger module functions that update the world and broadcast to all players nearby. The latency benefits are huge.
  • Real-Time Collaborative Apps: Think of apps like Figma or live document editors. Changes from one user are transactions in the DB, which then automatically become real-time events for other subscribed users.
  • Simplified DevOps: You deploy and manage one thing, not a database plus a server cluster. It's conceptually simpler.
  • Built-in Time Travel: The "Spacetime" name isn't just for show. The database has built-in tools for querying past states, which is incredibly useful for debugging, replay, and analytics.

It's not the right tool for every job (a simple website might not need this), but for stateful, real-time applications, it removes a massive amount of complexity.

How to Try It

The quickest way to get a feel is to check out the SpacetimeDB GitHub repo. The README is thorough.

To get your hands dirty

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: Feb 4, 2026