SpacetimeDB

active

by Clockwork Labs · since 2023 · also known as Spacetime, SpacetimeDB Maincloud

In-memory relational database that runs your server logic as WASM modules and streams changes to clients.

relationalbackend platformsource-availablegrowing

Overview

SpacetimeDB, from Clockwork Labs, combines a relational database and an application server: you write modules in Rust, C# or TypeScript whose reducers run inside the database as transactions, and clients subscribe to SQL queries and receive live updates over WebSockets. Data is held in memory with a commit log and snapshots for durability, which gives very low latency for state-heavy apps. It was built to run the MMO BitCraft and is now marketed as a reactive backend platform with a managed Maincloud. The BSL licence restricts offering it as a competing hosted service.

Strengths & trade-offs

Strengths

  • +Server logic runs inside the database, removing a network hop per operation
  • +Clients subscribe to SQL queries and get incremental updates
  • +Very low latency from in-memory state, suited to multiplayer games
  • +Generated typed client SDKs for Rust, C#/Unity, TypeScript and Unreal

Trade-offs

  • −Dataset must fit in memory on one node
  • −BSL licence limits hosting it as a service
  • −SQL support is a subset; no external BI tooling
  • −Tight coupling of app logic to the database runtime

Great for

  • +Multiplayer and MMO game backends
  • +Realtime collaborative apps
  • +Chat and presence systems

Think twice for

  • −Datasets larger than RAM
  • −Analytics and reporting
  • −Teams that need an OSI-licensed engine

Capabilities

Native or official first-party support · 8 of 25 tracked

✓Transactions
✓Joins
✓Secondary indexes
✓Stored procedures
✓Pub/Sub
✓In-memory
✓Durable persistence
✓Runs in WebAssembly
–Full-text search
–Vector search
–Geospatial
–JSON
–Change data capture
–Triggers
–Materialized views
–TTL / expiry
–Columnar storage
–Compression
–Encryption at rest
–Role-based access
–Time travel
–Branching
–Online schema changes
–Streaming ingest
–Offline sync

Scale & consistency

Comfortable data size
Small · ≤ 100 GB
Horizontal scaling
None
Multi-region
No
Transactions
Full ACID
Consistency
Strong
Schema
Strict
Architecture
In memory, Single node, Serverless
Query languages
SQL (subscription subset)

A database runs in memory on one node; size is bounded by RAM.

Deployment

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

Ecosystem

apis & protocolsWebSocket subscription protocol, HTTP API
client languagesRust, C#, TypeScript, C++

Alternatives to SpacetimeDB

Compare all→
ConvexDocument26.0

Reactive TypeScript backend with a transactional document database, server functions and live queries.

spacetimedb vs convex →
FirebaseDocument65.4

Google's app platform: Firestore, Realtime Database and Data Connect, plus auth, functions and hosting.

spacetimedb vs firebase →
SupabaseRelational54.3

Open-source Postgres backend platform: database, auth, storage, realtime and edge functions in one project.

spacetimedb vs supabase →
Zero (Rocicorp)Relational20.8

Query-driven sync engine: clients run ZQL locally against a Postgres-backed cache for instant UIs.

spacetimedb vs rocicorp-zero →
RedisKey-Value84.3

The in-memory data structure server that became the default cache, now with search, JSON and vectors built in.

spacetimedb vs redis →
InstantDBGraph20.7

Realtime client-side database with relational queries, auth and permissions; cloud sunsets in 2027.

spacetimedb vs instantdb →

SpacetimeDB FAQ

What is SpacetimeDB?

SpacetimeDB is a relational database by Clockwork Labs, first released in 2023. SpacetimeDB, from Clockwork Labs, combines a relational database and an application server: you write modules in Rust, C# or TypeScript whose reducers run inside the database as transactions, and clients subscribe to SQL queries and receive live updates over WebSockets. Data is held in memory with a commit log and snapshots for durability, which gives very low latency for state-heavy apps. It was built to run the MMO BitCraft and is now marketed as a reactive backend platform with a managed Maincloud. The BSL licence restricts offering it as a competing hosted service.

Is SpacetimeDB open source?

Not in the OSI sense. SpacetimeDB is source-available: you can read the code, but the license restricts some uses, typically offering it as a competing managed service. License: Business Source License 1.1.

Does SpacetimeDB support ACID transactions?

Yes. SpacetimeDB supports full ACID transactions, with strong consistency.

Does SpacetimeDB scale horizontally?

SpacetimeDB does not scale horizontally; it runs on a single node, so you scale it up rather than out. It is comfortable at small scale (≤ 100 GB).

How can I run SpacetimeDB?

You can self-host it, use the vendor's managed cloud and run it serverless.

What is SpacetimeDB best for?

SpacetimeDB is a strong fit for multiplayer and MMO game backends; realtime collaborative apps; and chat and presence systems. Think twice for datasets larger than RAM.

What are the best alternatives to SpacetimeDB?

Common alternatives to SpacetimeDB include Convex, Firebase, Supabase, Zero (Rocicorp) and Redis. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.

How popular is SpacetimeDB?

SpacetimeDB ranks #105 of 844 databases on the WhichDB Score (27.3/100), and #34 among relational databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.