DEV Community

Cover image for Multi-tenancy: pool vs silo, tenant context, and noisy neighbor limits
System Design Simple
System Design Simple

Posted on Originally published at systemdesignsimple.com

Multi-tenancy: pool vs silo, tenant context, and noisy neighbor limits

One app serves many restaurants by giving every request a verified tenant ID, then backing that ID with scoped credentials and per-tenant limits. The tenant ID is the boundary; everything else enforces it.

Silo, pool, or bridge

A silo gives each tenant dedicated resources. A pool shares resources and separates tenants by tenant context in code plus tenant-scoped access. A bridge mixes the two per layer: shared services with a database per tenant, for example. You choose per layer, not once for the whole system.

How tenant context follows a request

Follow one request from brand A that tries to read brand B's orders table.

  1. The gateway authorizer verifies the token and resolves tenant brand-a. The integration mapping overwrites any X-Tenant-Id the client sent, and the backend accepts traffic only from the gateway, so the header cannot be forged.
  2. The service stores brand-a in request-scoped storage: AsyncLocalStorage in Node, AsyncLocal<T> in .NET. The value follows the request across await without being passed through every function.
  3. Code builds resource names only through a helper that reads that context, so it produces brand-a_orders. With no tenant in context, the helper throws.
  4. Suppose a developer bypasses the helper and hardcodes brand-b_orders. The data call runs with credentials assumed for brand-a, carrying tenant=brand-a as an STS session tag. A role policy that allows only table ARNs matching that tenant denies the read. The tag alone restricts nothing; the policy must reference it. In pooled PostgreSQL, row level security plays the same role.

What the OrderServ write-up reports

OrderServ is a Cognizant food-ordering platform. According to their write-up on the AWS Architecture Blog (5 November 2026), each of 5 brands had its own ECS cluster. After consolidating into one shared cluster: 105 services became 21, 315 sidecar containers became 63, and scale-out time fell from 5 to 7 minutes to 30 to 60 seconds with EC2 warm pools.

Our lab run

We ran a small Node 22 lab with two overlapping requests, one per tenant. It produced 12 resource names across the two requests, with zero cross-tenant names. Calling the name helper outside any request threw no tenant in context.

One tenant surges: the worked example

Assume 800 req/s of capacity and 500 req/s of normal demand. One tenant surges to 1,000 req/s for 10 seconds. The backlog grows at 600 req/s, so about 6,000 requests queue up. A quiet tenant's request then waits 7.5 seconds, and the queue takes 20 seconds to drain after the surge ends.

With a per-tenant limiter of 200 req/s instead, the system admits 600 req/s and the surging tenant gets 429 responses for the excess. API Gateway documents its throttles as best-effort targets, so keep bounded queues and concurrency limits on the shared workers too.

Our take: for tenants with similar workload needs, pooled compute with tenant-scoped access is the default we would consider. Test isolation and overload handling before onboarding more tenants.

Read the full article, with failure modes, trade-offs, and practice questions, on System Design Simple: https://systemdesignsimple.com/one-app-many-restaurants-multi-tenancy/

Top comments (0)