System Design · Module 12
Reliability, overload and traffic spikes
- Lessons
- 13
- Free
- 0
- Reading
- ~4 h
Your progress
0 / 13 lessons done
Sign in to trackLessons
- Idempotency: making retries safeA timeout cannot tell you whether an order or payment succeeded. Safe retries need durable operation identities at every boundary that can create another effect.
- Exponential backoff and jitterRetries can recover a checkout after a brief connection failure. The same retries can keep a payment service overloaded unless you control their timing and total cost.
- Circuit breakers and bulkheads: containing failuresA slow optional dependency can stop checkout when both share connections or workers. Circuit breakers and bulkheads help you contain that failure instead of spreading it.
- Batching: combining requests for efficiencyBatching can remove a bottleneck without adding servers. It also introduces waiting, larger failure groups and buffered state that you must manage explicitly.
- Backpressure: slowing down upstream producersA fast reader can overwhelm a slower database without using much CPU. Backpressure keeps importers, workers and streaming pipelines within their capacity instead of turning temporary slowdowns into memory failures.
- Load shedding: rejecting work to stay availableTraffic spikes and slow dependencies can consume every available request slot. Load shedding limits that damage before waiting customers and retries turn a slowdown into an outage.
- Tail latency: why p99 mattersA service can have a healthy average response time while some customers repeatedly wait seconds. Tail measurements help you find those delays without making overload worse.
- Graceful degradation: keeping core features working during failuresA small dependency failure can disable an otherwise healthy product. Graceful degradation lets you preserve useful behavior without hiding failed payments, stale permissions or broken business guarantees.
- Rate limiter placement: where and what to limitA limit can report successful enforcement while protecting the wrong resource. Placement determines whose traffic shares a budget, which costs rejection avoids, and what happens when enforcement fails.
- Rate limiting algorithms: token bucket to sliding windowA rate limit’s algorithm determines which requests succeed, not just how many succeed on average. Choosing the wrong model can block normal customers or admit bursts your service cannot handle.
- Abuse prevention: bots, spam and fraudA request can pass authentication and rate limits yet still steal an account, publish spam or misuse a payment method. Engineers need controls at the point where requests create consequences.
- Case: Stripe’s approach to safe payment retriesA payment timeout can leave your database and your provider disagreeing. Safe recovery needs a stable operation identity and a way to establish what actually happened.
- Design: an API rate limiterA limiter sits before useful work, but can become a new source of outages. You need to control both the traffic it admits and the failures it introduces.
Practise with
Terms this module teaches 30
Open glossaryBackpressure
Feedback that makes an upstream producer slow down or pause when downstream processing cannot accept more work.
Batching
Combining compatible items into a shared request or processing group to spread fixed costs across them.
Bulkhead
A resource boundary that limits how much capacity one workload can occupy, protecting other workloads.
Consumer prefetch
A limit on how many messages a broker may deliver ahead of consumer acknowledgement.
Coordinated omission
Measurement bias caused when the measurement process avoids observations during the system’s slow periods.
Credential stuffing
Trying username-password pairs stolen from another service to gain access to accounts.
Exponential backoff
A retry policy that increases the delay window by a fixed multiplier after each failure, usually up to a maximum.
Fail-closed
Rejecting work when an enforcement dependency cannot provide a decision.
Fail-open
Allowing work to continue when an enforcement dependency cannot provide a decision.
Fallback
An alternative behavior used when the preferred operation cannot provide a usable result.
Fixed window
A rate limiting algorithm that counts requests within aligned time intervals, with a separate allowance for each interval.
Graceful degradation
Continuing a useful core task with reduced functionality during failures or overload, without weakening its required correctness guarantees.
Hedged request
An additional attempt started before an earlier attempt finishes, intended to obtain an acceptable result sooner.
In-flight work
Work that has been accepted by a stage but has not yet completed.
Latency histogram
Counters that record how many observed durations fall in each duration range.
Latency percentile
A response-time value at a specified position in an ordered distribution of observations.
Leaky-bucket shaper
A mechanism that holds pending work in a bounded queue and releases it at a configured pace.
Load shedding
Deliberately rejecting work during overload to preserve capacity for work the system can still complete usefully.
Quantile
A value at a specified fractional position in an ordered distribution, using a stated convention for finite datasets.
Rate limiter
A mechanism that admits or rejects work according to an allowance over time.
Rate limiting
Controlling how much work a subject may start over time under a defined policy.
Request deadline
The latest time an operation is allowed to continue, shared across the work needed to finish it.
Request fingerprint
A digest of defined, normalized request fields used to detect changed content under the same operation identity.
Retry deadline
The overall time limit for an operation, including its attempts and the waits between them.
Retry jitter
Random variation in retry delays that reduces the chance that callers retry together.
Shadow mode
Running a policy and recording its decisions without enforcing them.
Sliding-window counter
A rate limiting algorithm that estimates recent traffic using counts from adjacent time intervals instead of individual timestamps.
Sliding-window log
A rate limiting algorithm that stores recent admission timestamps and checks how many remain within the preceding interval.
Token bucket
A rate limiting algorithm that restores permission at a configured rate, saves it up to a capacity, and spends it when requests are admitted.
Webhook
An HTTP request one system sends to another when an event happens, so the receiver doesn’t have to keep asking for changes.