spacetimedb-concepts

Originally fromdouglance/spacetimedb
Installation
SKILL.md

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:

  1. Reducers are transactional — they do not return data to callers. Use subscriptions to read data.
  2. Reducers must be deterministic — no filesystem, network, timers, or random. All state must come from tables.
  3. Read data via tables/subscriptions — not reducer return values. Clients get data through subscribed queries.
  4. Auto-increment IDs are not sequential — gaps are normal, do not use for ordering. Use timestamps or explicit sequence columns.
  5. ctx.sender() is the authenticated principal — never trust identity passed as arguments. Always use ctx.sender() for authorization.

Feature Implementation Checklist

Related skills
Installs
126
GitHub Stars
24.7K
First Seen
Mar 8, 2026