πŸ’¬
βœ‰οΈ
πŸ“Έ
▢️

Loading…

How systems scale, from one server to many

How Systems Are Built
requestrouteroutereadreadcache misswritewrite
πŸ’»CLIENT
Client
βš–οΈLB
Load Balancer
βš™οΈAPI
API Server
βš™οΈAPI
API Server 2
⚑CACHEnew
Cache
πŸ—„οΈDB
Database
πŸ“¬QUEUE
Message Queue

Step 3 of 4

Step 3: Adding a Cache

Why

The Database becomes the bottleneck for read-heavy workloads. Reading the same data from disk for every request wastes CPU cycles and adds latency.

What it does

API Servers check the Cache (like Redis) before hitting the DB. If found (cache hit), return instantly. If not (cache miss), read from DB and store in Cache.

Impact

99% cache-hit rate converts 10,000 DB reads into 100. Reduces DB load dramatically, cuts read latency from ~40ms to <5ms, and doubles effective capacity.

Try it in Library β†’

Cache

β†—