Apache Cassandra

Backup & Restore: Snapshots & Incremental Backups

Learn how Cassandra's snapshot and incremental backup mechanisms work, and how to restore data from them.

Cassandra provides built-in mechanisms for backing up data at the SSTable level, since its immutable-file storage model makes filesystem-level backups straightforward compared to databases with in-place mutable storage.

A snapshot is like instantly stapling a copy of your current filing cabinet's folder list to a separate binder without duplicating the paper itself, since the pages don't actually move — but once you start shredding and replacing pages in the live cabinet, the binder's stapled copies become the only remaining originals. Incremental backups are like automatically stapling a copy of every new page into that binder the moment it's filed, so you can reconstruct anything added since your last full snapshot.

Key Concepts

1
A snapshot creates hard links to a table's current SSTable files at a point in time, stored in a snapshots subdirectory — this is nearly instantaneous and consumes minimal extra disk space initially (since hard links share the same underlying data blocks until the original files change), though the snapshot's space usage grows over time as original SSTables are compacted away and only the snapshot's hard-linked copies remain on disk.
snapshotsnapshots
2
Incremental backups, when enabled, automatically hard-link every new SSTable to a backups subdirectory as soon as it's flushed from a memtable, allowing point-in-time recovery beyond just the last full snapshot by replaying incremental SSTables created since that snapshot.
Incremental backupsbackups
3
Restoring from a snapshot typically involves stopping the node (or the specific table's writes), clearing existing SSTables, copying the snapshot (and relevant incremental backup) files back into the table's data directory, and restarting — followed by running nodetool refresh or a full node restart to load the restored SSTables. For cluster-wide consistency, snapshots are usually taken across all nodes close to the same time, and restoring often requires careful coordination, especially regarding schema consistency and token ownership at the time of the snapshot.
nodetool refresh