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 against | Doesn't protect against | Getting back | |
|---|---|---|---|
| Backup | Deletes, corruption, bad migrations, losing a whole provider | Losing what changed since it was taken | Minutes to hours |
| Snapshot | Deletes and bad changes, if it's older than the mistake | Losing the place it's stored | Minutes |
| Standby copy | A machine or disk failing | Mistakes: a bad delete is copied within seconds | Seconds |
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:
- 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.
- 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