spacetimedb-concepts

Explain SpacetimeDB architecture and operational rules for building serverless real-time applications.

25.0k|1.0k|Updated Jun 17, 2023
One-click install
npx skills add https://github.com/clockworklabs/SpacetimeDB --skill spacetimedb-concepts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spacetimedb-concepts
Source: https://github.com/clockworklabs/SpacetimeDB/tree/main/skills/spacetimedb-concepts
Command: npx skills add https://github.com/clockworklabs/SpacetimeDB --skill spacetimedb-concepts

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a concise, opinionated reference for understanding SpacetimeDB's architecture, core constraints, and best practices so teams can design correct, low-latency real-time applications without introducing common mistakes.

Core Features & Use Cases

  • Operational rules & checklists: Five critical rules, feature implementation and debugging checklists to avoid common errors when building with SpacetimeDB.
  • Design guidance: Table and reducer design patterns, event table and subscription strategies, and principles for organizing schema by access patterns.
  • Developer workflows: Module lifecycle, supported languages, CLI commands, and identity/auth considerations for real-time games, collaborative apps, chat systems, and live dashboards.

Quick Start

Provide a concise architecture summary and a recommended table, reducer, and subscription plan for implementing a real-time multiplayer lobby.

Frequently Asked Questions about spacetimedb-concepts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does SpacetimeDB architecture handle real-time application data synchronization?

SpacetimeDB architecture handles real-time synchronization using subscription-driven reads and deterministic transactional reducers. It executes WebAssembly modules in-memory with WAL persistence to ensure low-latency updates for connected clients.

What are the core design rules for building a multiplayer game with SpacetimeDB?

Building a multiplayer game with SpacetimeDB requires following five critical operational rules for deterministic reducers and subscription patterns. Designing correct tables, event tables, and reducers prevents common real-time data synchronization errors.

How do I design tables and reducers for a real-time collaborative editor in SpacetimeDB?

Designing tables and reducers for a collaborative editor involves organizing schema by access patterns and utilizing event tables. SpacetimeDB requires deterministic transactional reducers to manage state changes and client subscriptions for live updates.

Does SpacetimeDB support TypeScript, Rust, and C# for serverless module development?

SpacetimeDB supports serverless module development across Rust, C#, and TypeScript. Developers can implement in-database WebAssembly modules and manage the module lifecycle using specific CLI commands for each supported language environment.

Why use subscription-driven reads instead of traditional queries for live dashboards in SpacetimeDB?

Subscription-driven reads in SpacetimeDB replace traditional queries to push deterministic state changes directly to live dashboards. This approach ensures low-latency synchronization by leveraging in-memory execution and WAL persistence for real-time updates.

What are the limitations of using WebAssembly modules for transactional reducers in SpacetimeDB?

WebAssembly modules in SpacetimeDB must operate as deterministic transactional reducers, meaning non-deterministic operations are restricted. Developers must adhere to strict operational checklists to avoid breaking in-memory execution and WAL persistence guarantees.