liveBook · Manning

Table-level multitenancy

As explained in Just Use Postgres!

Table-level multitenancy stores multiple tenants' data in shared tables and distinguishes records with a tenant-specific column.

Table-level multitenancy keeps multiple tenants’ records in shared tables and separates them with a column such as tenant_id. It shares database resources, but queries and access controls must preserve each tenant’s data isolation. section 2.1.1

Shared merchant tables

A brewery and a coffee chain could use the same tables, with each row carrying its merchant’s tenant_id. The example contrasts this arrangement with dedicated databases, where each merchant receives a separate database object and access is controlled through roles and permissions. section 2.1.1

How Just Use Postgres! covers it

How deep it goes
Defines tenant_id-based separation and resource sharing, but stops short of query examples, schema design, and access-control implementation.
Examples
Uses a brewery and coffee chain as tenants whose business data must remain separate.
What it assumes
Assumes familiarity with tenants and relational database objects while identifying tenant-specific columns as the separation mechanism.
What you can do after
Evaluate shared-table multitenancy against schema-level and database-level alternatives for a Postgres platform.
How it connects
Connects table-level multitenancy with tenant isolation, schema-level multitenancy, database-level multitenancy, roles, and permissions.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Just Use Postgres!. The section links point to the parts of the book it draws on.