Learning paths / Operate your application / Backups and availability

Backups, snapshots and standby copies

Reading · 7 min · Module 8, lesson 1 of 550 min left in this module

Module 8 · Backups and availabilityLesson 1 of 5

Goal: Tell a backup, a snapshot and a standby copy apart, and say which failure each one protects against.

Key idea

A backup, a snapshot and a standby copy all hold a second copy of your data, but they protect against different things. A standby copy survives a machine failing; only a backup or snapshot taken earlier survives a mistake.

Three kinds of copy

  • Backup: a copy of the data taken at a point in time and kept somewhere else, usually on a schedule. You restore it when data is lost or damaged.
  • Snapshot: a point-in-time copy of a whole disk or volume, quick to take. Good just before a risky change, such as a migration.
  • Standby copy: a second, live copy that follows every change within seconds. If the main copy's machine fails, the standby takes over.
Protects againstDoesn't protect againstGetting back
BackupDeletes, corruption, bad migrations, losing a whole providerLosing what changed since it was takenMinutes to hours
SnapshotDeletes and bad changes, if it's older than the mistakeLosing the place it's storedMinutes
Standby copyA machine or disk failingMistakes: a bad delete is copied within secondsSeconds

The last row is the one that catches people out. Run DELETE FROM orders and forget the WHERE that limits it to one order: every order is gone, and the standby deletes them too. A standby is for staying up, not for going back.

Two questions for any plan

Before you pick, answer these for each kind of data:

  1. How much can you afford to lose? A nightly backup can lose up to a day of changes. If that's too much, back up more often.
  2. How long can you be without it? Restoring a large backup takes time. If you need minutes, keep a standby too.

A copy you've never restored from is a guess. Restore one into a separate environment now and then, and time it.

Where your data lives decides who backs it up

Lesson 5.5.1 sorted data into a database, object storage, a volume, or memory. Each has a different owner for backups.

  • A database runs at a provider you chose. Its backups and standbys are that provider's settings. Find out how often it backs up, how long it keeps backups, and how you restore one.
  • Object storage usually offers versioning, which keeps old copies of a file when it's overwritten or deleted.
  • A SphereStor volume is yours on ComputeSphere, and the Backups tab is where you snapshot it (lesson 6.8.3).
  • Memory isn't backed up. Keep only what you can rebuild there.

Check yourself

A migration drops the wrong column at 10:00. You notice at 10:05. Your database has a standby copy and a nightly backup. What gets the column back?

In the docs