Testnet is now LIVE at testnet.spacetimedb.com
! NOTE: This is a testnet, and all data will be wiped periodically.
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.
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