A fault-tolerant AWS design for 200+ client companies and about 2 lakh users. Every client gets its own client.one.xyz domain and its own SSO, every database sits in private subnets, and a Superadmin service switches features on or off per client without forking code. There are three user interfaces: the client login (which opens the HCM app), Client Settings for each company's HR, and the Superadmin login, which clients can never use. Press a flow below to watch a request move through the system.
Estimated monthly run cost at November 2026 list prices, in USD with rupees at ₹93.5 per dollar (the rupee traded around ₹92.6–94.9 in November). Money flows left to right: from where it is spent, to what it buys, to the monthly total. Switch between list price and the same design after the FinOps measures.
Ribbon width is proportional to dollars. Hover a ribbon for its amount. The moving dots show where the money goes.
VPC interface endpoints cost about $330 a month more than the NAT charges they remove at this traffic. They stay because they keep AWS API traffic private; trim them to the ones each cell really uses (S3 gateway is free; ECR, STS, Secrets Manager, SQS first).
| Where | Category | Item | Sizing and assumption | List $/mo | After FinOps $/mo | Price basis |
|---|
The "After FinOps" total above already counts the measures built into the design. Cost optimization is the loop that keeps that number from drifting up and finds the next savings. It runs once a month in each cell and once a quarter for commitments.
Estimates from the same November 2026 list prices. Savings are per month, rounded, and not measured; confirm each against a month of real usage before acting.
| Option | What changes | Possible saving $/mo | Effort and risk |
|---|---|---|---|
| Prisma Cloud: negotiate or replace | Today a $3,000 placeholder. Negotiate credits down to what is actually scanned, or cover most of it with Inspector, Security Hub CSPM and open-source scanners (Trivy, Checkov) in Jenkins and GitLab. | ~1,000 (range 500–1,500) | Medium Security team must accept the coverage; depends on the real quote |
| Email through Amazon SES instead of SendGrid | SES is about $0.10 per 1,000 emails, so 1.5M is near $150 plus a dedicated IP. Keep the digest batching. | ~550 | Medium IP warm-up and deliverability testing for 200+ client sender domains |
| Hyderabad Atlas on a smaller tier | Run the DR secondary on M40 and let Atlas auto-scale to M50 on failover. The standby keeps replicating, so the RPO does not change. | ~400 | Low Tier change takes minutes while failing over; rehearse in the DR drill |
| Right-size pods, then nodes | VPA in recommendation mode, lower requests, Karpenter consolidation, newest Graviton generation. Typically 15–25% of base node spend is idle requests. | ~400 | Low Needs two weeks of Prometheus data first |
| Savings Plans and RDS reservations at 3 years | Move the stable part of the baseline from 1-year to 3-year terms once usage has held steady for two quarters. | ~500 | Medium Locks in capacity; commit only to the floor of usage |
| Redshift Serverless reservation | Reserve the base RPUs in Mumbai after three months of usage data. | ~250 | Low Only the always-on base is reserved |
| Replace Client VPN with SSM Session Manager | Engineer access to private resources through SSM port forwarding with SSO and session logs; remove the always-on VPN endpoint. | ~250 | Low Change of daily workflow for the team |
| Transit Gateway to VPC peering where few VPCs connect | With about six attachments, peering between the shared tools VPC and each cell is cheaper; keep Transit Gateway if attachments grow. | ~200 | Medium Peering is not transitive; routes need care |
| Compress replication traffic | zstd compression on Kafka MirrorMaker 2 and Atlas, S3 replication only for the buckets that need it. | ~100 | Low Small CPU cost on brokers |
| Support plan per account | Keep Business Support on production accounts and use Developer on non-prod accounts, where the plan allows. | ~300 | Low Check the plan rules for the payer account |
| Per-client AI and feature limits | Superadmin sets a monthly AI token budget per client and turns off heavy features (copilot, analytics exports) on plans that do not include them. Cost follows the plan price. | protects the $482 AI line | Low Already supported by the Superadmin feature flags |
| Bigger commercial levers | Annual spend is about $345k, below the level where AWS usually offers a private pricing agreement. Revisit at about $1M a year, or buy Atlas and Prisma through AWS Marketplace so they count toward any future commitment. | not estimated | Later Depends on growth |
The first ten rows add up to about $3,950 a month, roughly 14% below the $28.8k, which would bring the total near $24.8k. Treat that as a ceiling for planning: the Prisma Cloud and SendGrid lines are still placeholders, and every row needs checking against measured usage. Do the Low-risk rows first; the savings are real and the cost of being wrong is small.
Three UIs: the client login, which opens the HCM app; Client Settings, where each company's HR configures its own rules; and Superadmin for the platform team only. Every client runs the same React builds, container images and Helm chart. What differs per client is data, never code.
| UI | Who | Where | Sign-in | Can change |
|---|---|---|---|---|
| 1. HCM app | Employees, managers, HR | acme.one.xyz | Client's own IdP via Keycloak | Their own HR work: punches, leave, payslips, reviews |
| 2. Client Settings | Client HR admins (role client_admin) | acme.one.xyz/settings | Client's IdP + step-up MFA | Rules inside enabled modules: leave policies, shifts, grace time, geo-fences, holidays, payroll components, approval chains, roles, branding, devices, notification templates |
| 3. Superadmin | Your platform team only | admin.one.xyz, internal ALB over VPN | Internal staff realm + MFA | Which modules a client has, plan and limits, home region, SSO setup, AI budget, suspend/offboard |
acme.one.xyz*.one.xyz ACM certificate. A new client needs no new DNS record and no new certificate.acme → ap-south-1 in CloudFront KeyValueStore and sends the request to that cell's ALB. Origin changes from CloudFront Functions launched in Nov 2024 at no extra charge.client_admin in its own directory.tenant_id, roles and employee ID; api-gateway verifies it with cached JWKS on every call./settings on the client's own domain. Only users with client_admin see it, and api-gateway re-checks the role on every call.admin.one.xyz, on an internal ALB reachable only through Client VPN. It stores metadata only, no employee data.client_admin invited.tenant.config.changed; MirrorMaker 2 carries it to the other cells.Read first: both AWS Middle East regions were damaged in 2026. AWS says Bahrain (me-south-1) is unavailable and it can't restore data held only there; the UAE region (me-central-1) is still impaired and lost data held only in one zone. So Bahrain can't hold UAE backups. This design keeps UAE copies in Azure UAE North (Dubai) and adds AWS's Saudi Arabia region once it opens (announced for December 2026).
| Cell | Serves | Users (est.) | Clients (est.) | In-region HA | Region loss plan | RPO | RTO |
|---|---|---|---|---|---|---|---|
| ap-south-1 Mumbai | India tenants; Superadmin; shared services | 1,20,000 | ~120 | 3 AZs, Multi-AZ RDS, Atlas 2 nodes + Pune tie-breaker, Kafka 3 brokers | Warm standby in ap-south-2 (data stays in India) | ≤ 1 min | ≤ 30 min |
| ap-southeast-1 Singapore | Remaining 30% (assumed) | 60,000 | ~60 | Same as Mumbai, smaller | Pilot light in ap-south-2: hourly backup copies, Atlas snapshot copies, S3 CRR | ≤ 1 h | ≤ 4 h |
| me-central-1 UAE | UAE tenants | 20,000 | ~20 | Only the zones AWS reports healthy | Now: Atlas majority + hourly backups in Azure UAE North. Next: pilot light in AWS Saudi Arabia once open | Mongo 0; others ≤ 1 h | Now 1–2 days; with Saudi ≤ 4 h |
| ap-south-2 Hyderabad | DR for India and Singapore | 0 | 0 | Minimum-size EKS, replicas | Scales up on failover with Karpenter | n/a | n/a |
Users and clients per cell follow the 60/10/30 split; client counts assume similar-sized clients. AZ failures in every cell fail over automatically.
punch-in.one.xyz record.| Store | Who connects | Holds | In-region HA | Cross-region (India) | Backup |
|---|---|---|---|---|---|
| RDS MySQL | api-gateway only | Transactional records (users, org structure, payroll ledgers) | Multi-AZ writer + reader | Cross-region read replica, promote on failover | PITR 14 days + AWS Backup to a separate-account vault |
| MongoDB Atlas (dedicated, AWS PrivateLink) | api-gateway + the 6 domain services | Per-tenant databases: attendance, leave, profiles, talent documents, versioned client settings | 3 electable nodes across 3 AZs | India: 2 Mumbai + 2 Hyderabad + 1 Azure Pune tie-breaker, automatic failover, all in India. UAE: multi-cloud with Azure UAE North/Central | Atlas Cloud Backup with point-in-time restore; snapshot copies kept in the same country or, for UAE, the Middle East |
| RDS Postgres | Keycloak, Superadmin, AI agent | Platform data: identity, tenant registry, pgvector embeddings of client policies | Multi-AZ | Cross-region read replica | PITR + AWS Backup |
| ElastiCache for Valkey | api-gateway, services, AI agent | Sessions, entitlements, rate limits, AI semantic cache | Primary + replica in 2 AZs | Global Datastore secondary | Not needed (rebuildable) |
| Kafka (Strimzi on EKS) | Services, n8n, AI agent | Domain events, punch stream, tenant config changes | 3 brokers in 3 AZs, RF 3, min ISR 2 | MirrorMaker 2 | Kafka Connect S3 sink |
| Redshift Serverless | Workforce Analytics, dashboards | Per-tenant analytics loaded from the S3 data lake | Managed | Rebuild from S3 CRR | Snapshots |
| S3 | Services via presigned URLs | Payslips, resumes, documents, data lake | 11 nines, versioned | Cross-Region Replication, multi-region KMS key | Object Lock on audit buckets |
MySQL only from api-gateway and MongoDB from the six services, as the brief specified. The three platform services (Keycloak, Superadmin, AI agent) use Postgres rather than adding new connections to MySQL. Security groups enforce this: the MySQL security group accepts 3306 only from the api-gateway pod security group.
tenant_id from the JWT, never from the request body; a MongoDB database per tenant.| Lever | Where | Effect |
|---|---|---|
| Graviton (arm64) everywhere | EKS nodes, RDS, ElastiCache, Lambda | Lower price per vCPU; one arm64 image build |
| Savings Plans + RDS reservations for the baseline; Karpenter spot for burst | EKS node pools: on-demand for api-gateway and Kafka, spot for stateless services and non-prod | Steady load on discounts, peaks (9 AM punches, month-end payroll) on spot |
| ElastiCache for Valkey instead of Redis OSS | All cells | Valkey is priced 20% lower; Redis OSS reservations carry over |
| Redshift Serverless with base and max RPU limits | Analytics | 4-RPU minimum offered in Hyderabad and UAE; pay only when queries run |
| Warm standby at minimum size | Hyderabad | Replicas and 2 small nodes until failover |
| Non-prod off nights and weekends | Dev, QA, staging | On 12 h × 5 days = 60 of 168 hours, about 64% fewer instance-hours |
| VPC endpoints instead of NAT for AWS traffic | All cells | S3 gateway endpoint is free; ECR pulls skip NAT data charges |
| Storage tiers | gp3 volumes, S3 Intelligent-Tiering, lifecycle for old payslips, 30/90-day Loki and Tempo retention on S3 | Storage cost falls as data ages |
| New Relic only for critical paths | Login, punch ingest, payroll run, api-gateway | APM where it matters; everything else on Grafana + Sentry, so New Relic ingest stays small |
| Atlas right-sizing | Auto-scaling between a minimum and maximum tier; non-prod clusters paused out of hours | Pay for peak tier only at peak |
| Unit cost per tenant | Tags: tenant, cell, service, env; CUR 2.0 → Athena → Grafana | Price plans on real cost per user; AWS Budgets per account |
Load assumptions: about 4 lakh punches a day (2 per user); India's 9:00 to 9:30 AM window averages about 50 punches a second, so the ingest path is built for 500 a second bursts, with SQS absorbing the rest. Peak API load assumed at about 3,000 requests a second across all cells, with month-end payroll as the batch peak.
| Component | Mumbai (60%) | Singapore (30%) | UAE (10%) | Hyderabad DR |
|---|---|---|---|---|
| EKS on-demand base | 4 × m7g.2xlarge | 3 × m7g.xlarge | 3 × m7g.large | 2 × m7g.xlarge |
| Karpenter spot ceiling | +6 nodes | +4 | +2 | On failover: to Mumbai size |
| RDS MySQL | db.r7g.2xlarge Multi-AZ + reader | db.r7g.xlarge Multi-AZ | db.r7g.large Multi-AZ | db.r7g.xlarge replica |
| MongoDB Atlas | M50: 2 Mumbai + 1 Azure Pune (+2 Hyderabad) | M40, 3 nodes | M30, 2 AWS + 2 Azure UAE North + 1 Azure UAE Central | The 2 India nodes |
| RDS Postgres | db.r7g.large Multi-AZ | db.t4g.large Multi-AZ | db.t4g.large Multi-AZ | db.t4g.large replica |
| Valkey | 2 shards, r7g.large + replicas | 1 shard + replica | 1 shard + replica | Global Datastore secondary |
| Kafka | 3 × m7g.xlarge, gp3 | 3 × m7g.large | 3 × m7g.large | 3 × m7g.large (MM2 target) |
| Redshift Serverless | 8 RPU base, 32 max | 4 base, 16 max | 4 base, 8 max | None until needed |
Instance types are starting points, not measured results. Use the newest Graviton generation each region offers, then let Compute Optimizer and a month of Grafana data decide.
Still open: real quotes for Prisma Cloud, rChilli and SendGrid to replace the placeholder cost lines.
Design for review; region and service status checked on 2 Dec 2026. References: CloudFront origin modification · Keycloak Organizations · Atlas multi-region · Atlas on Azure regions · Atlas regional-outage reconfiguration · AWS Middle East regions status (DCD) · AWS Saudi Arabia region · Bedrock model regions · ElastiCache pricing · OpenFeature · Kepler