Is it possible to snapshot a Google Cloud Spanner Database/table(s)? For compliance reasons we have to have daily snapshots of the current database that can be rolled back to in the event of a disaster: is this possible in Spanner? Is there intention to support it if not?
For those who might ask why we would need it as Spanner is replicated/redundant etc - it doesn't guard against human error (dropping a table by accident) or sabotage/espionage hence the question and requirement.
Thanks, M
History. Spanner was first described in 2012 for internal Google data centers. Spanner's SQL capability was added in 2017 and documented in a SIGMOD 2017 paper. It became available as part of Google Cloud Platform in 2017, under the name "Cloud Spanner".
Snapshots can be stored in either one Cloud Storage multi-regional location, such as asia , or one Cloud Storage regional location, such as asia-south1 . A multi-regional storage location provides higher availability and might reduce network costs when creating or restoring a snapshot.
How Google Cloud Snapshots Work. Google Cloud lets you take snapshots of persistent disks attached to your instances. A snapshot is an incremental copy of your data—the first snapshot contains all the data, while the next snapshots only save data blocks that changed in the interim.
Google Cloud Spanner now has two methods that can be used to do backups.
https://cloud.google.com/spanner/docs/backup
You can either use the built-in backups or do an export/import using a dataflow job.
Today, you can stream out a consistent snapshot by reading out all the data using your favorite tool (mapreduce, spark, dataflow) and reads at a specific timestamp (using Timestamp Bounds).
https://cloud.google.com/spanner/docs/timestamp-bounds
You have about an hour to do the export before the data gets garbage collected.
In the future, we will provide a Apache Beam/Dataflow connector to do this in a more scalable fashion. This will be our preferred method for doing import/export of data into Cloud Spanner.
Longer term, we will support backups and the ability to restore to a backup but that functionality is not currently available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With