The Zen of SpacetimeDB
SpacetimeDB is built on 5 core principles. As you embrace these simple principles, you will find your troubles simply melt away. These principles guide both how we develop SpacetimeDB and how you should think about building applications with it.
Everything is a Table
Your entire application state lives in tables. Users, messages, game entities, sessions—all tables. There's no separate cache layer, no Redis, no in-memory state that needs to be synchronized with a database. The database is your state. All of your state.
This simplifies your mental model dramatically and it makes the impossible possible. SpacetimeDB can hot-swap server code without disconnecting clients!
When you need to store something, you define a table. When you need to query something, you query a table. When you need to update something, you update a table. When you want to restrict who can read data, you create a table.
Traditional stack: SpacetimeDB:
┌─────────────────┐ ┌─────────────────┐
│ Application │ │ │
├─────────────────┤ │ │
│ Cache │ → │ Tables │
├─────────────────┤ │ │
│ Database │ │ │