Testnet is now LIVE at testnet.spacetimedb.com! NOTE: This is a testnet, and all data will be wiped periodically.

BETA v0.12

Login
Transactional, relational, multiplayer computing.

The easiest way to build a multiplayer

use spacetimedb::{println, table, reducer, ReducerContext, Table};

#[table(name = person, public)]
pub struct Person {
    name: String,
}

#[reducer]
pub fn add(ctx: &ReducerContext, name: String) {
    println!("Inserting {}", name);
    ctx.db.person().insert(Person { name });
}

#[reducer]
pub fn say_hello(ctx: &ReducerContext) {
    for person in ctx.db.person().iter() {
        println!("Hello, {}!", person.name);
    }
    println!("Hello, World!");
}

Try the demo

Start by editing the example Rust or C# module. Click "Go live" to publish your SpacetimeDB module instantly.
use spacetimedb::{println, table, reducer, ReducerContext, Table};

#[table(name = person, public)]
pub struct Person {
    name: String,
}

#[reducer]
pub fn add(ctx: &ReducerContext, name: String) {
    println!("Inserting {}", name);
    ctx.db.person().insert(Person { name });
}

#[reducer]
pub fn say_hello(ctx: &ReducerContext) {
    for person in ctx.db.person().iter() {
        println!("Hello, {}!", person.name);
    }
    println!("Hello, World!");
}

A GAME WITHOUT A GAME SERVER.

What is SpacetimeDB

You can think of SpacetimeDB as both a relational database and a server combined into one. Instead of deploying a web or game server that sits in between your clients and your database, clients connect directly to the database and execute your logic inside the database itself. No more Docker, Kubernetes, VMs, microservices or extensive ops infrastructure.

SpacetimeDB has enabled us to build our massively multiplayer game, BitCraft, with a small team. Its entire backend, including all game logic, real-time player positions, and all persistent state, is implemented as a SpacetimeDB module.

Learn More

Supporters

Some of our investors

Why use SpacetimeDB
Deploying to
Cloud Service Provider
  • 1
    Set up accounts/billing with a cloud provider
  • 2
    Figure out cloud services for your use case
  • 3
    Provision services and machines
  • 4
    Configure a persistence layer/database
  • 5
    Manage persistent state across deploys
  • 6
    Become a Docker + Kubernetes wizard
  • 7
    Configure networking policy
  • 8
    Choose a performant web server technology
  • 9
    Use an ORM or raw SQL to talk to your database
  • 10
    Develop a protocol for client/server state sync
  • 11
    Hard-code persistence logic for in-memory state
  • 12
    Design a bespoke permissions system
  • 13
    And after all that you've still got atomicity, consistency, and isolation problems!
  • 1
    Set up accounts/billing with a cloud provider
  • 2
    Figure out cloud services for your use case
  • 3
    Provision services and machines
  • 4
    Configure a persistence layer/database
  • 5
    Manage persistent state across deploys
  • 6
    Become a Docker + Kubernetes wizard
  • 7
    Configure networking policy
  • 8
    Choose a performant web server technology
  • 9
    Use an ORM or raw SQL to talk to your database
  • 10
    Develop a protocol for client/server state sync
  • 11
    Hard-code persistence logic for in-memory state
  • 12
    Design a bespoke permissions system
  • 13
    And after all that you've still got atomicity, consistency, and isolation problems!
Deploying to
SpacetimeDB
1
Write a SpacetimeDB module
2
Compile the module to WebAssembly
3
Upload to SpacetimeDB
Modern database environment
SpacetimeDB takes stored procedures to the next level, allowing you to deploy your whole app directly into the database. It's like a smart contract... if smart contracts were fast, cheap, and easy to use.
documentation
Deploy your entire application.

Relational database environment

  • The Cloud Operating System

    The Cloud Operating System

    You can think of SpacetimeDB as an operating system for the cloud. Just as your PC operating system abstracts away the hardware, SpacetimeDB abstracts away the complexities of managing many physical machines in the cloud, allowing you to treat them a single logical computer running one big distributed operating system.
  • Beautifully generalized

    Beautifully generalized

    The category of applications that we call games spans anywhere from Solitare to Among Us to World of Warcraft. The only systems versatile enough to serve as an engine for games are databases. SpacetimeDB doesn't constrain you to match making, or real-time movement, or guns, or characters.
  • ACID everything

    ACID everything

    Every update to your application state is 100% atomic, consistent, isolated, and durable. You get to write your game logic inside single-threaded, atomic functions which are called directly from clients, while we multi-thread *everything* behind the scenes. You have access to all of your application state through indexed, in-memory relational tables that are defined by your application.
  • Data-oriented and ECS inspired

    Data-oriented and ECS inspired

    The design and architecture of SpacetimeDB is highly influenced by a data oriented approach to programming. Writing Entity-Component-System applications is both natural and extremely performant in SpacetimeDB. In fact, if you squint the ECS model is a special case of the Relational Model where Components are relations that reference an Entityld relation.

Old ideas. Brand new paradigm.

SpacetimeDB is a developer-first platform that builds on concepts from computer science which date back to the 1960s. We're bridging the gap between theoretical foundations and developer experience to make development delightful again.
  • Serverless

    Serverless

    SpacetimeDB is a serverless technology. That means you don't have to deal with machines, VMs, containers, or deployments. All you do is upload your module and we handle scaling, replicas, scheduling, data migration, and more.
  • ACID + Relational

    ACID + Relational

    SpacetimeDB is a genuine, general purpose relational database with ACID transactions. That means it's just as powerful as your old relational database and better performance is just an index declaration away. Imagine being able to query every single piece of live game data at run-time.
  • Built for massive games

    Built for massive games

    SpacetimeDB wasn't built in a vacuum. It's the system powers our own large-scale MMORPG BitCraft. We designed it specifically for the performance requirements of games. That means extremely low latency (~100 us/Tx) and extremely high throughput (~1,000,000 Tx/s).
  • ECS Inspired
  • Blockchain interoperability
  • Declarative permissions
  • Built-in authentication
  • Composable applications
  • Horizontal scalability
  • User-generated logic (UGL)
  • Anonymous identities
  • Public key identities
  • Delegated authority
  • Secure atomic transactions
  • Command line interface
  • Real-time subscription queries
  • SpacetimeQL (SQL-like) OLTP queries
  • PostgreSQL OLAP queries
  • Secure database replication
  • Point-in time rollbacks
  • Transaction log replay
  • State snapshots
  • 1,000,000 Tx/s per database
But wait, there's more.

Additional features breakdown

  • Space and time.

    Space and time.

    The reason for the name SpacetimeDB is that we store a full-transaction history for your application. This lets you reset the state of your database to any previous point in time and replay transactions from there. This means you get replays for free. It's basically time-travel, and it's very cool.
  • User-generated logic (UGL).

    User-generated logic (UGL).

    It's incredibly easy to write and host applications in SpacetimeDB. This ease of use combined with the fact that each database can communicate with other databases means that you can compose databases together to create a tapestry of services. You can even have your users plug-in their own logic into your application. We call this "UGL".
  • Queries of all kinds.

    Queries of all kinds.

    Because your applications become part of the database, all parts of your application state are queriable. Queries are an important part of SpacetimeDB. Clients make subscription queries to get real-time updates to game state. You can make SpacetimeQL OLTP queries for one off updates to your application state or more advanced OLAP PostgreSQL analytics queries for data analysis.
  • Auditable.

    Auditable.

    Because the logic for transactions are localized to a single, atomic function SpacetimeDB is, much like smart contracts, easy to audit for security. With the ad-hoc structure of ordinary game servers, this is a completely intractable problem. Say goodbye to gold-dupe bugs.

SpacetimeDB is designed and engineered by Clockwork Labs.

With an SQL-style query language, real-time subscription queries, fully programmable permissions, transactional updates, and ultra high performance thanks to embedded application logic, it is the next generation serverless database.

Community