Failure modes
0-day streakReview

Your progress

Level 1

0 XP100 XP to level 2
0day streak
0best streak
0topics started
0cards reviewed
    Review cards

    Progress is stored only in this browser. No account is required.

    Backend failure modes: the 60-second story

    Backend failure modes

    Holiday rush at the toll plaza. Which broken lane hurts most?

    Shut a lane and drivers pick another. A reader taking 40 seconds a car, light still green, keeps collecting drivers.

    Name a failure by what the caller sees

    Lanes are replicas. A shut one is easy, because checks catch it and traffic moves. A slow one still passes liveness checks, so nothing replaces it.

    80.4%

    of requests fail when only 5% hang

    1,000 threads serve 1,000 req/s at 100 ms. Hanging calls wait out a 100 s deadline and want 5,000 threads. Failing fast, it would be 5%.

    Gray failure: checks green, users failing. Who’s right?

    Bad: The health check

    Its probe takes another path and misses the broken one.

    Good: The callers

    Compare caller-side errors per replica with health status, and alert on the gap.

    One replica of four dies. Its load doesn’t.

    Four share 1,200 req/s, each serving at most 400. Lose one and the rest run at 100%, zero headroom. The next wobble ejects another, and it cascades.

    The 10-second blip ended. Why is the database still down?

    A metastable loop

    Each query times out and is retried, so 280 × 2 = 560 req/s against a limit near 300. Fix the loop, not the trigger.

    Cloudflare, 2019: one regex, every HTTP core near 100%

    A query of death crashes or wedges each replica it reaches. A config push reaches every one in seconds, so stage config like code.

    Forgotten dependencies fail everywhere at once

    1. DNS: Facebook’s servers withdrew their own routes
    2. Certificates: every handshake fails, nothing deployed
    3. Clocks: a leap second made durations negative
    4. Quotas: a signed 32-bit ID stops at 2,147,483,647

    The interview line

    Name failures stop, slow or wrong. Make slow look like down, watch callers as well as checks, keep headroom and budget retries.