On this page
The simulation behind Results, the HLD and practice verdicts
How the simulation works, and how far to trust it.
Last updated
Every number on the editor's Results tab and every practice verdict comes from one small
analytical model: a few formulas over your diagram, its traffic and default numbers per tech
stack. It has no randomness and measures nothing. The same text always gives the same numbers.
It tells a sound design from a broken one and shows which node gives out first. It is not a load test or a capacity plan. This page lists each rule with its default numbers, then what the model leaves out and which way that moves the numbers.
01
What is modelled
A test checks every number on this page against the simulation, which is open source: read it on GitHub.
-
1.1 Load comes from traffic
A use case with rate R splits its traffic over its scenarios by
mix. Withoutmixit all goes to the first scenario, and shares that don't add up to 100% are scaled. Every request step that gets through (->and->>) adds its rate to its target. Responses add nothing, and neither does a failed call (-x).Steps after the response count too, so a queue's consumer carries load the user never waits for. A use case without a traffic line adds no load.
A cache with a hit rate (
capacity { cache hit 90% }) passes on only its misses: after a read of it, the caller's reads from a store behind it, the calls the cache makes itself and the caller's fill of the cache take1 − hitof the rate, unless the use case already splits hits and misses with amix. Latency follows too: see the percentiles below.A node with an error rate and retries (
capacity { pay errors 2% retries 3 }) gets each call again when it fails:1 + e + … + e^retriescalls a request. Only the node itself takes them; what it calls is not repeated.With
peak("Read" 20k rps peak x3), R is the peak, 60k: load, utilisation, latency and requirements are all taken at the busiest hour. Only egress is costed at the average, 20k (rule 1.8).load(n) = Σ R(U) × share(s) × N(step) over every request step to n that is not -x in every scenario s of every use case N(step) = the x<N> fan-out, 1 without one, times 1 − hit on a cache's miss path, times Σ e^k for k = 0..retries to a node with errors -
1.2 Reads and writes
A request step is a write when its method is POST, PUT, PATCH or DELETE, or, without a method, when its label starts with a write verb: INSERT, UPDATE, UPSERT, DELETE, SET, PUBLISH, SEND, ENQUEUE, CHARGE, CREATE, SAVE, STORE, UPLOAD, RESERVE, HOLD and 26 more (full list). Everything else is a read. A request to a queue is always a write.
Reads and writes count against separate capacities. Only writes count for
durableandwrites X before responding.- Write
api -> db : INSERT order- Write
user -> api : POST /orders- Write
api ->> jobs : OrderPlacedqueue- Read
api -> cache : GET feed:{user}- Read
api -> db : SELECT posts
-
1.3 Replicas, shards and single-primary writes
x<n>gives a node n replicas, andcapacity { db shards 4 }splits a store into partitions, each with its own replicas. Every instance gets an equal slice of the load.Relational databases are single-primary: replicas serve reads, but every write goes to the one primary of its shard. So replicas add read capacity and only shards add write capacity. Everything else serves reads and writes on every replica.
A single-primary store's utilisation is its busier side. Everything else adds both shares, since they share machines. Bandwidth (1.6) can set it too. At 100% a node is saturated, and every latency requirement of a use case that loads it fails. Above 70% it shows as hot.
read capacity = reads × replicas × shards write capacity = writes × shards single-primary = writes × replicas × shards everything else ρ_read = read load ÷ read capacity ρ_write = write load ÷ write capacity ρ_req = max(ρ_read, ρ_write) single-primary = ρ_read + ρ_write everything else ρ = max(ρ_req, ρ_bandwidth) -
1.4 Utilisation turns into queueing
Each node has a base latency per call when idle. Under load, a request may wait for a free server. The model treats each replica of a shard as one server and uses the M/M/c queue: with c servers at utilisation ρ, a request waits with the Erlang C probability C. Writes on a single-primary store queue for its one primary.
A queue or broker with consumers (
capacity { events drain 5k rps }) queues messages the same way, with the consumers as one server that drains at that rate: below it, a message waitsρ ÷ (drain − inflow), the consumer lag; above it, the backlog grows by the difference every second.One server gives the classic
1 ÷ (1 − ρ)slowdown. A pool waits much less: at 50%, one server waits half the time, four servers 17%. ρ is capped at 95% here, so a saturated node is at most 20× its base and fails through saturation instead.C = Erlang C(c, ρ) ρ capped at 0.95 hop(n) = base + C × base ÷ (c (1 − ρ)) = base ÷ (1 − ρ) for c = 1 lag(q) = ρ ÷ (drain − inflow) ρ = inflow ÷ drain < 1 backlog(q) = (inflow − drain) × 3600 messages an hour, inflow ≥ drainSlowdown over the idle latency by utilisation ρ 10% 50% 70% 90% ≥ 95% 1 server 1.1× 2× 3.3× 10× 20× 4 servers 1× 1.09× 1.36× 2.97× 5.46× -
1.5 Latency and percentiles
A scenario's mean latency is the sum of the hops on the synchronous critical path: the requests sent before the entry request is answered. A
pargroup counts its slowest member, an async send (->>) only its own hop, and a failed call (-x) a timeout of 1000 ms, or whatcapacity { db timeout 200ms }sets.Percentiles are computed, not measured. Each hop is a fixed part (half its service time) plus an exponential tail that carries the rest, queueing included. An idle hop's p99 is 2.8× its mean, at 50% load 3.7×, at 90% 4.4×. Timeouts and transfer time add once to every percentile.
A use case's percentile mixes its scenarios by their shares. With 10% cache misses, p99 is close to the miss path's p90, and it moves smoothly as a share grows.
A cache's
hitrate is mixed the same way: each scenario becomes a hit variant, without the miss path, and a miss variant, weighted by the hit rate. The percentiles are those of an explicitalt "Hit"andalt "Miss"with amixof the same shares.Retries split the path the same way: a hop to a node with error rate e takes k + 1 attempts with probability
e^k (1 − e), every attempt withe^retries, and each attempt costs the whole hop again, with no backoff.item = fixed + Exp(tail) fixed = base ÷ 2 + transfer (a -x: the timeout, no tail) tail = hop(target) − base ÷ 2 p_q(s) = Σ over the parts of the critical path of max over the items of the part of fixed + tail × ln(1 ÷ (1 − q)) p_q(U) = the t with Σ share(s) × P(s ≤ t) = qPercentiles of an idle hop over its mean idle hop p50 p90 p95 p99 p999 ÷ mean 0.85× 1.65× 2× 2.8× 3.95× -
1.6 Fan-out, payload size, bandwidth and egress
x200at the start of a label means 200 calls per request. Load counts 200, latency counts the step once (as if batched or parallel), and all 200 payloads cross the link.~2MBgives a step a payload. A read's payload comes back from its target and a write's goes from the sender. It adds transfer time at the slower end's bandwidth (client 10 MB/s, edge kinds 1,000 MB/s, service 200 MB/s, everything else 100 MB/s), and fills the bandwidth of the nodes you run. Object storage and CDNs scale out, so for them bandwidth is only the speed of one transfer.Payloads sent to a client or a third party are internet egress, charged to the sender: $0.09/GB from anything you run, $0.02/GB from a CDN. Traffic between your own nodes is free.
transfer(step) = N × size ÷ min(bandwidth(from), bandwidth(to)) ρ_bandwidth(n) = payload bytes in and out per second ÷ (bandwidth × replicas × shards) egress GB/month = R × share × N × size × 2,592,000 s ÷ 10⁹ for payloads sent to a client or a third party egress cost = egress GB × price of the node that sends it -
1.7 Availability
Each replica is up a fixed fraction of the time, independently. A node is up when any replica is. A use case is up when every node on the synchronous path of its main scenario (the largest share) is up. A node with a fallback only takes it down when the fallback path is down too.
Writes to a single-primary store need its primary. With replicas, failover keeps 10% of the primary's downtime, so a PostgreSQL primary with replicas takes writes 99.995% of the time, alone 99.95%.
A fallback is a success scenario that calls the node with
-xbefore the entry response and finishes without a successful synchronous call to it. Load does not affect availability.An error rate (
errors 2%) fails that share of calls to a node that is up. Withretries, a call fails only when every attempt does.A(n) = 1 − (1 − a(n))^replicas A_write(n) = 1 − (1 − a(n)) × 0.1 single-primary, 2+ replicas = a(n) single-primary, 1 replica A(U) = Π over nodes n on the main path of A(n), or A_write(n) when the main path writes to it 1 − (1 − A(n)) × (1 − A(fallback)) with a fallback × (1 − e(n)^(retries + 1)) with an error rate -
1.8 Cost
Each instance costs a flat monthly price from its profile, whatever its load, plus egress, for a 30-day month. Clients, DNS and external systems cost nothing. There are no instance sizes or per-request prices. Egress follows the average rate of a traffic line with
peak, since the month is mostly not the peak hour.The cost splits by owner: a node counts whole for its team (
@Payments), for every group it is inside and for its tag and its groups' tags. A budget such ascost @Payments <= 500 usd/monthchecks one of those sums.cost = Σ over nodes replicas × shards × cost(n) + egress cost(n) cost(@T) = Σ over nodes owned by T the same cost(g) = Σ over nodes inside group g the same -
1.9 Failures: survive, fallbacks, single points of failure
survive any node failureremoves one instance of every node you run and analyses the design again. With two or more replicas, the node must not saturate and every latency requirement must still hold. On a sharded store the instance comes out of one shard. A single-primary store promotes a replica, so losing its primary costs one read replica. With one replica, every use case that needs the node must have a fallback scenario.survive failure of <selector>does the same for chosen nodes.The Results tab lists single-replica nodes that a use case needs without a fallback as single points of failure.
A
whatifblock'sfail <node>takes the whole node down: its availability is 0, and each scenario that needs it hands its share of traffic to the use case's fallback scenarios for it, in proportion to their own shares (equally when they have none). A scenario without a fallback keeps its share, and that share of the use case's requests fails: its availability is multiplied by what is left. Latency, load and cost then follow from the new shares.- x2+
- with one replica fewer, the node does not saturate and the latency limits still hold
- x1
- every use case that needs it has a fallback scenario
- Skipped
- clients, external systems, DNS, notes
- fail n
- traffic moves to fallbacks; without one, that share fails
-
1.10 Tech stacks, kinds and consistency
A node's tech stack picks its kind and profile. The catalog knows 206 techs and their usual aliases (
[S3],[Postgres],[k8s]), ignoring case, punctuation and a trailing version. An unknown tech is a warning, and the node is simulated as the kind its name suggests, else the closest catalog tech, else a service.The edge splits into
cdn,loadbalancer,gatewayanddns;any edgeselects them all. DNS adds no latency, never fails and costs nothing. Each data store isstrongoreventual, which only test selectors use: replication lag is not simulated.[Postgress] did you mean PostgreSQL? → database [TigerBeetle DB] unknown → database (from its name) [Cobol Mainframe] unknown → service any edge edge, cdn, loadbalancer, gateway, dns any strong store relational, MongoDB, Spanner, queues … any eventual store caches, DynamoDB, Cassandra, search, storage …
Default profiles, per replica
Teaching values, right to an order of magnitude, not benchmarks. capacity { … } overrides any of
them per node (see How to read the results).
| Kind | Examples | Reads/s | Writes/s | Latency | Avail. | Cost/mo | Bandwidth | Egress | Durable | Consistency |
|---|---|---|---|---|---|---|---|---|---|---|
| client | Actor, shapes without a tech | ∞ | ∞ | 0 ms | 100% | $0 | 10 MB/s | — | no | — |
| cdn | CloudFront, Azure CDN, Cloud CDN, Front Door | 200k | 200k | 5 ms | 99.99% | $100 | 1,000 MB/s | $0.02/GB | no | — |
| edge | WAF, AWS WAF, Global Accelerator | 100k | 100k | 2 ms | 99.99% | $50 | 1,000 MB/s | $0.09/GB | no | — |
| loadbalancer | AWS Load Balancer (ALB, NLB), nginx, Envoy, HAProxy | 100k | 100k | 2 ms | 99.99% | $50 | 1,000 MB/s | $0.09/GB | no | — |
| gateway | AWS API Gateway, Azure API Management, Kong | 10k | 10k | 10 ms | 99.95% | $100 | 1,000 MB/s | $0.09/GB | no | — |
| dns | Route53, Azure DNS, Cloud DNS | ∞ | ∞ | 0 ms | 100% | $0 | 1,000 MB/s | — | no | — |
| service | Service, REST API, gRPC, Spring Boot, Go, Node.js, ECS, EKS, Kubernetes | 2k | 2k | 10 ms | 99.5% | $100 | 200 MB/s | $0.09/GB | no | — |
| function | Lambda, Cloud Functions, Cloud Run | 10k | 10k | 25 ms | 99.95% | $200 | 100 MB/s | $0.09/GB | no | — |
| cache | Redis, Valkey, ElastiCache, Memcached | 100k | 100k | 1 ms | 99.9% | $150 | 100 MB/s | $0.09/GB | no | eventual |
| database, relational | PostgreSQL, MySQL, Aurora, RDS, SQL Server, Oracle | 20k | 5k | 5 ms | 99.95% | $400 | 100 MB/s | $0.09/GB | yes | strong |
| database, NoSQL | DynamoDB, Cassandra, ScyllaDB, Cosmos DB | 20k | 20k | 5 ms | 99.99% | $500 | 100 MB/s | $0.09/GB | yes | eventual |
| database, NoSQL | MongoDB, CockroachDB, Bigtable, Spanner | 20k | 20k | 5 ms | 99.99% | $500 | 100 MB/s | $0.09/GB | yes | strong |
| search | Elasticsearch, OpenSearch, Solr | 3k | 3k | 15 ms | 99.9% | $400 | 100 MB/s | $0.09/GB | yes | eventual |
| analytics | BigQuery, Snowflake, Redshift, ClickHouse | 200 | 200 | 500 ms | 99.9% | $300 | 100 MB/s | $0.09/GB | yes | eventual |
| queue | SQS, Azure Queue Storage, Redis Queue | 50k | 50k | 5 ms | 99.99% | $200 | 100 MB/s | $0.09/GB | yes | strong |
| broker | Kafka, Kinesis, Pub/Sub, SNS, RabbitMQ | 50k | 50k | 5 ms | 99.99% | $200 | 100 MB/s | $0.09/GB | yes | strong |
| storage | S3, GCS, Azure Blob, MinIO | 5k | 5k | 30 ms | 99.99% | $50 | 100 MB/s | $0.09/GB | yes | eventual |
| external | Stripe, Twilio, SendGrid, third-party APIs | 1k | 1k | 200 ms | 99.9% | $0 | 100 MB/s | — | no | — |
Relational databases take 5k writes per second per
shard, not per replica. To name a product the catalog lacks without a warning, use the generic tech of
its kind ([Database], [Message Queue]) and put the product in the node's name.
02
Worked examples
Every number here comes from running the simulation on the source beside it. Paste a source into the editor to see the same numbers on its Results tab.
2.1 A cached read path
title "Feed"
user "User" [Actor]
api "Feed API" [REST API] x6
cache "Feed cache" [Redis] x2
db "Feed DB" [PostgreSQL] x2
user -> api : HTTPS
api -> cache : RESP
api -> db : SQL
usecase "Read feed" {
user -> api : GET /feed
alt "Cache hit" {
api -> cache : GET feed:{user}
api --> user : 200
} alt "Cache miss" {
api -> cache : GET feed:{user}
api -> db : SELECT posts
api -> cache : SET feed:{user}
api --> user : 200
}
}
usecase "Post" {
user -> api : POST /posts
api -> db : INSERT post
api --> user : 201
}
traffic {
"Read feed" 6k rps mix "Cache hit" 90%, "Cache miss" 10%
"Post" 1k rps
}
requirements {
p99 "Read feed" < 60ms
availability "Read feed" >= 99.9%
durable "Post"
survive any node failure
cost <= 2500 usd/month
}
Load. api takes 6k reads and 1k writes a second against
12k rps (6 × 2k):
ρ = 50% + 8%
= 58%. db gets the misses
(600 rps of SELECTs) and every post
(1k rps). Two replicas serve
40k rps of reads, but one primary takes
5k rps of writes, so writes set its utilisation:
20%.
Latency. Six API replicas at 58% queue as one pool of 6 servers. A request waits 18% of the time, so 10 ms becomes 10.7 ms (one server would take 24 ms). The cache stays at 1 ms and the database is 6.3 ms. The hit path's mean is 11.7 ms and the miss path's 19 ms.
Percentiles. p99 over the 90/10 mix is 38.6 ms, between the hit path's (34.1 ms) and the miss path's (56.7 ms). p50 is 10.3 ms, under the hit path's mean, because half of each service time is fixed.
Cost. 6 × $100 + 2 × $150 + 2 × $400 = $1,700 a month.
- pass
- p99 of Read feed is 38.6 ms (limit 60 ms)
- pass
- availability of Read feed is 99.9999% (limit 99.9%)
- pass
- "Post" writes to a durable store before responding
- pass
- Every use case keeps working after losing any of 3 nodes
- pass
- Total cost is $1,700/month (limit $2,500/month)
2.2 Replicas do not scale writes
title "Orders"
client "Client" [Actor]
api "Order API" [REST API] x8
db "Orders DB" [PostgreSQL] x3
client -> api : HTTPS
api -> db : SQL
usecase "Place order" {
client -> api : POST /orders
api -> db : INSERT order
api --> client : 201
}
traffic {
"Place order" 6k rps
}
requirements {
p99 "Place order" < 100ms
}
Then add two shards:
capacity {
db shards 2
}
Saturated. 6k INSERTs a second reach a PostgreSQL primary that takes 5k. Three replicas give 60k rps of read capacity, none of it for writes, so the database runs at 120% and the requirement fails:
- fail
- p99 of Place order: db is saturated (writes 6k rps of 5k rps, 120%) (limit 100 ms)Writes to db (PostgreSQL) need 6k rps and each primary takes 5k rps; read replicas do not add write capacity. Add shards (capacity { db shards 2 } keeps writes under 70%), move the data to a partitioned store (DynamoDB, Cassandra), or batch writes through a queue
Sharded. shards 2 gives two primaries with three replicas each: write
capacity 10k rps, utilisation
60%, and a database hop of
12.5 ms. The cost doubles: 3 × 2 × $400 =
$2,400.
- pass
- p99 of Place order is 76.7 ms (limit 100 ms)
A partitioned store such as DynamoDB, which scales writes with replicas, passes too. In a practice
problem, shards is the one capacity setting you may write yourself.
2.3 Bytes, bandwidth and egress
title "Photos through the API"
viewer "Viewer" [Actor]
api "Photo API" [REST API] x2
blobs "Photos" [AWS S3] x2
usecase "View photo" {
viewer -> api : ~2MB GET /photos/{id}
api -> blobs : ~2MB GET photo
api --> viewer : 200
}
traffic {
"View photo" 20 rps
}
title "Photos through a CDN"
viewer "Viewer" [Actor]
cdn "CDN" [AWS CloudFront] x2
blobs "Photos" [AWS S3] x2
usecase "View photo" {
viewer -> cdn : ~2MB GET /photos/{id}
alt "Edge hit" {
cdn --> viewer : 200
} alt "Edge miss" {
cdn -> blobs : ~2MB GET photo
cdn --> viewer : 200
}
}
traffic {
"View photo" 20 rps mix "Edge hit" 95%, "Edge miss" 5%
}
Transfer time. A 2 MB answer moves at the viewer's 10 MB/s: 200 ms, more than every node's latency together. Through the API the photo also crosses api ↔ storage at 100 MB/s (20 ms): mean 260 ms, p50 254 ms, p99 334 ms. Through the CDN, hits take 205 ms, misses 255 ms, and p99 is 266 ms. The viewer's bandwidth dominates both.
Egress. 20 photos of 2 MB a second is 103,680 GB a month to viewers. From the API that costs $9,331, $9,631 in total, while storage to the API is internal and costs $0. From the CDN the same bytes cost $2,074, and $2,374 in total.
03
Simplifications that may surprise you
These follow from the formulas above. None changes which of two designs is better in ordinary cases, but each moves the absolute numbers in a known direction.
| Slow hops come together pessimistic | A path takes every hop at the same quantile, as if every node's slow requests hit the same request. Real hops vary independently, so long paths have narrower tails. Kept because it is deterministic and errs safe. |
|---|---|
| A replica is one server either way | A real replica serves many requests at once, so its latency stays flat longer and then climbs faster. The shape is right; the exact curve is a teaching value. |
| Fan-out latency counted once optimistic | The slowest of 200 parallel calls is far slower than a typical one. Kept, because the same label also means a batched call, which is one round trip. |
| Independent replicas optimistic | Six service replicas at 99.5% each show as 99.999999%. A bad deploy, a zone outage or a shared dependency takes them all at once. |
| Failover is a fixed share either way | Failover always costs 10% of the primary's downtime. Real failovers take seconds to minutes, and some lose the last writes. |
| Saturation does not spread optimistic | A saturated node passes its full load on, and its latency stops at 20×. Real queues grow, time out and push retries upstream. Kept on purpose: throttling would hide the next bottleneck behind the first. Retries you declare add their load at the error rate you give, and a hot node with retries gets a retry storm warning, but the error rate does not rise by itself as the node saturates. |
| Managed bandwidth is unlimited optimistic | Object storage and CDNs never saturate on bytes. Per-prefix request limits and origin shields are not modelled. |
04
What is not modelled
Most omissions make the model optimistic: real systems are slower, less available and dearer. Treat a design that only just passes as one that would fail.
| Cold starts optimistic | A function always takes its 25 ms. Real cold starts add hundreds of milliseconds to the tail. |
|---|---|
| GC pauses, CPU steal, noisy neighbours optimistic | Every replica is equally fast all the time. Pauses and shared hardware fatten p99 and p999 beyond the queueing tails. |
| Network latency and jitter optimistic | A hop costs the target's latency only: no round trip, no cross-zone or cross-region distance, no packet loss. |
| Retry storms and thundering herds optimistic |
Retries (errors 2% retries 3) add load, latency and availability at a fixed error rate,
with no backoff, jitter or retry budget. The error rate does not grow with saturation, so a retry storm
is only a warning on a hot node, and a cold cache stampeding the database does not exist.
|
| Partial and grey failures optimistic |
A share of failing calls is an errors rate, independent per call. A slow replica, errors
that come in bursts or affect some keys only, and timeouts that differ from error responses are not
modelled.
|
| Cache hit rate either way |
The hit rate is what hit or mix says. Warm-up and eviction are not modelled, so
try the cold case in a what-if (cache hit 40%). Hits and misses are independent, by the
rate, with no correlation between keys.
|
| Hot keys and skew optimistic | Load spreads evenly over replicas and shards. One hot partition saturates a real shard long before the average does. |
| Traffic shape and autoscaling optimistic |
Traffic is one rate per use case, or an average and a peak (peak x3): the design is sized for
the peak and billed for the average. Replica counts are fixed, so there is no autoscaling between the two.
|
| Contention and per-request work either way | A key lookup and a five-table join cost the same capacity. Locks, connection pools and transactions are not modelled. |
| Queues and consumers either way |
With a drain rate, a queue has a backlog or a consumer lag at the analysed rate. A backlog
that builds at the peak and empties overnight, consumers that scale with the backlog, ordering,
redelivery and dead letters are not modelled. Without one, a queue is a node that takes writes.
|
| Time and consistency either way | TTLs, replication lag and stale reads are not simulated. Model a stale read as a scenario. |
| Third-party limits optimistic | External systems are free, take 1k requests a second per replica and never rate-limit you. |
| Shared costs either way | A node counts whole for its one team. A database two teams share, a platform team's charge-back or a split by usage are not modelled; give the node the team that pays for it. |
| Real cloud pricing either way | One flat monthly price per replica: no instance sizes, reserved or per-request pricing, storage at rest or free tiers. Cross-zone traffic is free here, where clouds charge about $0.01/GB each way. |
05
How to read the results
-
5.1 Compare designs, find the bottleneck
The inputs are rough, so read the numbers relatively. Two designs under the same traffic compare fairly: a cache that takes p99 from 300 ms to 40 ms, a database that drops from 120% to 60%. A 10% difference is inside the error of the teaching values.
Raise the traffic until a node turns amber (above 70%) or red. That node, and the lever its hint names, is what the design is about. Don't size a fleet or quote an SLO from these numbers.
- Good for
- comparing designs, finding the first bottleneck, spotting single points of failure, sanity-checking a budget
- Not for
- capacity plans, SLO commitments, cost forecasts, tail-latency estimates
- Fixed
- no randomness, no warm-up: the same text always gives the same numbers
-
5.2 Calibrate with your own measurements
capacity { … }replaces any default for one node, per replica. Put in real numbers and the rest of the model works from them:- Rate (
3k rps, orreads … writes …): the throughput at which one replica stops keeping up in a load test, since the model adds queueing on top. - Latency: the median per call at low load, measured from the caller.
- Availability: per replica, from your provider's SLA or incident history.
- Cost, egress and bandwidth: your bill and your instance's network.
- Shards, durable, consistency: how the store is set up.
The omissions in section 04 still apply, so keep headroom.
capacity { api 3k rps latency 12ms cost 140 usd/month db reads 25k rps writes 6k rps availability 99.95% users shards 4 consistency strong blobs bandwidth 500 MB/s egress 0.05 usd/GB } - Rate (
06
Practice verdicts
-
6.1 What "Solved" means
A problem is solved when every requirement and test in its given file passes against your design, with the editor's simulation. The problem fixes the traffic, the limits and the capacity numbers. A
capacityline in your file is an error, exceptshards <n>.Passing means the design is sound under this model. It does not mean the system would hold up in production: section 04 still applies.
- Latency
- p99 limits fail when the path is too long, a node queues, or any node a use case loads is saturated
- Failure
- survive and availability fail on single points of failure
- Cost
- the budget fails designs that throw replicas at the problem
- Flow
- tests check the key idea: cache before database, write before responding, never wait for a queue
-
6.2 Why brute force fails
Each problem's limits sit between the reference solution and the shortcuts: loose enough that the intended design passes with room, tight enough that a shortcut fails. More replicas break the budget, and skipping the cache overloads the database.
Every problem keeps those shortcuts as
wrong/*.proschidesigns, andproschi problem checkruns them in CI. How problems are calibrated.# expect-fail: p99 of Hold seat < 130 ms # Scales the relational database with read replicas instead of shards. import "problem.proschi" # … the rest of the design … db "Seats DB" [PostgreSQL] x4