clockworklabs / clockworklabs/SpacetimeDB

Recommended Approach for Instanced Content

Open
#2,452 3 comments 4 reactions 1 assignee View on GitHub

@jdetter is already working on this.

Since May 5, 2025.

possibly-stale support-request
Dominant language
Rust
Stars
25.2k
Forks
1.1k
Avg merge
2d 7h
Merged PRs (30d)
46

Description

The realtime parts of my game are highly instanced (instances or raid in WoW, matches in Fortnite/DotA/etc). What is the recommended approach to do that with spacetime db?

I see two options, instance IDs or db for each instance.

With instance ids, we'd add a instance_id column to every table that has instances content. We'd have to create indexes and pollute many queries with WHERE instance_id = ?. It might also have difficulty scaling at some point.

With multiple DBs, we'd init a new DB for each instance and shut it down after the match is over. This might have a high cost for startup and shutdown. It also might not easily support replays or other innate features well.

Which would the creators of the system or expert users recommend?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.