SpacetimeDB (clockworklabs/SpacetimeDB)

Searching Database…

What is this?SpacetimeDB is a relational database that is also a server: you upload your application logic into the database as a module, and clients connect straight to it with no web or game server in between. Data is synchronized to connected clients in real time.
So is it a database, a server, or both?Both. Clients call your logic directly in the database — permissions and authorization included — instead of talking to a separate web or game server, and the whole backend is written in one language and deployed as a single binary. No webservers, Kubernetes or caching layer to manage.
How do I get started with it?Install the SpacetimeDB CLI and log in — that opens a browser to authenticate with GitHub and links your identity so you can publish. A new project is scaffolded from a template, published to Maincloud, and rebuilt and republished automatically whenever files change.
Which languages can I write my backend logic in?Modules are written in Rust, C#, TypeScript or C++ — SpacetimeDB compiles your schema and business logic and runs it inside the database itself, so your whole backend ships as a single binary.
Is this mainly for games?It targets general app backends too, but real-time multiplayer is the flagship case: the entire backend of the MMORPG BitCraft Online — chat, items, terrain, player positions — runs as one SpacetimeDB module, synced to thousands of players in real-time.
Can I run it myself, or do I have to use their cloud?You can self-host it: there is a Docker setup, and installable binaries for macOS, Linux and Windows (PowerShell), verified with 'spacetime --version'. The quickstart defaults to Maincloud, their hosted option.
Is it actually open source? Can I ship a product on it?Not classic open source: it is under the Business Source License 1.1, which converts to AGPL v3.0 with a linking exception after four years. Your own code stays closed — you only contribute back changes to SpacetimeDB itself. The authors chose it to stop AWS from selling their product as a service.
How does the live sync work under the hood?A module defines tables (your data) and reducers (your logic). Clients connect, call reducers and subscribe to tables — whenever data changes, SpacetimeDB pushes updates to subscribed clients automatically.
Which engines and frameworks do the client SDKs cover?The TypeScript SDK works with React, Next.js, Vue, Svelte, Angular, Node.js, Bun and Deno; C# covers standalone apps and Unity; C++ targets Unreal Engine; and there is a Rust SDK as well.
Does hosting on Maincloud cost anything?The quickstart publishes your project to Maincloud, and the README refers to a pricing page for the details without listing numbers.
Can I set up AI coding agents to work with it?Yes — the docs include an agent setup guide for preparing your AI coding environment, alongside quickstarts for every supported language, tutorials (chat app, Unity and Unreal multiplayer) and CLI and SQL references.
What are similar projects?nakama, lore, kividb, mysql-server, kafgres, libsql, server, electric
Size
122.1 MB
Stars
25.6K
Age
3y
Commits · 90 Days