Spreads requests across replicas.
Did you know Layer 4 balancers route by IP and port; layer 7 balancers read HTTP and can route by path or header.
Rule of thumb Least-connections beats round-robin when request times vary a lot.
Breaks when Forwards everything; the tier behind it is what breaks.
edge zone · About it →Token bucket in front of a service.
Did you know Most limiters use a token bucket: tokens refill at the rate, and the bucket size is the burst you allow.
Rule of thumb Return 429 with a Retry-After header so well-behaved clients back off.
Breaks when Rejects real users when the limit sits below peak traffic.
edge zone · About it →Serves cacheable reads at the edge; storage, TTL and popularity decide the hit rate.
Did you know A CDN keeps copies at edge locations near users, so a cache hit skips the trip to your origin.
Rule of thumb Purge by path or tag. Purging everything sends every request to the origin at once.
Breaks when Miss storms after a purge; origin overload.
edge zone · About it →Replicas with slots, CPU, timeouts, retries.
Did you know Little's law: throughput ≈ concurrency ÷ latency. 200 slots at 50 ms serve about 4,000 req/s.
Rule of thumb Keep retries under about 10% of calls, or a slow dependency turns into a retry storm.
Breaks when Slot and queue exhaustion; retries amplify a slow dependency; crash on CPU.
app zone · About it →Consumes a queue or stream.
Did you know Queues deliver at least once, so a worker can see the same message twice.
Rule of thumb Make handlers idempotent: record a processed-message id before doing side effects.
Breaks when Duplicate side effects without idempotency; backlog when slower than producers.
app zone · About it →Routing, auth checks and per-key limits at the door.
Did you know Gateways centralise auth, rate limits and routing so each service does not reimplement them.
Rule of thumb Every request pays the gateway's latency: keep its plugins lean.
Breaks when Adds latency to every call; its own quota rejects real users.
edge zone · About it →Resolves names; failover and geo routing.
Did you know DNS answers are cached for their TTL, so a change can take that long to reach everyone.
Rule of thumb Lower the TTL a day before a planned failover.
Breaks when Slow resolution; wrong region during failover.
internet zone · About it →Sidecar proxy: retries, mTLS and tracing between services.
Did you know A mesh runs a sidecar proxy beside each service to handle mTLS, retries and telemetry.
Rule of thumb Retries in the mesh and in the app multiply: configure them in one place.
Breaks when Sidecar latency on every hop; retry storms.
app zone · About it →Fails fast when a dependency keeps failing, then retries after a cooldown.
Did you know A breaker trips after too many failures and fails fast, giving the dependency room to recover.
Rule of thumb Pair it with a fallback, such as cached data, so users still see something useful.
Breaks when Trips too early (flapping) or too late (cascade).
app zone · Lesson · 2 cr →Token checks, sessions and sign-in.
Did you know Short-lived access tokens plus refresh tokens limit the damage if a token leaks.
Rule of thumb Verify tokens locally with a public key instead of calling the auth service each time.
Breaks when Every request waits on it; a slow token check slows the whole site.
app zone · About it →A third-party API with its own latency, quota and outages.
Did you know Third-party APIs have their own rate limits and outages that you cannot fix.
Rule of thumb Always set a timeout, retry with backoff, and cache what you can.
Breaks when Quota 429s; outage takes your feature down with it.
internet zone · About it →Card authorisations; slow, must never run twice.
Did you know Payment providers accept an idempotency key so a retried charge is not taken twice.
Rule of thumb Treat webhooks as the source of truth: they can arrive late, twice or out of order.
Breaks when Duplicate charges on retry; declines counted as errors.
internet zone · About it →Push, email and SMS fan-out.
Did you know Email, SMS and push providers all throttle senders and can delay delivery.
Rule of thumb Queue notifications and send them in the background; never block a user request on them.
Breaks when Provider quota; bursts back up.
app zone · About it →Long-lived connections for realtime updates.
Did you know WebSockets hold a connection per client, so memory grows with connected users, not requests.
Rule of thumb Add jitter to client reconnects to avoid a storm after every deploy.
Breaks when Connection limit per node; reconnect storms.
edge zone · About it →Runs jobs on a timer; each job calls other components.
Did you know Cron jobs tend to start on the hour, so many systems see a spike at :00.
Rule of thumb Add jitter to schedules and make every job safe to run twice.
Breaks when Thundering herd at the top of the hour; missed runs.
app zone · About it →Config and flags read on every request.
Did you know Flags let you ship code dark and turn it on gradually for a share of users.
Rule of thumb Evaluate flags locally from cached rules, not with a network call per request.
Breaks when A slow flag lookup slows everything; a bad flag rollout.
app zone · About it →Nginx-style front door: TLS termination, compression, routing.
Did you know Reverse proxies like Nginx terminate TLS, compress responses and route to backends.
Rule of thumb Reuse upstream connections with keep-alive; a new connection per request wastes time.
Breaks when Connection limits; a single proxy becomes the bottleneck.
edge zone · About it →AWS Lambda: an environment per concurrent request, cold starts, a shared account limit, billed per GB-second.
Did you know Serverless functions scale per request, but a cold start adds latency to the first call.
Rule of thumb Watch the account concurrency limit: past it, requests are throttled.
Breaks when Cold starts on bursts (seconds for Java); 429s at the account's 1,000 concurrency; one function starving the rest; costly at steady load.
app zone · About it →Small code at the CDN edge: rewrites, auth, A/B.
Did you know Edge functions run in many locations close to users, often in lightweight isolates.
Rule of thumb Keep them small: a call back to a distant database erases the latency win.
Breaks when CPU time limit per request; no local state.
edge zone · About it →One query fans out to many services (federation).
Did you know GraphQL lets a client ask for exactly the fields it needs in one request.
Rule of thumb Limit query depth and cost; one nested query can fan out into thousands of lookups.
Breaks when N+1 fan-out; one slow resolver slows the whole query.
app zone · About it →Binary RPC between internal services.
Did you know gRPC uses HTTP/2 and Protocol Buffers for compact, typed calls between services.
Rule of thumb Long-lived HTTP/2 connections defeat connection-level balancing: balance per request.
Breaks when Deadline propagation; connection reuse limits.
app zone · About it →Composes several backend calls into one screen-shaped response.
Did you know A backend-for-frontend shapes data for one client, such as the mobile app.
Rule of thumb Call downstream services in parallel; serial calls add their latencies together.
Breaks when Sequential calls add up; it inherits every downstream failure.
app zone · About it →Resizes and converts uploads on demand.
Did you know Resizing images is CPU-heavy, so it is usually done once and cached.
Rule of thumb Generate common sizes on upload, or cache on-the-fly results behind a CDN.
Breaks when CPU-bound; large uploads block workers.
app zone · About it →Long jobs that turn uploads into streamable renditions.
Did you know Transcoding turns one video into several resolutions for adaptive streaming.
Rule of thumb Run it as queued background jobs; it can take longer than the video itself.
Breaks when Minutes per job; backlog grows faster than it drains.
app zone · About it →Kubernetes cluster: pods on nodes, probes, the pod and cluster autoscalers, rolling updates.
Did you know Kubernetes places pods on nodes by their CPU and memory requests, and only replaces a lost node's pods after about 5 minutes.
Rule of thumb Give every pod a readiness probe, requests, a memory limit that covers the peak, and graceful shutdown.
Breaks when Traffic before pods are ready; probes restarting busy pods; OOMKills; Pending pods; autoscaling minutes late; all pods on one node.
app zone · About it →Stores and serves container images (Docker Hub, ECR): manifests from a database, layers from object storage.
Did you know An image is a manifest plus layers; a node pulls only the layers it does not have, so slim, shared base layers pull fastest.
Rule of thumb Pull from a registry in the same region (ECR) or a pull-through cache, never anonymously from Docker Hub at scale.
Breaks when Pull storms when many nodes start at once; Docker Hub's anonymous limit (100 pulls per 6 h); huge images slow every scale-out.
app zone · About it →The way into a Kubernetes cluster: routes by host and path to Services, terminates TLS.
Did you know An ingress controller is a reverse proxy (NGINX, Envoy, an ALB) that routes requests from outside to Services by host and path.
Rule of thumb Run it on several replicas spread across nodes; it is the front door for every Service behind it.
Breaks when Too few replicas for the connections; 502s while pods roll out; one ingress for everything is a single choke point.
edge zone · About it →EC2 Auto Scaling: VMs that track a CPU target, judged over 1-minute periods; new instances need about 3 minutes.
Did you know Autoscalers add instances when a metric stays high, but new instances take minutes to be ready.
Rule of thumb Scale ahead of known peaks: reactive scaling lags a sudden spike.
Breaks when Serves new capacity 5–8 minutes after a spike starts; a max size below the peak; a health-check grace shorter than the boot.
app zone · About it →Where services find each other (Consul, Eureka).
Did you know A registry tracks which instances are healthy so callers can find them.
Rule of thumb Cache lookups in the client so a registry outage does not stop all traffic.
Breaks when Stale entries route to dead instances; registry outage.
app zone · About it →Runs heavy jobs off the request path.
Did you know Batch jobs process large data sets on a schedule rather than per request.
Rule of thumb Checkpoint progress so a failed job resumes instead of starting over.
Breaks when Jobs pile up; retries re-run side effects.
app zone · About it →Who is online and typing: heartbeats in, status out (Slack, WhatsApp).
Did you know Presence is a heartbeat: each client pings every few seconds, and a status flips to away when the pings stop.
Rule of thumb Fan presence out through pub/sub by channel, never by polling every user.
Breaks when Heartbeat storms after a reconnect; stale status when it falls behind.
app zone · About it →Takes a broadcaster’s stream (RTMP/SRT), hands it to transcoding and storage.
Did you know Broadcasters push RTMP or SRT to an ingest point near them; from there the stream is transcoded into renditions and packaged into segments.
Rule of thumb Put ingest points in several regions so the first hop is short; segments then travel over the CDN.
Breaks when Few concurrent streams per node; a slow transcoder backs up every broadcaster.
edge zone · About it →Forwards each caller’s audio and video to the others in a call (Zoom, Meet).
Did you know An SFU receives each caller’s stream once and forwards it to every other participant, so outbound bandwidth grows with the square of the call size.
Rule of thumb Cap participants per server and cascade big meetings across several SFUs.
Breaks when Bandwidth and CPU per participant; one server per big meeting runs out.
app zone · About it →Unique, time-ordered IDs without a database round trip (short links, tweets).
Did you know A Snowflake ID packs a timestamp, a machine number and a sequence into 64 bits, so every server mints unique IDs without asking a database.
Rule of thumb Give each generator its own machine number; never let two share one.
Breaks when Clock skew; one generator becomes a bottleneck.
app zone · About it →Pairs orders or riders with drivers in sequence, one market or area at a time.
Did you know An order book or dispatch queue is processed in sequence per market, which is why one market cannot simply be spread over many CPUs.
Rule of thumb Partition by market or area, and keep each partition’s queue short.
Breaks when Single-threaded per market: a hot market queues up.
app zone · About it →Merges concurrent edits to one document and broadcasts them (Google Docs, Figma).
Did you know Operational transforms or CRDTs let several people edit one document at once and converge on the same result.
Rule of thumb Route every editor of one document to the same server, and snapshot the document so joins are fast.
Breaks when One busy document pins one server; a slow merge delays everyone.
app zone · About it →Sends each key to its shard; adding a shard moves only a slice of keys.
Did you know Consistent hashing puts keys and shards on a ring, so adding a shard moves only about 1/N of the keys.
Rule of thumb Use virtual nodes so shards get even slices of the ring.
Breaks when A hot key still lands on one shard; rebalancing traffic.
app zone · About it →Holds a launch-day crowd in a queue and lets people in at a rate the site can take.
Did you know A waiting room admits visitors at a fixed rate and holds the rest in a queue, so a ticket drop cannot overload checkout.
Rule of thumb Set the admit rate from what checkout can take, not from the crowd size.
Breaks when Admits too fast and the site falls over; too slow and people leave.
edge zone · About it →