Professional Cloud Database Engineer free question 5 / 10 · Domain 2: Manage a solution that can span multiple database technologies
Part of a Bigtable table has been corrupted. Which procedure repairs the original table by taking the rows you need from a backup of a time when the table was healthy?
- Restore the backup to a separate table and write the rows you need from there to the original table
- Export the backup to Cloud Storage and write the rows you need to the original table
- Specify the target column families of the original table and restore the backup over them
- Read the backup directly with a client library and write the rows you need to the original table
Show the answer and explanation
Answer: A
Why this is correct
The Use cases section of the Bigtable backups page gives the procedure for a corrupted table: restore from the backup to a new table, and then write an application that reads the new table with a Bigtable client library or Dataflow and writes the data back to the original table. A backup cannot be restored onto an existing table and cannot be read directly, so you first restore it to a separate table and then bring back the rows you need.
Why the other options are wrong
"Read the backup directly with a client library and write the rows you need to the original table" … You cannot read data straight from a Bigtable backup. You first restore it to a new table and then read that table with a client library or similar.
"Specify the target column families of the original table and restore the backup over them" … A backup cannot be restored to an existing table. Selecting column families does not change this constraint, and it does not become a partial overwrite restore on the original table.
"Export the backup to Cloud Storage and write the rows you need to the original table" … A Bigtable backup cannot be exported to another service such as Cloud Storage. This mixes up exporting the data of an ordinary table with moving the backup resource.
Key point
Instead of editing or reading the backup resource directly, use the restored table as the input to the repair process. Make sure the rows you write back do not conflict with healthy updates to the original table.