# db.sb

URL: /code/platform/db-sb · Id: `product: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](/code/platform/api-sb): every record, [Relationship](/business/nouns/relationship) and [Event](/business/nouns/event) of every [Startup](/business/nouns/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](/business/nouns/metric), [Dashboards](/business/nouns/dashboard) and [Portfolio](/business/nouns/portfolio) queries never slow a write.

| Holds | What it is | Written by |
| --- | --- | --- |
| [Things](/business/nouns/thing) | Every record, typed by one or more [Nouns](/business/nouns/noun), at its current state | Create and update |
| Relationships | Named links between Things, read from both ends | Any [Verb](/business/nouns/verb) that links |
| Events | The immutable history of every change | Every [Action](/business/nouns/action) |
| [Tenants](/business/nouns/tenant) | One partition per [Customer](/business/nouns/customer) inside the Startup's database | `Tenant.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](/business/nouns/change).

One owner database carries about 1,000 writes a second. Past that, a [Collection](/business/nouns/collection) shards by key under the same ids.

A read can also resolve. [`Thing.resolve`](/business/nouns/thing/resolve) finds the one Thing that matches a shape, or creates it, and says which it did.

## Built from
None.

## Surfaces
- [api.sb](/code/platform/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](/business/nouns/version) to a record URL: `GET /orders/order_1@2026-10-01`.
- Analytics queries run over the Event store through [`Collection.query`](/business/nouns/collection/query), on every [Interface](/business/nouns/interface).
- `npx startup-builder show /orders --output md` prints the file form of a Collection; `Startup.import` reads it back.

## Next steps
- [Database](/code/platform/capabilities/database): Nouns, Things, Collections and Versions in depth.
- [Search](/code/platform/search) and [KV and cache](/code/platform/kv-cache): two projections of db.sb.
- [The response envelope](/code/api/guides/envelope): what a read returns.