Six components.
Nothing wrong yet.
A load balancer, three APIs, a cache and Postgres. The cache answers 9 reads in 10.
This system is about to lose its cache. See what happens next.
Free runs up to 5,000 requests/sec · 6 free problems · 100 welcome credits with Google sign-in
A load balancer, three APIs, a cache and Postgres. The cache answers 9 reads in 10.
Blue goes to the cache. Only the orange trickle reaches Postgres.
Every read now hits Postgres: ten times its usual load. Its 40 connections fill and queries stack up.
Requests bounce off. p99 looks fine, because failed requests are not counted in it.
Add a read replica to Postgres. $447 more a month: that is the trade-off.
Same requests, same seed. The replica takes the reads the primary could not.
| Before | After | |
|---|---|---|
| Goals met | 0 of 2 | 2 of 2 |
| Success, whole run | 69.7% | 100.0% |
| p99, OK requests | 869 ms | 37 ms |
| Cloud cost / month | $1,591 | $2,038 |