Skip to content

Choose Cloud Spanner Backup strategy

Goal

To propose and then implement a backup strategy for spanner for use as topology service storage

Action items:

Current proposal

  • Configure production as multi region as per ADR
  • Enable point in time recovery for 36 hours
  • Enable daily full backups for a month Enable incremental backups for 3 months to reduce storage costs. Incremental backups create full backups after every 13 incremental backups in the chain.

Summary Comparison of backup types

Feature Full Backups Incremental Backups PITR Export
Storage Efficiency Low High Low Medium
Recovery Speed Fast Medium Fast Slow
Setup Complexity Low Low Low High
Data Consistency Transactional Transactional Transactional Transactional
Retention Period Up to 1 year Up to 1 year Up to 7 days Unlimited
Cross-region Support Yes Yes Yes Yes
Google Cloud Spanner Backup Types Comparison

Full Backups

Pros Cons
Simple to understand and implement Large storage requirements
Complete data snapshot at point in time Longer backup times for large databases
Fast restoration process Can only be scheduled for once every 12 hours
Can be created on-demand or scheduled Limited to 1-year retention maximum
Highly available and encrypted

Documentation: Create backups | Backups overview

backups can be copied to another region and databases can not be deleted while a backup exists


Incremental Backups

Pros Cons
Storage efficient (only changed data) Longer recovery times if many incrementals
Faster than full backups Only available via backup schedules
Lower resource usage during backup
Reduces storage costs
Can backup every 4+ hours

Documentation: Backups overview | Backup schedules


PITR (Point-in-Time Recovery)

Pros Cons
Precise recovery to any point in time Limited to 7-day retention maximum
Minimal data loss (microsecond granularity) Higher storage costs for extended retention
Continuous data protection Performance impact with high retention periods
No separate backup jobs required To restore a full database a full backup must be performed first
Surgical recovery of specific data using stale reads

Documentation: PITR overview | Recover data using PITR


Export (CSV/Avro)

https://cloud.google.com/spanner/docs/import-export-overview#compare-import-export-backup-restore

Key References:

Edited by David Leach
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information