Multi-Tenant SaaS Database Isolation: Silo vs Pool vs Bridge, Per-Tenant Keys and Tenant Moves

Multi-Tenant SaaS Database Isolation: Silo vs Pool vs Bridge, Per-Tenant Keys and Tenant Moves

Multi-Tenant Database Isolation: Silo vs Pool vs Bridge, Per-Tenant Keys and Tenant Moves

Most SaaS outages that end up in a customer’s security questionnaire are not exotic exploits. They are a missing WHERE tenant_id = ?, a connection pool that leaked one tenant’s session setting into the next request, or a “simple” tenant move that lost the last thirty seconds of writes. Multi-tenant database isolation is the discipline that prevents those failures, and it is having a moment: at re:Invent 2026, AWS previewed data groups for Amazon Aurora PostgreSQL, which give each tenant its own encryption key, its own restore and a move between clusters “within seconds.” That makes a long-standing design question concrete again. How much isolation do you buy per tenant, and what does it cost you in connections, keys and operational toil? This guide gives you the mechanisms behind silo, pool and bridge, the PostgreSQL row-level security pitfalls, per-tenant key math, and a move procedure you can actually run.

What this covers: the isolation spectrum, RLS done safely, per-tenant keys and crypto-shredding, tenant moves across shards, worked cost numbers, and a decision matrix.

Context and Background

For multi-tenant database isolation, AWS’s SaaS guidance gave the industry a shared vocabulary. The AWS Well-Architected SaaS Lens defines the silo model as “an architecture where tenants are provided dedicated resources,” the pool model as one where “tenants share resources,” and the bridge model as the acknowledgement that “many systems have a mixed mode where some of the system is implemented in a silo model and some is in a pooled model.” Those definitions are deliberately broad. They apply to compute, queues and storage, not just databases.

For the data tier, the three models map onto familiar physical layouts. Silo usually means a database instance or cluster per tenant, sometimes a whole account per tenant. Pool means shared tables with a tenant_id column on every row. Between them sit database-per-tenant and schema-per-tenant on a shared server, which most teams treat as a bridge: tenants share the engine, memory and disks, but get a separate namespace.

The incumbents each pushed one corner of this space. Citus made the pooled tenant_id model scale horizontally by distributing tables on the tenant column, and Vitess did the same for MySQL. Managed services such as Amazon RDS and Aurora made silo easy to provision but expensive to run at thousands of tenants. If you have already read our deep dive on Vitess vs Citus vs CockroachDB for horizontal sharding, you know the sharding side. This post is about the isolation side: what each layout actually protects, and where it leaks.

The other 2026 change is timing. PostgreSQL 19 was released on November 19, 2026, according to the PostgreSQL project’s documentation site, and the Aurora data groups preview runs on Aurora PostgreSQL 19 beta 4. Our PostgreSQL 19 upgrade guide covers the logical replication changes that matter for tenant moves. Row-level security itself has been in core PostgreSQL since 9.5, so the pooled model’s isolation primitive is mature. The question is whether you use it correctly.

Multi-Tenant Database Isolation: The Reference Architecture

Multi-tenant database isolation is the set of controls that stop one tenant from reading, modifying, slowing down or outliving another tenant’s data. Silo isolates with dedicated databases, pool isolates with row-level filters on shared tables, and bridge mixes both. The right choice depends on five axes, not one.

Multi-tenant database isolation reference architecture with silo, bridge and pool tiers behind a tenant catalog router

Figure 1: A tiered multi-tenant data architecture. A router consults the tenant catalog to send each request to a silo, bridge or pool tier, while the control plane rebalances tenants and KMS supplies per-tenant keys.

The diagram shows the shape most mature SaaS platforms converge on. Every request carries a tenant identifier. A router looks the tenant up in a catalog that records its tier, its physical location and its key. Large or regulated tenants live in the silo tier. Mid-size tenants live in a bridge tier where each tenant has its own database or data group on a shared cluster. The long tail lives in a pool tier, protected by row-level security. A control plane owns onboarding, moves and deletion, and it is the only component allowed to change the catalog.

Isolation has five axes, and the models differ on each

Teams often argue silo versus pool as if isolation were one number. It is at least five. Data visibility asks whether a bug can return another tenant’s rows. Performance isolation asks whether one tenant’s batch job can starve another tenant’s queries. Blast radius asks how many tenants a single failure, bad migration or corrupted index takes down. Cryptographic isolation asks whether each tenant’s data is protected by a key that can be rotated, audited or destroyed independently. Lifecycle isolation asks whether you can back up, restore, upgrade, move or delete one tenant without touching others.

Silo wins all five axes of multi-tenant database isolation by construction, at the highest cost. Pool wins on cost and fleet operations, but it relies on application and policy correctness for visibility, gets weak performance isolation, and has a blast radius equal to the whole cluster. Database-per-tenant on a shared server is the interesting middle: visibility is enforced by the engine’s database boundary, lifecycle operations such as pg_dump of one database are natural, but performance and blast radius are still shared. Mapping your requirements onto these axes makes the decision explicit instead of tribal.

Score each tenant segment on the axes. A free-tier tenant needs visibility isolation and little else. A healthcare customer may need cryptographic and lifecycle isolation, or contractually a dedicated instance. A large enterprise tenant mainly needs performance isolation. Those segments rarely land on the same model, which is why bridge is the default for most SaaS businesses past a few hundred customers.

The tenant catalog is the real architecture

The model you pick matters less than whether you have a tenant catalog that can change it later. The catalog is a small, highly available table that maps tenant_id to tier, cluster endpoint, database or schema name, key identifier, data residency region and state (active, moving, suspended, deleting). Every connection decision goes through it, usually via a cached lookup in the application or a proxy.

Without a catalog, tenant location is baked into connection strings, DNS names or configuration files, and every move becomes a deployment. With one, a move is a data copy followed by a single catalog update. This is the same idea that Vitess implements with its VSchema and routing rules, and that Citus implements with its metadata tables on the coordinator. It is also what Aurora data group endpoints appear to provide as a managed feature: AWS documentation says data group endpoints let applications keep the same endpoint when a data group moves.

The catalog also carries the state machine for moves and deletion: a moving tenant is fenced from writes during cutover, and a deleting tenant is rejected at the router. Treat it as tier-zero infrastructure, replicated, independently backed up and cached with short time-to-live values.

Aurora data groups: a managed point between bridge and silo

The re:Invent 2026 hook is worth reading precisely. AWS’s What’s New post, “Announcing data groups to simplify multi-tenancy in Amazon Aurora (Preview),” states that data groups let developers manage each tenant’s data separately inside a shared Aurora cluster. Per that announcement and the AWS News Blog roundup, each data group can use its own AWS KMS key, can be restored independently, and can be moved to another cluster within seconds regardless of data size, with no application changes. The News Blog says customers can “pack more than a thousand data groups into one cluster.” In his keynote, Swami Sivasubramanian described thousands per cluster managed as a unit.

The constraints matter just as much. The preview is limited to Aurora PostgreSQL 19 beta 4 in the Amazon RDS Database Preview environment in US East (Ohio). AWS has not published pricing, a hard per-cluster limit or a general availability date. Third-party coverage reports that preview-environment instances are deleted after 60 days and cannot feed production snapshots; treat that as reported.

Architecturally, data groups formalise the bridge tier: shared-cluster economics plus per-tenant restore and per-tenant keys. Design your catalog to treat a data group as just another placement target, so adoption is a catalog change, not a rewrite.

Pool Model Done Right: PostgreSQL Row Level Security for Multi-Tenant Tables

In the pool model, multi-tenant database isolation concentrates its risk in one place: the predicate that filters rows by tenant. Application-only filtering fails the first time someone writes a report query by hand or an ORM scope is skipped. PostgreSQL row-level security moves that predicate into the engine, so it applies to every query against a protected table, regardless of who wrote it.

The mechanics you must get exactly right

The PostgreSQL row security documentation is short and every sentence matters. Once a table has ENABLE ROW LEVEL SECURITY, “all normal access to the table for selecting rows or modifying rows must be allowed by a row security policy.” If no policy exists, “a default-deny policy is used, meaning that no rows are visible or can be modified.” A policy’s USING clause controls which existing rows are visible to SELECT, UPDATE and DELETE, while WITH CHECK controls which rows INSERT and UPDATE may produce. If you omit WITH CHECK, the USING expression is reused, which is usually what you want for tenancy.

The bypass rules are where real incidents start. “Superusers and roles with the BYPASSRLS attribute always bypass the row security system.” Table owners “normally bypass row security as well,” unless you run ALTER TABLE ... FORCE ROW LEVEL SECURITY. In practice, many teams run migrations and the application as the same role that owns the tables. That role silently sees every tenant’s rows, and RLS gives a false sense of safety. The fix is a strict role split: an owner role for migrations that never serves traffic, and an application role that owns nothing and lacks BYPASSRLS.

-- Owner role runs migrations only
CREATE ROLE app_owner NOLOGIN;
CREATE ROLE app_user LOGIN NOBYPASSRLS;

CREATE TABLE invoices (
  tenant_id  uuid    NOT NULL,
  invoice_id bigint  NOT NULL,
  amount     numeric NOT NULL,
  PRIMARY KEY (tenant_id, invoice_id)
);
ALTER TABLE invoices OWNER TO app_owner;
ALTER TABLE invoices ENABLE ROW LEVEL SECURITY;
ALTER TABLE invoices FORCE ROW LEVEL SECURITY;

CREATE POLICY tenant_isolation ON invoices
  USING (tenant_id = current_setting('app.tenant_id', true)::uuid)
  WITH CHECK (tenant_id = current_setting('app.tenant_id', true)::uuid);

GRANT SELECT, INSERT, UPDATE, DELETE ON invoices TO app_user;

Two details in that snippet carry weight. The second argument true to current_setting makes a missing setting return NULL instead of raising an error. A NULL comparison is never true, so a request that forgot to set the tenant sees zero rows rather than crashing. That is fail-closed behaviour. Second, the composite primary key leads with tenant_id. It keeps each tenant’s rows clustered in the index, makes the RLS predicate index-friendly, and is exactly the distribution key that Citus or any future sharding scheme will want.

Connection pooling is where tenant context leaks

The tenant setting has to reach the session somehow. The common pattern is SET app.tenant_id = '...' at the start of each request. That is correct for a dedicated connection and dangerous behind a transaction-mode pooler such as PgBouncer. In transaction mode, a server connection is returned to the pool after each transaction. A plain SET is session-scoped, so it survives on that server connection and the next client, possibly a different tenant, inherits it if its own SET is skipped or fails.

Sequence diagram of postgres row level security multi tenant context set per transaction through PgBouncer

Figure 2: Tenant context scoped to a single transaction. The worker sets app.tenant_id with set_config local, RLS filters the query, and the setting disappears at COMMIT so the pooled connection returns clean.

The safe pattern is transaction-local context: SELECT set_config('app.tenant_id', $1, true) or SET LOCAL app.tenant_id = ... inside an explicit transaction. The third argument true to set_config means the value is discarded at the end of the transaction, so a pooled connection cannot carry tenant state forward. Combine that with the fail-closed NULL behaviour above and a forgotten setting returns nothing instead of the previous tenant’s data. Our comparison of PgBouncer vs PgCat vs RDS Proxy covers which session features each pooler preserves in transaction mode.

A related trap is single-statement autocommit. If your driver sends set_config(..., true) as its own autocommitted statement, the setting ends with that statement’s implicit transaction and the following query runs with no tenant at all. Fail-closed saves you from a leak, but you get mysterious empty results. Wrap the setting and the query in one explicit transaction, or have the ORM’s connection checkout hook do it.

Views, functions and covert channels

RLS has edges that bite pooled designs. By default, a view accesses its underlying tables with the privileges of the view owner, and row security is checked as that owner. If the view was created by a superuser or a BYPASSRLS role, every caller of the view sees every tenant. PostgreSQL 15 added security_invoker views, which evaluate permissions and policies as the calling user. Use them for any view over tenant tables. SECURITY DEFINER functions have the same issue and deserve a review checklist of their own.

The documentation also warns about covert channels. “Referential integrity checks, such as unique or primary key constraints and foreign key references, always bypass row security.” If a globally unique constraint exists on, say, email, a tenant can probe whether an address exists in another tenant by attempting inserts and reading the error. Make uniqueness constraints tenant-scoped, UNIQUE (tenant_id, email), unless global uniqueness is a genuine business rule. Finally, the planner may push user-supplied functions below the RLS filter only if they are marked LEAKPROOF; a non-leakproof function in a WHERE clause can force a worse plan.

What RLS does not give you

RLS solves visibility. It does nothing for performance isolation, per-tenant restore or per-tenant keys. A pooled table holding 5,000 tenants has one autovacuum schedule, one set of indexes and one backup. Restoring tenant 4,217 after an accidental delete means a point-in-time restore of the whole cluster to a side instance, then a careful copy of that tenant’s rows back. That operational cost is the hidden price of pooling, and it is precisely the gap that database-per-tenant and data groups target. For noisy-neighbour controls at the request layer, see our guide to noisy neighbor isolation with shuffle sharding, per-tenant quotas and fair queuing.

Bridge Layouts: Database-per-Tenant and Schema-per-Tenant at Scale

The bridge tier looks attractive on a whiteboard and becomes painful at the wrong scale. Both database-per-tenant and schema-per-tenant on a shared PostgreSQL server give you engine-enforced namespaces and easy per-tenant dumps. Both also multiply catalog objects and connections in ways that do not show up until you have thousands of tenants.

Catalog bloat is the schema-per-tenant ceiling

PostgreSQL stores each table, index and TOAST table as a relation with its own files on disk and its own rows in the system catalogs. Consider an illustrative product with 50 tables per tenant, three indexes per table on average and one TOAST table each. That is about five relations per table. At 5,000 tenants, you have 250,000 tables and roughly 1.25 million relations. Each backend caches relation metadata it touches, autovacuum must cycle through every relation, and pg_dump of the whole server must enumerate them all.

None of this is a hard limit, and plenty of systems run with hundreds of thousands of relations. But schema migrations become the real bottleneck. An ALTER TABLE that takes 200 milliseconds per tenant takes over 16 minutes serially across 5,000 schemas, and each one takes locks. Teams end up building a migration orchestrator with per-tenant progress tracking and mixed-version support, which is the same machinery a silo fleet needs. Schema-per-tenant works well into the hundreds and needs serious tooling in the thousands.

Connections multiply with tenants

Database-per-tenant adds a second multiplier: PostgreSQL connections are bound to one database. An application tier of 20 pods, each holding a minimum of two pooled connections per tenant database, needs 20 × 500 × 2 = 20,000 server connections for just 500 tenants. PostgreSQL’s default max_connections is 100, and each backend is a full operating system process with its own memory. Even with a server-side pooler, pools are per database and user pair, so idle tenants still pin connections.

The workable patterns are lazy pools that open on demand and close idle tenant pools aggressively, or a pooler layer sized by active tenants rather than total tenants. Pooled designs avoid this entirely because every tenant shares the same database and connection pool. This connection arithmetic is often the deciding factor that pushes teams from database-per-tenant back to pool for the long tail. Citus schema-based sharding, added in Citus 12, eases the single-server ceiling by placing each distributed schema on one worker node and moving it with citus_schema_move.

Per-Tenant Encryption Keys and Crypto-Shredding

Per-tenant encryption keys turn a policy promise (“we deleted your data”) into a cryptographic fact, and they let a tenant revoke access to its own data. They also add a dependency on your key management service in the hot path.

Per tenant encryption keys hierarchy with KMS keys wrapping cached data keys and crypto-shredding on offboarding

Figure 3: Envelope encryption with per-tenant keys. Each tenant’s KMS key wraps short-lived data keys that encrypt that tenant’s rows, files and backups; scheduling deletion of a tenant’s KMS key renders its ciphertext unreadable.

Envelope encryption is the only workable pattern

You never send tenant data to KMS. Instead, the service generates a data key with GenerateDataKey, returning a plaintext key for local encryption and a ciphertext copy wrapped by the tenant’s KMS key. You store the wrapped key next to the data and discard the plaintext after use. To read, you call Decrypt on the wrapped key, then decrypt locally. Our guide to envelope encryption, KMS, HSM and key rotation covers the hierarchy in detail.

At the database layer, per-tenant keys show up in three forms. Silo databases use a different storage encryption key per instance, which is native on managed services. Aurora data groups, in preview, extend that to per-data-group keys inside a shared cluster. Pooled tables need application-level or column-level encryption, because storage encryption covers the whole volume with one key. Column-level encryption in a pool costs you server-side search and indexing on encrypted columns, so most teams encrypt only sensitive fields such as documents, notes and personal identifiers.

The KMS numbers that shape the design

AWS KMS pricing is simple and easy to underestimate. According to the AWS KMS pricing page, each customer managed key costs $1 per month, prorated hourly. The first and second rotations of a rotated key each add $1 per month, and later rotations are not billed, so a key rotated at least twice costs $3 per month. Symmetric requests cost $0.03 per 10,000, after a free tier of 20,000 requests per month.

Throughput is the harder limit. The AWS KMS developer guide states a shared quota for symmetric cryptographic operations of 10,000 requests per second in most Regions, 20,000 in Regions such as US East (Ohio) and Europe (Frankfurt), and 100,000 in US East (N. Virginia), US West (Oregon) and Europe (Ireland). That quota covers Decrypt, Encrypt and GenerateDataKey, and it is shared across all keys in the account and Region, including requests AWS services make on your behalf. The default quota for customer managed keys is 100,000 per Region per account, and it is adjustable.

Now the worked example, with illustrative workload numbers. Take 2,000 tenants, each with its own key rotated annually. Key storage costs 2,000 × $1 = $2,000 per month in year one and settles at 2,000 × $3 = $6,000 per month once every key has rotated twice. If the application calls Decrypt on every database operation at a sustained 3,000 operations per second, that is about 7.9 billion requests per month, or roughly $23,650 per month, and it consumes 30% of a 10,000 per second Regional quota on its own. Add data key caching with a five-minute lifetime across 20 application instances and the worst case drops to 20 × 2,000 × 12 × 730 = about 350 million requests per month, roughly $1,050. Caching is not optional at this scale.

# Per-tenant KMS cost model. Workload numbers are illustrative;
# prices from the AWS KMS pricing page (checked 2026-12-04).
TENANTS = 2_000
KEY_MONTH = 1.00          # USD per customer managed key per month
KEY_MONTH_ROTATED = 3.00  # after the first two billed rotations
PER_10K_REQ = 0.03        # USD per 10,000 symmetric requests
HOURS_PER_MONTH = 730

def requests_cost(n):
    return n / 10_000 * PER_10K_REQ

# No caching: one Decrypt per DB operation
ops_per_sec = 3_000
uncached = ops_per_sec * HOURS_PER_MONTH * 3_600
print(f"uncached requests/month: {uncached:,.0f} -> ${requests_cost(uncached):,.0f}")

# Cached data keys: refresh every 5 minutes per tenant per app instance
instances, refreshes_per_hour = 20, 12
cached = instances * TENANTS * refreshes_per_hour * HOURS_PER_MONTH
print(f"cached requests/month:   {cached:,.0f} -> ${requests_cost(cached):,.0f}")

print(f"keys year one: ${TENANTS * KEY_MONTH:,.0f}/month")
print(f"keys steady:   ${TENANTS * KEY_MONTH_ROTATED:,.0f}/month")

Running it prints about 7.88 billion uncached requests ($23,652), 350.4 million cached requests ($1,051), $2,000 for keys in year one and $6,000 at steady state. The cached figure is a ceiling, because idle tenants do not refresh keys. The lesson is that per-tenant keys are cheap to hold and expensive to call, so your design should minimise calls per operation rather than the number of keys.

Crypto-shredding: deletion you can prove, with caveats

Crypto-shredding means deleting a tenant by destroying its key rather than hunting down every copy of its data. It is compelling because data persists in places that row deletes never reach: WAL archives, snapshots, read replicas, analytics exports and backups held for 35 days. If every one of those copies is encrypted under the tenant’s key, destroying the key makes all of them unreadable at once.

AWS KMS enforces a waiting period of 7 to 30 days before a scheduled key deletion takes effect, which is a useful safety net against mistakes. The caveats are real, though. Crypto-shredding only works if no plaintext or differently keyed copy exists: search indexes, caches, logs, data warehouse extracts and support tickets often hold tenant data outside the envelope. Pooled storage encrypted with one volume key cannot be shredded per tenant at all. Document exactly which stores are covered by the tenant key, and run a conventional delete for the rest.

Tenant Migration Between Shards and Clusters

Tenants grow at different rates, so any multi-tenant fleet eventually needs to move a tenant: off a hot shard, into a dedicated silo after an enterprise upgrade, or to a new Region for residency. A tenant move is a small distributed systems problem with a consistency boundary at cutover. Get the state machine right and it is routine; improvise it and you lose writes.

Tenant migration between shards state machine from initial copy through change streaming, write fence, verification and catalog cutover

Figure 4: A safe tenant move. Copy, stream changes until lag is small, fence the tenant’s writes, drain, verify, flip the catalog route, then keep a reverse stream until the move has soaked.

The generic move procedure

Every robust move, whatever the tooling, follows the same steps. First, take an initial copy of the tenant’s rows to the target, typically with a consistent snapshot. Second, stream subsequent changes, usually with logical replication filtered to that tenant. Third, wait until replication lag is below a threshold such as one second. Fourth, fence writes for that tenant only, by setting its catalog state to moving so the router queues or rejects writes for a few seconds. Fifth, drain the last changes, verify row counts and checksums, flip the catalog entry to the target and lift the fence.

Two steps are often skipped. Verification catches filter bugs, especially rows in child tables that lacked a tenant_id column and were never copied. A reverse stream from target back to source, kept for a soak period, makes rollback a catalog flip rather than a restore. The write-unavailable window for one tenant is typically the fence duration, a few seconds, and nobody else is affected. That per-tenant scoping is the main operational argument for designing every table with a leading tenant_id.

PostgreSQL logical replication, Citus and Vitess

With plain PostgreSQL, you can build this with publications and subscriptions. Since PostgreSQL 15, publications support row filters, so CREATE PUBLICATION move_t42 FOR TABLE invoices WHERE (tenant_id = '...') streams one tenant’s changes. The gotchas are replication slots that retain WAL if the subscriber stalls, sequences that are not replicated and must be advanced on the target, and DDL that is not replicated during the move. Freeze schema changes for tenants in flight.

Citus packages the same idea. isolate_tenant_to_new_shard “creates a new shard to hold rows with a specific single value in the distribution column,” and its CASCADE option isolates the matching shards of all colocated tables. citus_move_shard_placement then moves that shard to another node, using logical replication by default when tables have a replica identity, or a blocking COPY with block_writes. Per the documentation, “if the move fails at any point, the function throws an error and leaves the source and target nodes unchanged.”

Vitess uses VReplication through the MoveTables workflow: create starts copying, switchtraffic moves reads and writes to the target, reversetraffic moves them back, and complete cleans up. The current MoveTables create reference lists an experimental --tenant-id flag “for the MoveTables workflow into a multi-tenant keyspace.” Treat it as experimental, as the docs do. For background on resharding approaches, see our guide to database sharding with consistent hashing and rendezvous hashing.

Where Aurora data groups change the move story

The data groups claim to watch is “moved to another cluster within seconds, regardless of data size.” Copy-and-stream moves scale with data size, because the initial copy has to read every row. A size-independent move suggests the data is not copied conventionally, consistent with Aurora’s separation of storage and compute, but AWS has not documented the mechanism, so treat that as inference. If it holds at general availability, rebalancing a hot tenant becomes a routine control-plane action rather than a planned migration.

Cost per Tenant: A Worked Comparison

Multi-tenant database isolation costs money, and the cost curve is very different across models. The numbers below are illustrative, chosen to be round and plausible rather than quoted from any price list. Plug in your own instance prices before making decisions.

Assume 2,000 tenants. In a pure silo model, each tenant gets the smallest dedicated database at an illustrative $50 per month, for $100,000 per month or $50 per tenant. In a pure pool model, the same load fits on four shared clusters at an illustrative $3,000 each, for $12,000 per month or $6 per tenant. In a bridge model, the top 20 tenants get dedicated clusters at $600 each ($12,000) and the remaining 1,980 share three pooled clusters ($9,000), for $21,000 per month, or $10.50 per tenant on average.

The silo figure is dominated by idle capacity, because most SaaS tenants are small. That is what Swami Sivasubramanian’s keynote framing described: “Give each one a dedicated cluster and your cost grows faster than actually its usage.” The bridge model’s average hides a more useful fact. The 20 siloed tenants usually pay enterprise prices that cover their $600 easily, while the long tail runs at pooled unit cost.

Add the per-tenant key overhead from the previous section. At $3 per key per month after rotation, keys add $6,000 per month across all 2,000 tenants, which is half the pooled database bill. Many teams therefore issue per-tenant keys only to tenants who need them: the silo tier, regulated tenants and anyone paying for customer-managed keys. Pooled free-tier tenants share a key. Key granularity becomes another dimension of the tiering decision rather than a global policy.

Compliance Drivers and the Decision Matrix

Compliance rarely mandates a specific multi-tenant database isolation model, but it shapes which axes are non-negotiable. SOC 2 audits look for logical access controls and evidence that they work, which a well-tested RLS policy plus role separation can satisfy. HIPAA’s Security Rule requires access controls and treats encryption as an addressable safeguard, but it does not require one database per customer; business associate agreements and customer security reviews sometimes do. Data residency rules push tenants into Region-pinned placements, which is where the catalog’s region field and the ability to move tenants matter. Our post on data residency and sovereign cloud architecture covers region pinning and customer-held keys.

Requirement Pool (shared tables + RLS) Bridge (DB or schema per tenant, data groups) Silo (dedicated cluster)
Cost per small tenant Lowest Low to medium Highest
Data visibility isolation Policy-enforced, needs testing Engine namespace Physical
Performance isolation Weak, needs quotas Weak to medium Strong
Per-tenant restore Hard, side restore and copy Natural per database; managed with data groups Native
Per-tenant keys Application-level only Per database at app level; native with data groups Native
Schema migrations One migration N migrations, orchestrator required N migrations, fleet tooling
Connection footprint Shared pool Grows with tenant count Per cluster
Tenant moves Row-filtered replication Database or schema move Whole-cluster migration
Fits Free and SMB long tail Mid-market, regulated SMB Enterprise, strict contracts

Read the matrix by row, not by column. If per-tenant restore is contractually required for every tenant, pool is out regardless of cost. If you have 50,000 free-tier tenants, silo is out. Most platforms populate all three columns, and good multi-tenant database isolation comes from a catalog that knows which tenant lives where.

Trade-offs, Gotchas, and What Goes Wrong

Multi-tenant database isolation usually fails in mundane ways. The most common pooled failure is not a missing policy but a missing table. A new table gets added without ENABLE ROW LEVEL SECURITY, and it is wide open because RLS is opt-in per table. Add a CI check that queries pg_class.relrowsecurity and relforcerowsecurity for every table in tenant schemas and fails the build if either is false. Add a test asserting the application role sees zero rows with no tenant set.

Background jobs are the second failure mode. Workers that process “all tenants” often run as a privileged role to avoid setting context, which bypasses RLS entirely. Make them iterate tenants and set context per tenant, or give them a dedicated role with narrowly scoped policies. Analytics replicas are the third: a read replica feeding a BI tool is usually queried by a role that bypasses RLS, so tenant isolation must be re-implemented in the semantic layer.

Database-per-tenant fails slowly. Migrations drift, with some tenants on version 41 and others stuck on 39 after a failed run. Connection counts creep upward until a deploy that restarts all pods triggers a connection storm.

Per-tenant keys fail at the KMS boundary. A tenant who revokes their customer-managed key takes their own data offline, which is intended, but also breaks any shared job that touches their rows, which is not. Throttling on a shared Regional quota during a cache-cold restart can cascade into a fleet-wide outage. Pre-warm key caches gradually after deploys and alarm on KMS throttling metrics.

Tenant moves fail at the edges: child tables without a tenant_id, sequences not advanced on the target, large objects or files in object storage not moved with the rows, and caches still pointing at the old location. Finally, treat preview features as previews. Aurora data groups are not yet available for production use, the version is a beta, and the mechanism is undocumented. Plan for them; do not depend on them.

Practical Recommendations

For multi-tenant database isolation that survives growth, start with the catalog, not the model. Build a tenant catalog with tier, location, key identifier, region and state before your second deployment model exists. Route every connection through it. That single decision keeps every later choice reversible.

Default the long tail to pool with RLS, and do RLS rigorously: role separation, forced policies, transaction-scoped context, fail-closed settings, tenant-scoped unique constraints and security_invoker views.

Promote tenants to bridge or silo based on measured axes: sustained resource share, contractual restore or key requirements, and residency. Make promotion a catalog-driven move, rehearsed regularly on test tenants so it never becomes a one-off project. Reserve per-tenant KMS keys for tenants who need them, and cache data keys so KMS calls scale with tenants rather than with queries.

If you run on Aurora PostgreSQL, evaluate data groups in the preview environment now. Map them in your catalog as a placement type and test restore and move behaviour, but keep production on generally available features until AWS publishes general availability, pricing and limits.

  • Build a tenant catalog with tier, location, key, region and state.
  • Split owner and application roles; force RLS on every tenant table.
  • Set tenant context per transaction, never per session, behind a pooler.
  • Add CI checks for RLS flags and a zero-rows test with no tenant set.
  • Lead keys and indexes with tenant_id.
  • Cache data keys; alarm on KMS throttling.
  • Rehearse tenant moves with verification and a reverse stream.
  • Document which stores crypto-shredding covers and which need deletes.

Frequently Asked Questions

What is the difference between silo, pool and bridge in multi-tenant SaaS?

In the AWS SaaS Lens terminology, silo means each tenant gets dedicated resources, such as its own database or cluster. Pool means tenants share resources, typically one set of tables with a tenant_id column filtered by row-level security. Bridge acknowledges that most real systems mix the two, for example pooling small tenants while siloing large or regulated ones. For databases, database-per-tenant or schema-per-tenant on a shared server is usually treated as a bridge layout, because tenants share the engine but keep separate namespaces.

Is PostgreSQL row level security safe enough for multi-tenant SaaS?

Yes, if you configure it correctly. RLS is enforced by the database engine on every query, which is stronger than application-only filtering. The risks come from configuration. Superusers, roles with BYPASSRLS and table owners bypass policies unless you use FORCE ROW LEVEL SECURITY and a separate owner role. Tenant context must be set per transaction behind a pooler. Views should use security_invoker, and unique constraints should be tenant-scoped to avoid covert channels. Add automated tests that prove a connection without tenant context sees zero rows.

How much do per-tenant encryption keys cost on AWS KMS?

According to the AWS KMS pricing page, each customer managed key costs $1 per month, and the first two rotations each add $1 per month, so a regularly rotated key settles at $3 per month. Symmetric requests cost $0.03 per 10,000 after a 20,000-request monthly free tier. For 2,000 tenants, keys alone run $2,000 to $6,000 per month. Request costs depend on design: calling Decrypt per query can cost tens of thousands of dollars monthly, while caching data keys for minutes cuts that by an order of magnitude or more.

What are Amazon Aurora data groups?

Aurora data groups are a preview feature announced at re:Invent 2026 for Aurora PostgreSQL. A data group is a container for one or more databases inside a shared Aurora cluster, typically one per tenant. Each data group can use its own AWS KMS key, can be restored independently and can be moved to another cluster within seconds, according to AWS. AWS says more than a thousand fit in one cluster. The preview runs on Aurora PostgreSQL 19 beta 4 in the RDS Database Preview environment in US East (Ohio), with no published pricing yet.

How do you migrate a tenant between shards without downtime?

Copy the tenant’s data to the target, then stream ongoing changes, usually with logical replication filtered to that tenant. When lag is near zero, fence that tenant’s writes for a few seconds, drain the final changes, verify row counts and checksums, and update the tenant catalog to point at the target. Keep a reverse stream for rollback. Citus automates parts of this with isolate_tenant_to_new_shard and citus_move_shard_placement, while Vitess uses MoveTables with SwitchTraffic. Other tenants are unaffected throughout the move.

Should I use schema-per-tenant or shared tables in PostgreSQL?

Use shared tables with RLS for large numbers of small tenants, and schema-per-tenant when you have hundreds of tenants who value namespace separation and per-tenant dumps. Schema-per-tenant multiplies catalog objects: 5,000 tenants with 50 tables each means about 250,000 tables and over a million relations once indexes are counted. Schema migrations then run thousands of times and need an orchestrator. Shared tables keep one migration and one connection pool, but make per-tenant restore and per-tenant keys harder to provide.

Further Reading

By Riju — about

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *