LESSON 05 · Downtime budget

Availability you can actually afford

Turn an availability target into minutes, recovery objectives, and restores you have actually timed.

SYSTEM VIEW

The decision

Diagram view
Budget—
Can restore to—
Restore time—

Watch a 99.9% target become 43.2 minutes a month, then bring deleted invoices back from the log and time the restore.

  1. The App server sends every request to one Primary in zone A. A 30-day month has 43,200 minutes, so 99.9% allows 43.2 minutes down. At 99.99% only 4.32 remain, too few for a paged person: failover must be automated.

    99%
    432 min
    99.9%
    43.2 min
    99.99%
    4.32 min

    What changed

    • Target 99.9%
    • 43.2 minutes down a month
  2. At 00:00 a nightly backup copies Primary to Backups. RPO is how much recent data you can afford to lose, measured in time. Nightly backups alone mean an RPO of up to 24 hours.

    RPO
    data you can lose
    Nightly RPO
    up to 24 h

    What changed

    • Backups, nightly
    • 00:00 backup
    • RPO up to 24 h
  3. Primary now also archives its write-ahead log to Backups as it writes: the 09:30 INSERT, the 11:05 UPDATE, the 13:58 UPDATE. The 00:00 backup plus every change since allows point-in-time recovery: a restore can stop at any point.

    09:30
    INSERT
    11:05
    UPDATE
    13:58
    UPDATE

    What changed

    • Write-ahead log archived
    • 3 changes since 00:00
    • Restore to any point
  4. A Standby in zone B follows Primary in sync. At 14:00 a faulty script deletes a customer’s invoices: Primary applies the DELETE, Standby copies it at once, and the archive records it. A replica is not a backup.

    14:00
    DELETE invoices
    Standby
    in sync, deletes too

    What changed

    • Standby in zone B
    • Invoices deleted at 14:00
    • The DELETE reaches Standby
  5. Point-in-time recovery starts a separate Restored copy from the 00:00 backup, replays the archive through 13:58 and stops at the line before the 14:00 DELETE. The invoices are back on the copy, and their rows can be copied back.

    Start from
    00:00 backup
    Replay
    09:30 to 13:58
    Stop before
    14:00 DELETE

    What changed

    • Restored copy, separate instance
    • Log replayed through 13:58
    • Invoices back on the copy
  6. Until you restore a backup, you don’t know whether it works or how long it takes. RTO is how long you can take to come back: loading 500 GB at 100 MB/s takes about 83 minutes before any log replay, nearly twice the 43.2-minute budget.

    500 GB at 100 MB/s
    5,000 s
    RTO
    ≈ 83 min + replay
    99.9% budget
    43.2 min

    What changed

    • Restore timed
    • 83 minutes, nearly twice the budget
  7. Multi-region is often not the first step: a bad deploy or an expired certificate can reach both regions, and a second region usually replicates asynchronously, so failover can lose recent writes. Start with tested restores, safe deploys and this Standby in zone B.

    First
    restores, deploys, zone B
    Region 2 if
    contract, law, latency

    What changed

    • Restored copy
    • Invoices copied back to Primary
    • Restores tested on a schedule
    • Standby in zone B first

Space plays · ← → step · Home resets

THE IDEA

How it works

An availability target is a budget of downtime. A 30-day month has 43,200 minutes, so 99% allows 432 minutes down, 99.5% allows 216, 99.9% allows 43.2, and 99.99% allows 4.32. At 4.32 minutes a paged person cannot reliably respond in time, so failover must be automated. Ask what customers and their contracts actually need.

The recovery point objective (RPO) is how much recent data you can afford to lose, measured in time. The recovery time objective (RTO) is how long you can take to come back. Nightly backups alone mean an RPO of up to 24 hours. Continuous archiving of the database’s write-ahead log allows point-in-time recovery to just before a bad change. A replica is not a backup: an accidental DELETE reaches it too.

Until you have restored a backup, you do not know whether it works or how long it takes. Restore on a schedule and time it. As an example, restoring 500 GB at 100 MB/s takes 5,000 seconds, about 83 minutes, before any log replay. That one restore would spend nearly twice a 99.9% month’s budget.

Multi-region is often not the first step. A bad deploy or an expired certificate can reach both regions, and a second region usually means asynchronous replication (failover can lose recent writes), more infrastructure, and failovers to rehearse. Start with tested restores, safe deploys, and a standby in a second availability zone (an isolated location in the same region). A contract requiring survival of a regional outage, a data residency law, or measured latency for distant users can justify more.

DECISION POINT

A prospect’s questionnaire asks whether you are multi-region, and the contract asks for 99.9% availability with an RPO of 1 hour. You run one Postgres primary in one zone, with nightly backups that nobody has restored. What do you do, and how do you answer?

Write a sentence or two to unlock the guidance. Committing first is what makes it stick.

Keep in mind

  • 99.9% allows 43.2 minutes of downtime in a 30-day month.
  • Until you have restored a backup and timed it, you do not know your recovery time.
  • Zone redundancy and safe deploys usually come before a second region.
CHECK YOUR UNDERSTANDING

Put it into practice.

1 OF 3
ApplyQUESTION 01

A contract promises 99.95% availability in a 30-day month. How much downtime does that allow?

Choose an answer. You’ll see the explanation once you get it right.

Next lesson

0 of 3 checkpoints answered correctly to complete this lesson.