BlogArchitecture

OrderServ merges five clusters into one: what to copy and what's behind the 64%

An AWS blog case study moves from one ECS cluster per brand to a shared one. The isolation rules I'd copy, and how to read the 64% savings figure.

Ink and watercolor illustration: a wooden cabinet with many drawers, each with its own keyhole, and behind it five small cabinets drawn in dashed lines that fade away.

OrderServ went from one container cluster per customer to a single shared one, and the way it keeps customers apart is a good checklist for any SaaS. The 64% savings headline, on the other hand, doesn’t come from merging clusters: it compares Fargate On-Demand with EC2 under a three-year spending commitment.

What the case study says

On November 5, the AWS Architecture Blog described how Cognizant rebuilt OrderServ, its food-ordering platform for restaurant chains. It’s written by three people from AWS and three from Cognizant, so read it for what it is: a success story written by the vendor and the customer.

The starting point was the easiest model to reason about. Each brand had its own ECS cluster (AWS’s container service) running 21 microservices. With five brands, that meant 105 services and 315 sidecar containers. Every new brand was another full cluster, cost grew in a straight line, and onboarding a customer took days.

Now a single cluster with 21 services serves every brand. Onboarding a brand is a configuration change that takes minutes. High-volume brands can still opt out to a dedicated cluster.

How they keep each customer isolated

This is the part worth copying, whether you run containers, Lambda or anything else. In a multi-tenant SaaS (several customers on the same infrastructure), the number one risk is one customer seeing another’s data. OrderServ handles it in layers:

  1. A tenant ID on every request. An API Gateway authorizer injects the X-Tenant-Id header. Business code doesn’t pick it; it receives it.
  2. One library builds every resource name. DynamoDB tables per tenant, key prefixes in the cache, a schema per tenant in Aurora and per-tenant paths in S3. No service writes a resource name by hand.
  3. Fail closed. If the tenant context is missing, the library refuses to build the resource name. In the article’s words, “a missing tenant context fails closed instead of reading another tenant’s data”. No tenant, no query: just an error.
  4. IAM as a safety net. The library requests temporary credentials with sts:AssumeRole, passing the tenant ID as a session tag, and the policies scope those credentials to that tenant’s tables, prefixes and schema. If the library has a bug, AWS still says no.
  5. The context travels with the message. The tenant ID goes along on service-to-service calls, in SQS and SNS message attributes, and in logs and traces.
  6. Per-tenant limits. A Lambda authorizer applies per-tenant rate limits in API Gateway, so one brand’s spike can’t take the others down.

Reading the 64% carefully

The headline says “up to 64%”. The article’s table compares the projected monthly cost of the same 21 services in the Mumbai region:

Option Monthly cost Versus Fargate
Fargate On-Demand (before) ~$1,568 baseline
EC2 with 1-year Savings Plan and warm pool ~$832 ~47% less
EC2 with 3-year Savings Plan and warm pool ~$568 ~64% less

Three things the headline leaves out:

  • It’s a projection, not an invoice. The article itself says “projected monthly cost”.
  • It compares pricing models, not architectures. All three rows are 21 services. The savings from going from 105 services to 21 aren’t in that table.
  • The 64% requires a three-year commitment. A Compute Savings Plan is a discount in exchange for committing to a minimum hourly spend for one or three years. With one year, the savings drop to 47%. It also isn’t clear whether the capacity reservations they mention for peaks are included in the cost.

The move from Fargate to EC2 had a technical reason too. On Fargate, a new task took 5 to 7 minutes to become healthy, mostly because of image downloads, and orders failed in the meantime. With EC2 and a warm pool (stopped instances with the images already cached, at about $3 a month each in disk), scaling dropped to 30-60 seconds.

My take

I’d copy the isolation rules today, not the savings headline. Failing closed, and having one library build every resource name, are two cheap decisions that prevent the worst incident a SaaS can have: one customer reading another’s data. The IAM session tag is the layer I value most: if the code fails, the AWS account still keeps tenants apart.

I wouldn’t use the 64% to decide anything. If you’re early, a three-year commitment on a volume you don’t know yet is exactly the kind of risk I try to avoid. The one-year 47% is the number I’d plan with, and even then as a projection.

What I’m taking from the article is its underlying idea: the isolation model becomes “a deployment decision rather than an architectural constraint”. Where each customer lives is decided when you deploy, not when you design. Starting fully shared and moving a large customer to its own cluster when they ask for it is simpler than starting with a cluster per customer and having to merge them later.

Sources

If you want to see how I build multi-tenant SaaS on AWS without a team, follow me on LinkedIn.

← All articles

Have a product to build or a tech stack to put in order?

Tell me what you are trying to achieve and where you are today. I reply personally, usually within a day.

Free · 30 minutes

Digital strategy session

30 minutes to map where to start digitalizing and transforming your business. You pay nothing, before or after.

When you book, you answer three short questions: what you need, what stage your project is at and when. That way the session starts with context.