All blueprints

BLUEPRINT / TRAFFIC AND SCALE

Caching

Trade freshness and memory for fewer expensive reads.

The shape

A cache keeps frequently requested values closer to the application. A hit avoids origin work. A miss pays the normal lookup cost and may add the cache write.

The useful question

What freshness does the caller require? A time to live is simple, but it does not promise that every reader sees the newest write. Invalidation can be more difficult than lookup.

Stress test

Expire a popular value while request volume is high. Without request coalescing, many identical misses may reach the database together.

Tradeoff

Stale while revalidate keeps serving an older value while one request refreshes it. This reduces a synchronized miss, but it is only safe when the application can tolerate bounded staleness.

LIVE SYSTEM / REV 01

Read path under load

Operational
Live service architectureA client sends requests through a load balancer to two app servers, a cache, a database, and a queue. Increase traffic or select a node to inject a failure.HEALTHYClientHEALTHYLoad balancerHEALTHYApp server AHEALTHYApp server BHEALTHYCacheHEALTHYDatabaseHEALTHYQueueEDGE CLIENTSCOMPUTE POOLPERSISTENCE

36k requests per second are balanced across two app servers. The cache absorbs 82% of reads.

Playground · available soon