We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Reliability Resilience
Free preview: the first 2 parts of this 6-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Reliability Resilience
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
Nightly backups have a fatal flaw: you lose everything since last night. If a destructive query runs at 4 PM and your last backup was at 2 AM, fourteen hours of transactions are gone. For a payments database processing $2 million per hour, that is $28 million of financial records you cannot reconstruct.
Continuous backup eliminates this gap by capturing every single write as it happens. The mechanism is simple in principle: the database already writes every change to a transaction log (WAL in Postgres, binlog in MySQL, redo log in Oracle) before acknowledging the commit. Continuous backup ships that log to remote storage in near-real-time, giving you the ability to restore to any second in the database's history.
GitLab learned this lesson publicly on January 31, 2017. An SRE accidentally deleted 300 GB of production data. Their nightly pg_dump was 6 hours stale, their WAL archive had silently stopped working, and the postmortem became one of the most-read incident reports in our industry. If the WAL archive had been healthy, recovery to 60 seconds before the deletion would have been straightforward.
The technology behind continuous backup is not new. Postgres has supported WAL archiving since version 8.0 in 2005. What changed is the tooling around it: wal-g (born at Citus Data, now used by GitLab, Zalando, and Adjust) automates the compression, encryption, and upload pipeline so teams do not have to build it from scratch.
Continuous backup is not a replacement for full backups. It is a complement. You need both: periodic full backups as a baseline and a continuous WAL stream to fill the gaps between them.
| Property | Nightly Full | Continuous (WAL) |
|---|---|---|
| RPO (data loss window) | Up to 24 hours | Under 60 seconds |
| Storage cost (500 GB DB) | ~$12/month on S3 | ~$55/month for WAL stream + $12 for weekly base |
| Restore speed | Fast (restore full, done) | Slower (restore base, replay WAL to target) |
| Restore granularity | Only to the backup timestamp | Any second in history |
| Operational complexity | Low (one cron job) | Medium (archiver process, lag monitoring, base schedule) |
| Failure mode | Silent if cron fails, no data until next run | Silent if archive_command fails, WAL piles up on primary disk |
The continuous backup pipeline has three components:
Without all three, continuous backup is incomplete. A WAL stream without base backups means restoring requires replaying months of logs. A base backup without WAL means you lose everything since the last base. A pipeline without monitoring means you discover failures during the incident, not before.