Multiple-choice synthesis across the traffic unit: L4 vs L7 and load-balancing algorithms, reverse proxy vs gateway and the SPOF it concentrates, the mesh split, and CDN hit-ratio, TTL, and what not to cache.
SDSenior◷ 13 min
Level
FoundationsJuniorMiddleSenior
Six questions that cut across the whole unit. Each is a decision you make when you place a load balancer, choose an algorithm, decide whether a gateway earns its keep, or set a CDN cache policy — not a definition to recite, but the tradeoffs of L4/L7, the algorithms, the SPOF, the mesh, and hit-ratio economics under real load.
Confirm you can pick the right layer and algorithm for a balancer, see why a single gateway is a SPOF and when a mesh fits instead, run the hit-ratio arithmetic, and reject caching a per-user response on a shared edge.
Quiz
Completed
You must route requests by URL path and read a routing cookie, and you also want per-request retries. Which balancer layer is required, and what does it cost?
Heads-up L4 routes only by IP/port and never parses the HTTP bytes, so it can't see a path or cookie or retry a request. Content-based routing requires L7.
Heads-up Path and cookie live inside the HTTP message; an L4 balancer forwards the connection without reading it. You must be at L7 to route on content.
Heads-up The capability is real but not free: L7 terminates TLS/TCP, parses each request, and proxies two connections, costing CPU and latency. That tradeoff is why L4 exists.
Quiz
Completed
In a round-robin pool of ten, one node degrades to 5 s/request (others ~50 ms) but keeps accepting connections. What happens to the service p99, and which algorithm fixes it?
Heads-up Round-robin counts requests, not response times; it keeps feeding the slow node its even share. You need a load-aware algorithm or a latency-aware passive health check.
Heads-up It dominates the tail: a tenth of requests get the 5 s response, so the service p99 tracks the slow node. Tail latency follows the worst server you keep routing to.
Heads-up Slow isn't failing — a basic health check sees it accept connections and respond (late) and keeps it in rotation. Only a load-aware algorithm or latency-aware probe reacts.
Quiz
Completed
A single API gateway in front of 15 services crashes on a bad config push; every service is healthy but all 15 are unreachable. What's the property and the fix?
Heads-up The services were healthy — the gateway couldn't route to them. The concentrated failure is the gateway SPOF; restarting healthy services doesn't address it.
Heads-up The centralization (auth/rate-limit/routing once) is valuable. The fix is eliminating the single-instance SPOF with a redundant pool and staged rollouts, not removal.
Heads-up That re-creates the duplication the gateway solved and still leaves the routing SPOF. Make the gateway tier redundant and roll config safely instead.
Quiz
Completed
Forty services have heavy service-to-service traffic with missing retries, inconsistent mTLS, and no tracing. The public API also needs one auth/rate-limit front door. What's the right shape?
Heads-up Funneling east-west traffic through the gateway creates a god-gateway and a central bottleneck/SPOF. East-west concerns belong in a mesh's per-instance sidecars, not the central tier.
Heads-up A mesh handles east-west (service-to-service) concerns; it isn't the public front door. You still want a gateway for north-south auth, public rate limits, and the public API surface.
Heads-up That's the duplication problem again (drifting copies, the original incidents). A mesh standardizes east-west retries/mTLS/tracing centrally-configured but locally-executed; a gateway owns the public API.
Quiz
Completed
A CDN at 90% hit ratio sends 20,000 RPS of misses to the origin. A cache-key cleanup raises it to 95%. Roughly what happens to origin load?
Heads-up It's linear in the MISS fraction (10% → 5%, i.e. halved), not in the ratio. Origin load roughly halves. That non-linearity is why small hit-ratio gains pay off.
Heads-up Hit ratio is exactly origin offload: a hit is a request the origin never sees. 90% → 95% halves the miss fraction and roughly halves origin RPS.
Heads-up Backwards — more cached means fewer misses reach the origin. 90% → 95% halves the miss fraction, so origin load roughly halves.
Quiz
Completed
An engineer wants to cache the authenticated account page (shows the logged-in user's orders) on the shared CDN to make it fast. What's the verdict and why?
Heads-up A shared cache keys on the URL, not the user; without private/no-store it can serve one user's page to another. Personalized responses must never live in a shared cache.
Heads-up A short TTL still serves the cached copy to whoever requests that URL within the window — including a different user. The issue isn't freshness, it's that per-user data must not be shared.
Heads-up Correct verdict, wrong reason: they can be cached in the user's own browser (Cache-Control: private). The rule is no SHARED caching of per-user content, not no caching at all.
Recall before you leave
01
Why does a load-aware algorithm protect tail latency where round-robin doesn't?
02
How do you reject caching a per-user response on a shared CDN in one sentence?
Recap
The through-line is that traffic and edge are tradeoffs you settle before load arrives. A balancer needs the right layer (L4 fast and protocol-blind, L7 content-aware at a CPU cost) and the right algorithm (load-aware least-connections/EWMA protect the tail; consistent hashing preserves cache locality). A gateway centralizes auth/rate-limit/routing — a consistency win that becomes a single point of failure, so it runs redundant and stays thin, while a service mesh handles east-west concerns in per-instance sidecars. A CDN lives or dies on its hit ratio, whose economics are non-linear (90% → 95% halves origin traffic), and the discipline is to cache what’s the same for everyone and safe when stale and never cache per-user or must-be-correct data on a shared edge.
Something unclear?
Ask a question about this lesson. Questions are anonymous and go straight to the author to make the lesson better.