Skip to content

db.sb

db.sb is the one database behind api.sb, keeping every record and event of every Startup.

db.sb is the one database behind api.sb: every record, Relationship and Event of every Startup, kept forever.

What it does

Each Startup gets its own owner database: one writer, strongly consistent, every read seeing the last write. Every Event also lands in an analytics store, append-only, so Metrics, Dashboards and Portfolio queries never slow a write.

HoldsWhat it isWritten by
ThingsEvery record, typed by one or more Nouns, at its current stateCreate and update
RelationshipsNamed links between Things, read from both endsAny Verb that links
EventsThe immutable history of every changeEvery Action
TenantsOne partition per Customer inside the Startup's databaseTenant.provision

db.sb is the only source of truth. Search indexes, caches, edge copies and relational views are projections rebuilt from it, so losing one loses nothing. A store that the record cannot rebuild is refused.

Nothing is forgotten. A delete is a marker that hides a Thing from reads and keeps its Events, and any Thing reads back as of a past moment.

Every Thing has one file form: YAML frontmatter for its data and an MDX body for its content. Git imports and exports that form, and db.sb stays the record. A repository is either db-first, with git a rebuildable copy, or git-first, with each commit imported as a Change.

One owner database carries about 1,000 writes a second. Past that, a Collection shards by key under the same ids.

A read can also resolve. Thing.resolve finds the one Thing that matches a shape, or creates it, and says which it did.

Built from

None.

Surfaces

  • api.sb is the only way to read or write db.sb, so every write is a checked, attributed Action.
  • Point-in-time reads pass at to any get, or append @ and a time or Version to a record URL: GET /orders/order_1@2026-10-01.
  • Analytics queries run over the Event store through Collection.query, on every Interface.
  • npx startup-builder show /orders --output md prints the file form of a Collection; Startup.import reads it back.

Next steps