In a shared multi-tenant stack, every tenant draws on the same database connections, CPU and locks. A scheduled export that opens forty connections to a shared Postgres instance and holds them for an hour can drain the pool, and dashboards across the platform stall until it finishes. The customers who notice first are the ones who did nothing wrong.
That export did what it was built to do, and the platform did what a single shared stack does when one tenant’s workload outgrows the rest. The shared design is the cheapest way to run a B2B SaaS product, which is why most teams start there and why most teams meet this incident sooner or later.
The harder conversations arrive with the largest customers. A security review asks for per-tenant encryption keys. A procurement team requires data residency in a named region. A customer worth a large share of annual recurring revenue asks for a latency commitment that the shared stack cannot back.
Each request is reasonable, and a defined isolation tier can meet each one if the platform was built to offer it. Five tiers, a scorecard that places each tenant in one, and a price list that funds the higher tiers turn these requests into routine work.
Why one isolation model stops working as customers grow
A single isolation model works while every tenant resembles every other tenant. Early customers have similar data volumes, similar usage patterns and similar security questionnaires. The first enterprise customer breaks that similarity, and the second makes the break permanent.
Three pressures arrive in sequence
The first pressure is performance. A runaway query slows every tenant, a bulk export holds the shared connection pool, and a reindex on a large tenant’s tables raises I/O wait for everyone on the instance. These events are routine in pooled systems, and every customer feels them at once.
Security review is the second pressure. Enterprise buyers ask whether one tenant’s data can be reached through another tenant’s session, and they expect an answer that holds even when a developer forgets a filter. A reviewer will sign in as one tenant and try to read another tenant’s rows through every interface the product exposes.
The third pressure is residency and contract terms. Regulated buyers require that data stays in a given jurisdiction, that keys are held per customer, or that infrastructure is not shared with named categories of tenant. These requirements are binary, so no amount of tuning inside a shared schema satisfies them.
Why a tier costs less than a retrofit
Teams without a tier model answer each pressure with a custom project. The first enterprise migration gets designed around one customer’s contract, with its own scripts, its own routing exception and its own runbook. The second customer arrives with different terms, and most of that work is repeated.
A defined tier turns the project into a routine operation. The tenant is scored, moved, priced and monitored through a path that already exists. The cost of building the path is paid once, and every later move reuses it.
Five isolation tiers and what each one provides
Isolation is a spectrum, and the useful question for any tenant is which boundary sits between its data and its neighbors. The AWS whitepaper on SaaS tenant isolation strategies describes the ends of that spectrum as the pool model and the silo model, with a bridge model that mixes them by layer. The five tiers below divide the spectrum into steps a product team can sell and an engineering team can operate.
Click to expand Tier 0, shared schema with a tenant identifier
Every tenant’s rows live in the same tables, distinguished by a tenant_id column. This tier has the lowest infrastructure cost and the simplest operations, with one schema, one migration path and one set of dashboards. Its boundary is logical. One missing filter exposes every tenant’s rows, and one heavy query affects every tenant’s latency.
Tier 1, schema per tenant
Each tenant receives its own schema inside a shared database instance, and the application sets the search_path for each request. A query that omits a tenant filter now stays inside one schema, and per-tenant backup and restore become practical with pg_dump on a single schema. Compute and connections remain shared, so the noisy neighbor problem persists.
The costs show up at the catalog. Every migration runs once per schema, so a 2,000-tenant platform runs each migration 2,000 times. Catalog size grows with tenants multiplied by tables, which slows tools that read the catalog. A pooled connection that keeps a stale search_path from its previous request becomes a new way to leak data.
Tier 2, database per tenant
Each tenant receives a separate database, either on a shared instance or on its own instance. Encryption keys, backup schedules, parameter tuning and restore points can all be set per tenant. Application servers stay shared, which keeps compute cost down while the data boundary becomes much stronger.
The ceiling here is connections. PgBouncer keeps a pool for each database and user pair, so 500 tenant databases means 500 pools competing for the instance’s connection limit. Plan the pool sizes before the tenant count, and move large tenants to their own instance once their pool needs exceed what the shared instance can give.
Tier 3, cell per tenant group
A cell is a complete copy of the stack, with its own application servers, database and queues, serving a defined group of tenants. The AWS guidance on cell-based architecture puts a thin routing layer in front of the cells, so a failure or a bad deploy stays inside one cell. A cell placed in a region satisfies residency for every tenant assigned to it.
A typical cell layout runs one or more general pooled cells, one cell per regulated region and a small number of cells for tenants with stricter terms. Deployments roll out cell by cell, starting with an internal or low-risk cell. Each cell is a full production environment, with everything that implies for on-call and observability.
Tier 4, dedicated deployment
A single tenant receives its own cell, in its own cloud account. This tier supports contractual segregation, customer-managed keys and negotiated maintenance windows. It is the most expensive tier to operate, so it belongs where contract value covers the cost.
| Tier | Boundary | Blast radius of a failure | Planning cost index per tenant |
|---|---|---|---|
| 0 Shared schema | Row filter | All tenants | 1x |
| 1 Schema per tenant | Schema | Shared compute, per-tenant data | 1.2x to 1.5x |
| 2 Database per tenant | Database | Shared compute, isolated data | 2x to 4x |
| 3 Cell per tenant group | Full stack | Tenants in the cell | 3x to 8x |
| 4 Dedicated deployment | Account or cluster | One tenant | 10x or more |
Treat the cost index as a planning range to replace with your own numbers. Workload shape, cloud provider and tenant size move every figure in it. The direction holds across platforms, since each step up the table trades infrastructure cost and operational effort for a smaller blast radius.
A scorecard for placing a tenant in a tier
A tier assignment should be repeatable, so that two engineers scoring the same tenant reach the same answer. The scorecard uses four tenant gates, each scored 0, 1 or 2, a set of override rules for binding contract terms, and a fleet ceiling that caps what the platform can operate.
Click to expand Gate 1, blast radius tolerance
This gate asks what happens to the customer, and to the vendor, if this tenant’s workload degrades its neighbors or the reverse. A tenant that runs large scheduled jobs, or whose users would notice a 500 millisecond latency increase, scores 2. A tenant with light and predictable usage scores 0.
Gate 2, data protection and residency
This gate scores the contractual and regulatory position. A tenant with no special terms scores 0. A tenant that asks for vendor-managed per-tenant keys or tenant-level restore scores 1, and a tenant that asks for customer-managed keys, a named jurisdiction or infrastructure segregation scores 2.
Gate 3, performance commitment
This gate scores whether the vendor has promised a latency or throughput figure. No commitment scores 0, and a documented target without penalties scores 1. A contractual service level with credits scores 2.
Gate 4, revenue at stake
This gate scores annual contract value against the cost of the tier. As example thresholds, under 50,000 dollars a year scores 0, between 50,000 and 250,000 dollars scores 1, and above 250,000 dollars scores 2. Set your own thresholds from your cost index, so that a score of 2 means the contract can carry Tier 3 costs.
Applying the score and the overrides
Add the four gates and read the recommended tier from the first table. Then apply the override table, which sets a floor for binding contract terms. The override always wins, so a tenant with a residency clause and a total of 2 still lands in Tier 3.
| Total score from the four gates | Recommended tier |
|---|---|
| 0 to 1 | Tier 0 |
| 2 | Tier 1 |
| 3 to 4 | Tier 2 |
| 5 to 6 | Tier 3 |
| 7 to 8 | Tier 4 |
| Override rule | Minimum tier, whatever the total |
|---|---|
| Customer-managed encryption keys | Tier 2 |
| Binding data residency clause | Tier 3, in a cell located in the named jurisdiction |
| Binding infrastructure segregation clause | Tier 4 |
The fleet ceiling
The last check applies to the platform as a whole. A recent AWS post on isolation models for ElastiCache puts it plainly, noting that a hundred tenants on dedicated clusters is viable and ten thousand is not. Tenant count limits which tiers the team can run, whatever each tenant’s score says.
Set a ceiling for each tier above Tier 0, for example 20 dedicated deployments, and refuse placement above it until automation raises the limit. Each added cell brings its own deploys, migrations, dashboards and on-call load. A platform running 15 cells without automation runs its release process 15 times.
Controls that keep every tier safe
Most tenants will stay in Tier 0 or Tier 1 for years. The controls in this section decide whether that majority is safe, and whether the higher tiers can be sold with confidence.
Noisy neighbor controls
Per-tenant limits turn a shared resource into a bounded one. A rate limit at the API gateway caps requests per tenant per second, and a separate workload queue for exports and imports keeps batch work away from interactive traffic. At the database, a role-level setting such as ALTER ROLE app_interactive SET statement_timeout = '30s' caps the cost of any single interactive query.
Connection caps need more care, because PgBouncer pools by database and user, and it has no notion of a tenant. Enforce the per-tenant cap in the application, with a semaphore or token bucket keyed on tenant_id in front of the pool. Start with a cap of a quarter of the pool for any single tenant, and treat tenants that keep hitting it as candidates for Tier 2.
Row-level security and the cost of a missing filter
In a Tier 0 system, a single query without a tenant predicate returns rows from every tenant, so one line of code can expose the whole data set. Row-level security in PostgreSQL moves the filter into the database. A policy such as USING (tenant_id = current_setting('app.tenant_id', true)::uuid) applies to every query on the table, and a table with RLS enabled and no matching policy returns nothing.
The guarantee depends on details the team must control. Table owners bypass policies unless the table also has FORCE ROW LEVEL SECURITY, and superusers and roles with BYPASSRLS always bypass them, so the application must connect as a separate, unprivileged role. With PgBouncer in transaction mode, set the tenant with SET LOCAL inside each transaction, so the value cannot carry over to the next client on that server connection.
Write one test that opens a session with no tenant set and confirms that every protected table returns zero rows. Make it a release gate. A policy that fails open gives the team a confidence the system has not earned.
Cross-tenant tests on every interface
A suite that confirms tenant A can read tenant A’s data proves little. The useful tests confirm that tenant A cannot read tenant B’s data through each interface, including the API, exports, search, background jobs and analytics. Run them in continuous integration, and rerun them after every change to the data model.
Search indexes and caches deserve their own cases, and the same tenant isolation concerns apply to vector stores. A cache key built without the tenant identifier, or a search index shared across tenants without a filter, leaks data even when the database is perfectly isolated.
Per-tenant encryption keys and residency
Envelope encryption gives each tenant its own data key, wrapped by a key in a managed key service. Revoking or destroying a tenant’s key renders that tenant’s encrypted data unreadable, which also gives offboarding a clean, provable end. Vendor-managed per-tenant keys work at any tier, and customer-managed keys become practical from Tier 2, where each tenant’s database and backups can be tied to the customer’s own key.
Residency is a placement decision. A tenant with a jurisdictional requirement belongs in a cell that runs in that jurisdiction, with backups, logs and analytics replicas held in the same region. Logs and analytics copies are the stores teams miss most, so the residency review should list every store that receives tenant data.
Per-tenant cost attribution
A tier model requires knowing what each tenant costs. Tag compute, storage and data transfer by tenant wherever the platform allows, and allocate shared costs by a usage measure such as requests, rows or compute seconds. Aim for an attributed total that reconciles to within 10 percent of the cloud invoice.
Attribution also exposes the tenants that are unprofitable in Tier 0. Their workloads justify a move to a higher tier at a higher price, or a usage-based charge.
Pricing tiers that map to isolation levels
Isolation has a cost, and the customer who requires it can be asked to fund it. Buyers accept a clear price list more readily than a negotiated exception, because the list shows that every buyer of that plan gets the same terms.
| Plan | Isolation tier | Included commitments | Example price multiple |
|---|---|---|---|
| Standard | Tier 0 or Tier 1 | Rate limits, standard backups | 1x |
| Business | Tier 2 | Per-tenant keys, tenant-level restore, performance target | 1.5x to 2x |
| Enterprise | Tier 3 | Regional placement, staged releases, service level with credits | 2.5x to 4x |
| Dedicated | Tier 4 | Own account, customer-managed keys, negotiated maintenance windows | 5x or more |
Derive your own multiples from the cost index plus the support load each tier adds. Two rules keep the list coherent. Every commitment in a plan must be backed by a control the platform enforces, and every plan above Standard should carry a minimum term long enough to repay its setup cost.
Exceptions need engineering sign-off. A company that offers Tier 3 isolation at Standard prices pays for every such tenant out of margin. Each contract with an isolation commitment should reference its plan in the price list.
A 30-day plan for introducing tiers
The plan assumes an existing Tier 0 platform on Postgres, with at least one customer already asking for stronger isolation. It builds the controls first, the movement path second and the commercial structure last.
Click to expand Days 1 to 7, inventory and decision
Score every tenant above a revenue threshold using the four gates. List every data store that holds tenant data, including caches, search indexes, object storage, logs and analytics copies. Write the tier definitions as a short document and record the decision, with a review triggered whenever a tenant crosses a scorecard threshold.
Days 8 to 14, controls
Apply per-tenant rate limits, the connection cap and statement timeouts. Enable and force row-level security on the tables that hold customer data, move the application to an unprivileged role, and add the test that confirms a session without tenant context returns no rows. Begin tagging cost by tenant and compare the first week of attribution to the invoice.
Days 15 to 21, tenant movement path
Build the tenant directory, a small service or table that maps each tenant to its tier, cell and connection target. Every request resolves the tenant through it, from an in-process cache refreshed on change. With the directory in place, a move is a data copy plus a configuration change, and no deployment is needed.
A tenant move without downtime follows a fixed sequence of five steps.
- Replicate the tenant’s rows to the target with a row-filtered logical replication publication, one filter on tenant_id per table.
- Validate row counts and checksums per table on the target.
- Apply a brief write freeze for that tenant, with a target under 30 seconds, and copy sequence values across.
- Update the directory so new requests route to the target.
- Keep the source copy read-only for 14 days, then remove it.
Rehearse the sequence on a staging copy of one real tenant before the pilot, and time each step.
Days 22 to 30, pilot and pricing
Move one tenant that scored 3 or 4 to Tier 2. Measure latency for that tenant and for the remaining pooled tenants before and after the move, and record the engineer hours spent. Publish the price list to the sales team with the scorecard attached, so that tier assignments follow the same rules in every negotiation.
Failure modes to plan around
The tier model fails in predictable places. Each of the cases below comes from the mechanisms described above, and each has a check that catches it before a customer does.
The replication filter rejects updates
Postgres requires that a row filter on a publication that carries UPDATE or DELETE uses only columns covered by the table’s replica identity. If tenant_id is not part of the primary key, the publication cannot carry the tenant’s updates. Fix this before the first move, either by adding tenant_id to a composite primary key or by setting a replica identity that covers it.
Sequences and schema changes do not follow the data
Logical replication copies rows. It does not copy sequence values or DDL, as the replication restrictions list. A target with stale sequences produces duplicate key errors on the first insert after cutover, so step 3 sets every sequence past the source value. Freeze schema migrations for the duration of a move.
Row-level security that the application bypasses
The most common gap is an application that connects as the table owner, which skips every policy unless the table forces it. The zero-rows test catches this, which is why it belongs in the release gate. Background workers and admin tools need the same check, since they connect under their own roles.
Residency that stops at the primary database
A cell in the right region satisfies the database requirement. Logs shipped to a central account, a support tool that copies ticket attachments and an analytics pipeline that exports to a single warehouse can each move tenant data out of the jurisdiction. The store inventory from the first week is the control here.
Cell sprawl without automation
Every cell multiplies deploys, migrations, alerts and on-call pages. A team that adds cells faster than it automates them ends up with cells running different versions of the schema. Hold the fleet ceiling until the backend infrastructure for deploys and migrations treats every cell as one target.
Exceptions that skip the price list
A sales team under quarter-end pressure will offer dedicated infrastructure at Business pricing. Each exception adds a tenant the platform runs at a loss and a precedent for the next negotiation. Engineering sign-off on any isolation term outside the price list keeps the model intact.
What to do next
Start with the inventory, because it requires no new infrastructure and produces the information every later decision depends on. Within the next week, list the ten tenants with the highest revenue or the highest resource consumption and score each one against the four gates. The spread shows whether the platform needs one additional tier or three.
Then check three controls. Confirm that a database session with no tenant context returns zero rows on every protected table. Confirm that no single tenant can hold more than a quarter of the connection pool. Confirm that the team can state the monthly infrastructure cost of its top five tenants.
A failure on any of the three marks the first piece of work. Fix it before the next enterprise security review, because that review will look for the same gaps.
Algorithmic is a senior engineering consultancy that builds production software, data platforms and the infrastructure under them, with a founder on every engagement and ownership from architecture through deployment. We help SaaS teams design isolation tiers, build the tenant directory and movement path, and move their first tenants without downtime. Score your top ten tenants, then start a conversation and bring the results.