Database schemas
Multi tenant SaaS
Tenant isolation, and every join that could leak across it.
What this board gets wrong on purpose
The tension
`subscriptions.seats` is a number nobody enforces: no constraint ties it to the count of active rows in `memberships`, so an organisation can run twenty people on a five seat plan until billing notices. Two smaller ones are left in on purpose - `memberships` has nothing stopping the same user joining the same org twice, and an archived org keeps its unique slug forever.
The rest of this board
Available on Tier Slate
This page publishes the question. The answer — an 8-step narrated walkthrough and a 12-table schema — is the board itself, and it opens in Tierslate.
- 8walkthrough steps
- 12tables74 columns
More boards
Entity boards that Generate SQL turns into real DDL.