Learn

Architecture & pattern guides

Read the idea, build it on a Grid, prove it in a challenge. Short, practical guides — illustrated with RodGrid's own nodes — on system design, design patterns, flow modeling, and how to get the most out of the app.

All articles

Stress testing a design before it exists

Push traffic through the Grid, break it on purpose, and read where it gives way, free on every plan, with no AI and no server.

Nothing below is built yet. It is a design for a city marathon's results site, and in the review someone asks what happens when the winners cross the line and everyone refreshes at once. Simulate puts numbers on that today. It is arithmetic over the graph, with no AI and no server, so it runs in your browser and is free on every plan. What you get is the consequence of your design under stated assumptions, not a forecast of a real system. Read every figure here that way.

A results site, nothing built yet

Why does the panel say there is no client?

Open the panel with Simulate traffic in the top bar. There is no run button: the report follows every dial, preset and Grid change. Draw this design from the load balancer rightwards and the panel stops at "No client or frontend node found — add an entry point to send traffic." Traffic starts at a client or frontend component, here Race App. A load balancer looks like the front door, but the model treats it as a router whatever you title it. From there, traffic follows your arrows as drawn (Connecting & styling edges).

The figures below were run on this Grid: the palette's Client App, Load Balancer, Application Service, Cache and Relational Database, renamed as drawn, one replica each, no assumption edited. Race App starts at 100 requests a second. Traffic is a field you can type over and a slider that scales the same load on a log scale, from a hundredth of it to a hundred times it. Read / write mix starts at 80% reads. It decides how much of the total a cache can absorb, because writes go through. Type 400, an ordinary race morning: Results API sits at 40%, the modelled latency is about 34 ms, and Bottlenecks reports none at this load. Checking a diagram: Explain and Simulate shows where the 40% comes from.

What happens when the winners finish?

Press Flash crowd ×10. Traffic now reads 4k req/s, because the figure includes the preset, and Results API goes red at 400%. Its row under Bottlenecks says "75% unanswered (over capacity)". The node serves about 999 of the 4,000. Everything above its capacity goes unanswered and counts against availability, with no split into queued, rejected and failed.

So Availability reads about 25%, and Latency (modeled) and the tails read "unbounded", since a node over capacity has no steady wait to report. The tails, Tail ≈2x and Tail ≈3x, are a rule of thumb on the modelled mean, not percentiles of any distribution. Error rate reads 32%, tagged whole diagram, because it weighs every node by its traffic while availability follows the request path.

So add replicas and it is fixed?

Suggestions says the bottleneck runs a single replica. Hover Results API for its − N + stepper, or use Replicas in the Node Inspector, and the report follows. Replicas are written to the Grid and stay after you close the panel; dials and presets change nothing on the Grid.

NoteStop at four replicas for an odd case: 4,000 a second on 4,000 of capacity is exactly 100%. Bottlenecks lists nothing, because a bottleneck means above capacity, yet latency reads "unbounded" and the node is red. The percentage rounds to 99% below the line and 101% above it, so 100% only ever means exactly at capacity. Red is wider than bottleneck: a node also turns red when its modelled wait reaches three times its work.

Five replicas bring Results API to 80%, amber, at about 35 ms, with no bottleneck listed. It is tempting to stop here, but so far the design has faced only one scenario: the crowd.

Which zone were those replicas in?

Only one preset runs at a time. Press Flash crowd again to turn it off, type 4,000 so the load stays (a number typed with a preset on is read as the total, preset included), and press AZ loss. Availability falls to 0%. Results Cache and Results DB read "Down: every replica here was in the lost zone." The preset spreads replicas across three zones and takes the worst one for each node, so a lone replica is gone (load balancers and managed multi-zone services keep two thirds). Give each store two and they come back, with Results API now at 227%: the trouble has changed shape, so read the report again after every change.

Now predict before you touch the stepper. Nine replicas lose three, six remain, 4,000 on 6,000 is 67%. The panel says 113%. The sum left something out: this preset also adds 20 ms at every component you operate, and a service that waits longer on its calls ties up its workers for longer. The Inspector shows it on Results API as Capacity left while waiting on calls, about 59%. Twelve replicas read 85%, with latency near 99 ms against 34 ms in the calm run. The gap between your sum and the panel names an assumption you had not made.

What else can go wrong?

The panel has twelve presets under Stress test; hover one to read what it does.

  • Seven act on the whole Grid: Traffic surge ×3, Flash crowd ×10, Cache stampede, Cold cache, AZ loss, Slow 3rd-party and Retry storm. For the failures themselves, go to Hot keys & cache stampedes, Retry, and Backpressure & load shedding.
  • Five act on one node: Node loss, OOM kill, Thread-pool exhaustion, Network partition and Hot partition. They stay disabled until you select a node the model carries traffic through; on a shape, a flowchart step or an observability tool, the panel says why. Once on, each stays with that node, so clicking elsewhere to inspect the damage does not move the failure.

What did surviving cost?

Cost estimate, in the same panel, puts provisioned infrastructure at about $360–$1.5k a month for the one-replica design and about $1.2k–$4.9k for the twelve-replica one. That is an order-of-magnitude signal for comparing designs, not a quote from any provider. A design that survives only on a hundred replicas (about $5.6k–$22k) has not passed until that bill fits your budget. Results DB is listed apart as "Usage-based — not estimated", with no combined total until you state assumptions in Cost assumptions in the Inspector.

How far should I believe it?

Run Node loss on each store, with the Grid as the zone section left it: 4,000 requests a second, twelve Results API replicas and two on each store. Lose Results DB and availability reads about 64%: the 80% of requests that are reads, times the 80% the cache is assumed to hit. Lose Results Cache and it reads 0%, while Results DB climbs from 8% to 20% of its capacity with the reads landing on it: the load moves, and availability does not follow. The model counts a down node as failing the requests that wait on it and cannot see a fallback you plan to write, so this is a number to argue with, not to report.

Capacities are assumptions per component type, listed under Model assumptions at the bottom of the panel: read the ratios (a cache absorbs about ten times what a relational database does), not the third digit. A measurement of your own goes in Simulation assumptions in the Inspector. There is no clock either: a flash crowd is a higher steady load, with no warm-up and no autoscaling delay. And a rectangle labelled "database" is a drawing, left out of the numbers; for what the model reads from a node you define yourself, see Making the catalog yours: custom components.

The same questions, on a rate limiter

On the Rate Limiter Challenge the Grid starts without a design, so draw yours first, client included. Simulate then starts at the stated load, 20,000 requests a second with 50% reads. Here replicas change only through the hover stepper. Before you press anything, write down which node you expect to give way under Flash crowd ×10, and again under Retry storm. Then read Suggestions beside your guess, and when you are wrong, work out which assumption of yours the model disagreed with. The panel marks these runs as a what-if, and Challenge SLO shows each against the targets; After you submit: the score, the defense and the reference has what those do to your score.

Practice this