The system
Endpoints
| Endpoint | req/s | p50 | p99 | errors |
|---|
10‑minute run
What to notice
Query plan
Schema for this database
Data size vs memory
Each database's tables and indexes against the memory it can cache, and each Redis cache's need against what it has
Latency as load grows
Worst endpoint p99 with no failures, scaling every endpoint and table together
Monthly cost
Approximate on-demand list prices, us-east-1, at average load. Check AWS pricing before quoting.
| Component | Sized as | $/month |
|---|
Pricing pages: RDS · ElastiCache · SQS · Kinesis · Fargate · ALB · CloudFront
How the model works
Row and index sizes follow Postgres's on-disk layout: 8 KB pages, a 24‑byte tuple header, 4‑byte line pointers, column alignment, B‑tree leaves 90% full and deduplication for repeated values. For each read the planner compares a sequential scan, an index scan and (for count) an index-only scan with Postgres's default costs and picks the cheapest. Updates are HOT (no index writes) most of the time when the table's fillfactor leaves free space. Existing table traffic is modelled as primary-key reads and inserts.
A page read from memory costs about 2 µs; from disk it costs the storage latency (gp3 about 1 ms, io2 0.4 ms, local NVMe 0.1 ms). Each database caches in 75% of its RAM, shared by all its tables, with 90% of reads going to the hot share of rows. A statement costs about 60 µs of CPU, a scanned row 40 ns, and the network round trip 0.3 ms. Publishing to SQS takes about 8 ms (p99 25 ms) and to Kinesis about 10 ms.
Under load every component is a set of servers: service vCPUs, database vCPUs, IOPS and pool connections, Redis about 120k operations per second per shard. Waiting uses the M/M/c approximation, p99 assumes exponential tails, steps in an endpoint add up, and demand beyond capacity becomes errors. A failed Postgres primary is replaced by its Multi‑AZ standby after the failover time, with a cold buffer cache; losing an availability zone takes a third of every service's tasks and fails over every database primary and Redis shard at once. These are teaching estimates for comparing designs and finding bottlenecks; load‑test before promising anything.