Schema-level multitenancy gives each tenant a dedicated schema containing its own tables, while all tenant schemas remain within one logical PostgreSQL database. This isolates merchant data without creating a separate database for every tenant. section 2.1.1
Multitenancy can isolate tenant data at several database boundaries:
- Table-level multitenancy stores all tenants in shared tables and distinguishes rows with a tenant identifier. section 2.1.1
- Schema-level multitenancy gives every tenant separate tables inside its own schema. section 2.1.1
- Database-level multitenancy gives every tenant a separate database, allowing tenant databases to be distributed across PostgreSQL servers. section 2.1.1
Merchant isolation
A brewery and a coffee chain can use the same platform without sharing business data. The demonstrated implementation chooses database-level isolation instead: separate databases named coffee_chain and brewery are created and inspected with psql. section 2.1.1
