SpacetimeDB: Client-to-Database Request Flow
How a client action flows through the system without a separate application server
Simulate Write (Reducer Call)
Simulate Subscribe + Sync
Reset
SpacetimeDB Process (single binary)
WebSocket
WebSocket
Call reducer
Read/Write
WAL
Row changed
Push diff
Client A
(calls reducer)
Client B
(subscribed to table)
WebSocket Gateway
WASM Module
(Your Code)
Tables + Reducers
Rust | C# | TS | C++
Subscription
Engine
In-Memory Tables
All app state in RAM
ACID transactions
Sub-microsecond reads
Commit Log
(Disk / WAL)
// Your reducer runs inside the DB
#[spacetimedb::reducer]
pub fn
send_message
(ctx: &ReducerContext, text: String) {
ctx.db.
messages
().insert(Message { id: 0, sender: ctx.sender, text });
}
Interactive Diagram:
Hover over components to see details, or use the buttons above to simulate a reducer call or subscription sync.