Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

Cassandra Backup and Restore Overview

A common misconception persists in distributed database operations: “Cassandra replicates data across nodes, so backups are unnecessary.” This reasoning conflates two fundamentally different concepts—high availability and data protection.

Replication provides high availability: if one node fails, other replicas serve requests without interruption. However, replication faithfully propagates all changes to all replicas, including destructive ones. When an application bug deletes data, that deletion replicates. When an operator runs DROP TABLE, the table disappears from all nodes simultaneously. Replication ensures consistency—it ensures all replicas reflect the same state, whether that state is correct or catastrophically wrong.

Backups provide data protection: the ability to recover to a known good state after data loss, corruption, or disaster. Backups exist outside the replication system, immune to changes propagating through the cluster.


Understanding the range of potential disasters helps define appropriate backup strategies. Disasters fall into three broad categories: infrastructure failures, human errors, and external threats.

Single Node Failure

The most common failure mode. Causes include:

  • Disk failure (SSDs have finite write endurance; HDDs have mechanical failures)
  • Memory errors (ECC can correct some; others cause crashes)
  • Power supply failure
  • Motherboard or CPU failure
  • Operating system corruption
  • Network interface failure (node appears down to cluster)

With RF=3, single node failures are non-events for availability—other replicas serve requests. However, the failed node’s data must be rebuilt, either from backup or by streaming from other replicas.

Rack Failure

Multiple nodes fail simultaneously due to shared infrastructure:

  • Top-of-rack switch failure (all nodes in rack lose network)
  • PDU (Power Distribution Unit) failure (all nodes lose power)
  • Cooling failure in rack zone (thermal shutdown)
  • Shared storage failure (if using SAN/NAS)
  • Cable tray damage (fire, water, physical impact)

Rack-aware replication (NetworkTopologyStrategy with rack configuration) ensures replicas span racks. A rack failure should not cause data unavailability, but rebuilding an entire rack strains cluster resources.

Datacenter Failure

Complete loss of a datacenter:

  • Power grid failure affecting the facility
  • Network connectivity loss (upstream provider failure, fiber cut)
  • Natural disasters (earthquake, flood, hurricane, fire)
  • Cooling system failure (facility-wide thermal event)
  • Building access restrictions (civil unrest, pandemic, legal action)

Multi-datacenter deployments with NetworkTopologyStrategy survive DC failures. Single-DC deployments face complete outage until the datacenter recovers or data is restored elsewhere.

Region Failure

Geographic-scale events affecting multiple datacenters:

  • Regional power grid failure
  • Major natural disaster (earthquake affecting multiple facilities)
  • Regional network backbone failure
  • Political or regulatory action affecting a jurisdiction

Multi-region deployments provide protection, but most organizations run Cassandra within a single region for latency reasons.

Human error causes more data loss incidents than hardware failures. Unlike hardware failures, human errors typically affect all replicas simultaneously—replication provides no protection.

Accidental Data Deletion

-- Intended: Delete inactive users from staging
DELETE FROM staging.users WHERE active = false;
-- Actual: Connected to production
DELETE FROM production.users WHERE active = false;

The deletion replicates to all nodes. By the time the error is discovered, all replicas consistently reflect the data loss.

Accidental Schema Changes

-- Intended: Drop unused table in development
DROP TABLE dev_keyspace.temp_analytics;
-- Actual: Dropped production table
DROP TABLE prod_keyspace.analytics;

Schema changes are immediate and cluster-wide. The auto_snapshot feature (enabled by default) creates a snapshot before DROP operations, providing a recovery path—but only if the operator knows it exists and acts before the snapshot is cleared.

Destructive Maintenance Operations

Terminal window
# Intended: Clean up old snapshots on staging node
nodetool clearsnapshot -t old_backup
# Actual: Ran on production, cleared critical backup
Terminal window
# Intended: Remove test keyspace data
rm -rf /var/lib/cassandra/data/test_keyspace
# Actual: Typo removed production data
rm -rf /var/lib/cassandra/data/prod_keyspace

Application Bugs

  • Code deploying to production with incorrect DELETE or UPDATE logic
  • Migration scripts with bugs affecting production data
  • Race conditions causing data corruption
  • Serialization bugs writing malformed data

Application-level corruption is particularly insidious: the bad data replicates normally, and the problem may not be detected until significant damage has occurred.

Configuration Errors

  • Incorrect gc_grace_seconds causing premature tombstone removal
  • Wrong replication factor leaving data under-replicated
  • Misconfigured compaction causing data loss during cleanup
  • Authentication changes locking out all users

Ransomware and Malware

Malicious software encrypting or deleting database files. Ransomware specifically targets backup systems to prevent recovery, making off-site, air-gapped backups essential.

Security Breaches

Attackers with database access may:

  • Delete data to cover tracks
  • Corrupt data as sabotage
  • Exfiltrate and then delete data
  • Modify data for fraud

Insider Threats

Malicious actions by employees or contractors with legitimate access:

  • Deliberate data destruction (disgruntled employee)
  • Data theft followed by deletion
  • Sabotage during organizational disputes

Enterprise backup strategies are defined by measurable objectives that align technical capabilities with business requirements.

RPO defines the maximum acceptable data loss, measured in time.

If RPO is 4 hours, the organization accepts losing up to 4 hours of data in a disaster. This drives backup frequency:

RPO TargetBackup Strategy Required
24 hoursDaily snapshots
4 hoursSnapshots every 4 hours, or continuous incremental
1 hourHourly snapshots or incremental backup
15 minutesContinuous incremental with frequent sync
Near-zeroCommit log archiving (PITR capability)
ZeroSynchronous replication to secondary site

Determining RPO:

Business stakeholders must answer: “If we lose the last N hours of data, what is the business impact?”

Considerations include:

  • Transaction value (financial systems may require near-zero RPO)
  • Data recreation cost (can lost data be re-entered or regenerated?)
  • Regulatory requirements (some industries mandate specific retention)
  • Customer impact (SLA commitments, reputation damage)

RTO defines the maximum acceptable downtime, measured in time.

If RTO is 2 hours, the system must be operational within 2 hours of a disaster declaration. This drives recovery infrastructure:

RTO TargetInfrastructure Required
DaysOff-site tape storage, manual recovery
HoursRemote disk backup, documented procedures
1 hourHot standby or rapid restore capability
MinutesActive-active multi-DC, automated failover
SecondsSynchronous replication, instant failover

Factors affecting actual recovery time:

FactorImpact on Recovery Time
Backup locationRemote storage adds transfer time
Data volume10TB takes longer to restore than 100GB
Network bandwidthLimits data transfer rate
Restore methodsstableloader slower than direct file copy
Cluster sizeMore nodes = more work, but parallelizable
Staff availabilityOff-hours incidents take longer
Documentation qualityPoor runbooks slow recovery
Testing frequencyUntested procedures fail under pressure

The RTO/RPO Trade-off:

Shorter RTO and RPO require greater investment in infrastructure, tooling, and operational processes. Organizations must balance protection level against cost:

Cost
│ ╱
│ ╱
│ ╱
│ ╱
│ ╱
│ ╱
│ ╱
│ ╱
│ ╱
│ ╱
│╱
└─────────────────────→ RPO/RTO (shorter)
Approaching zero RPO/RTO requires exponentially increasing investment.

A backup that has never been tested is not a backup.

OAT validates that backup and recovery procedures work as designed, under realistic conditions, and within required time constraints.

OAT Components for Backup/Restore:

Test TypeDescriptionFrequency
Backup verificationConfirm backups complete successfullyDaily (automated)
Integrity checkValidate backup files are not corruptedWeekly (automated)
Partial restoreRestore single table to stagingMonthly
Full restoreRestore entire cluster to DR siteQuarterly
Disaster simulationUnannounced DR exercise with time measurementAnnually

What OAT Should Validate:

  1. Backup completeness: All required data is captured
  2. Backup integrity: Files are not corrupted and can be read
  3. Restore procedure: Documented steps actually work
  4. Recovery time: Actual time meets RTO requirement
  5. Data correctness: Restored data matches expected state
  6. Application functionality: Applications work with restored data
  7. Staff capability: Team can execute procedures under pressure

Common OAT Failures:

Failure ModeCausePrevention
Backup files corruptedStorage failure, incomplete transferChecksums, verification
Restore procedure failsUndocumented dependencies, environment changesRegular testing
RTO exceededUnderestimated data volume, slow networkRealistic testing
Wrong data restoredIncorrect backup selected, timestamp confusionClear naming, automation
Missing schemaSchema not included in backupInclude schema in every backup
Application incompatibilitySchema drift, version mismatchEnd-to-end testing

Backup and restore is one component of broader business continuity:

ComponentPurpose
Backup & RestoreRecover data after loss
Disaster Recovery (DR)Recover systems after site failure
High Availability (HA)Prevent outages through redundancy
Business Continuity (BC)Maintain business operations during disruption

These components complement each other:

┌─────────────────────────────────────┐
│ Business Continuity │
│ ┌───────────────────────────────┐ │
│ │ Disaster Recovery │ │
│ │ ┌─────────────────────────┐ │ │
│ │ │ High Availability │ │ │
│ │ │ ┌───────────────────┐ │ │ │
│ │ │ │ Backup/Restore │ │ │ │
│ │ │ └───────────────────┘ │ │ │
│ │ └─────────────────────────┘ │ │
│ └───────────────────────────────┘ │
└─────────────────────────────────────┘

Understanding what replication does and does not protect against:

Failure TypeReplication Protects?Backups Protect?
Single node failureYesYes
Multiple node failures (within RF)YesYes
Simultaneous failures exceeding RFNoYes
Rack failure (with rack-aware placement)YesYes
Datacenter failure (with multi-DC)YesYes
DROP TABLE or DROP KEYSPACENoYes
TRUNCATE commandNoYes
Accidental DELETE statementsNoYes
Application bug corrupting dataNoYes
Malicious insider deleting dataNoYes
Ransomware encryptionNoYes (if offline)
Regulatory data retentionNoYes
Point-in-time audit requirementsNoYes

Even with backups, restoration has a time limit determined by gc_grace_seconds (default: 10 days).

Cassandra uses tombstones (deletion markers) rather than immediately removing data. Tombstones propagate to all replicas, ensuring deletions are consistent. After gc_grace_seconds, tombstones are eligible for removal during compaction.

The resurrection problem:

Timeline:
Day 0: Full backup taken (contains Row X)
Day 3: Row X deleted (tombstone created)
Day 11: Tombstone expires, removed by compaction
Day 15: Restore Day 0 backup to one node
State after restore:
- Restored node: Has Row X (from backup)
- Other nodes: No Row X, no tombstone (tombstone was removed)
Result:
- Anti-entropy repair sees Row X on restored node
- No tombstone exists to indicate deletion
- Row X replicates back to other nodes
- Deleted data "resurrects"

Implications:

Backup AgeRestore ScopeSafe?
< gc_grace_secondsSingle nodeYes
< gc_grace_secondsFull clusterYes
> gc_grace_secondsSingle nodeNo (resurrection risk)
> gc_grace_secondsFull clusterYes (all nodes same state)

A complete Cassandra backup includes:

ComponentDescriptionRequiredNotes
SSTablesImmutable data filesYesThe actual data
SchemaKeyspace and table definitionsYesMust restore before data
Commit logsWrite-ahead logFor PITREnables point-in-time recovery
Configurationcassandra.yaml, JVM settingsRecommendedCluster settings, tuning
TopologyToken assignments, DC/rack layoutRecommendedFor disaster recovery

SSTables are immutable—once written, they never change. This immutability makes them ideal for backup:

  • No risk of partial writes or mid-file corruption during backup
  • Can be safely copied while Cassandra is running (after flush)
  • Hard links enable instant, zero-space local snapshots

The schema must be restored before data. Without table definitions, SSTables cannot be loaded.

Terminal window
# Export complete schema
cqlsh -e "DESC SCHEMA" > schema.cql
# Include with every backup

Commit logs enable point-in-time recovery (PITR). Combined with a base snapshot, archived commit logs can restore to any point in time:

|───────|─────────────────────────|───────|
Snapshot Failure
<─── Commit logs ───>
Recovery = Restore snapshot + replay commit logs to target time

MethodTypeRPOComplexityUse Case
SnapshotsFull point-in-timeHours-daysLowPrimary backup method
IncrementalChanged SSTablesHoursMediumReduce storage between snapshots
Commit log archivingContinuousMinutesHighPoint-in-time recovery

AxonOps simplifies backup implementation by handling snapshot scheduling, remote storage transfer, and commit log archiving—configuration takes minutes and requires no cluster restart.

See Backup Procedures for implementation details.


ScenarioComplexityTypical Approach
Single table, single nodeLowCopy files + nodetool refresh
Single node failureMediumRebuild from replicas or restore + repair
Rack failureMediumRestore nodes + repair
Datacenter failureHighRestore all DC nodes + cross-DC repair
Point-in-time recoveryHighSnapshot + commit log replay
Migration to new clusterMediumsstableloader

AxonOps provides guided restore workflows for each scenario, reducing complexity and eliminating manual file handling.

See Restore Procedures for detailed procedures.


Implementing enterprise-grade backup and restore requires significant operational investment:

  • Scheduling and orchestration across all nodes
  • Off-site storage with appropriate retention
  • Monitoring and alerting for backup failures
  • Regular restore testing and validation
  • Documentation and runbook maintenance

AxonOps Backup & Restore provides a fully managed solution that can be configured in minutes:

  • Rapid setup: Configure backups against S3, GCS, Azure Blob, or S3-compatible storage in minutes
  • No restart required: Enable backup and commit log archiving on running clusters without downtime
  • Efficient transfers: Only SSTables not already in remote storage are transferred, minimizing bandwidth and time
  • Point-in-time recovery: Commit log archiving with visual timeline for precise recovery point selection
  • Guided restore: Dashboard-driven restore process for both snapshot and PITR operations
  • Automated scheduling with configurable retention policies
  • Backup monitoring and alerting for failures, capacity, and compliance

See AxonOps Backup for configuration and usage.