concepts
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
- Reducers are transactional. They do not return data to callers. Use subscriptions to read data.
- Reducers must be deterministic. Do not use filesystem, network, external clocks, or external random sources in reducers. Use
ReducerContextfor SpacetimeDB-provided timestamp and deterministic random values. - 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.