Cheat sheetDS-01

Foundations of Scalable Systems

Distributed & Scalable / Foundations of Scalable Systems

Scale is about adding capacity by adding resources — not about a single request being fast. Master the levers: scale out, statelessness, caching, load balancing.

01
Scalability ≠ performancePerformance is latency of one request; scalability is capacity as resources grow. Independent properties.
02
Up vs outVertical = bigger box (bounded, no redundancy). Horizontal = more boxes (unbounded, fault-tolerant).
03
StatelessnessHorizontal scale demands stateless nodes; push state to shared stores or client tokens.
04
Cache + balanceCaching cuts read load and latency; load balancers spread traffic and evict dead nodes.

When a service strains, first ask: is it slow (performance) or saturated (scalability)? Then externalize state and scale out before scaling up.

Session fixMove in-memory sessions to Redis so five app nodes can serve any user behind the balancer.
Read reliefFront images with a CDN and API responses with an app cache to shed origin load.
up (vertical): 1 big machine -> capacity ceiling
out (horizontal): N machines -> add nodes to grow
stateless node + shared store -> any node serves any request
scalabilityhorizontal-scalingstatelessnesscachingload-balancingcap
review in 6d