spacetimedb-concepts
SpacetimeDB Core Concepts
SpacetimeDB is a relational database that is also a server. It lets you upload application logic directly into the database via WebAssembly modules, eliminating the traditional web/game server layer entirely.
Critical Rules (Read First)
These five rules prevent the most common SpacetimeDB mistakes:
- Reducers are transactional — they do not return data to callers. Use subscriptions to read data.
- Reducers must be deterministic — no filesystem, network, timers, or random. All state must come from tables.
- Read data via tables/subscriptions — not reducer return values. Clients get data through subscribed queries.
- Auto-increment IDs are not sequential — gaps are normal, do not use for ordering. Use timestamps or explicit sequence columns.
ctx.senderis the authenticated principal — never trust identity passed as arguments. Always usectx.senderfor authorization.
Feature Implementation Checklist
More from douglance/spacetimedb
spacetimedb-typescript
Build TypeScript clients for SpacetimeDB. Use when connecting to SpacetimeDB from web apps, Node.js, Deno, Bun, or other JavaScript runtimes.
35spacetimedb-cli
SpacetimeDB CLI reference for initializing projects, building modules, publishing databases, querying data, and managing servers
15spacetimedb-rust
Develop SpacetimeDB server modules in Rust. Use when writing reducers, tables, or module logic.
12spacetimedb-csharp
Build C# modules and Unity clients for SpacetimeDB. Covers server-side module development and client SDK integration.
3