SingleStore DB

Attach an Unlimited Storage Database Using Point-in-Time Recovery (PITR)

The following example demonstrates how to restore an unlimited storage database. The Setup section contains the prerequisite steps needed to create the database and milestones, prior to performing the restore.

Note

Using GCS is currently a preview feature.

Setup

Create a second milestone:

CREATE MILESTONE "after_fourth_insert" FOR bottomless_db;
Perform the Restore

Suppose the values 30 and 40 were inserted into t in error. You now want to restore the database to the milestone after_second_insert. Detach the database to bring it offline:

DETACH DATABASE bottomless_db;

Then attach the database at the restore point:

For S3:

ATTACH DATABASE bottomless_db ON S3 "bottomless_db_bucket/bottomless_db_folder"
  CONFIG '{"region":"us-east-1"}'
  CREDENTIALS '{"aws_access_key_id":"your_access_key_id","aws_secret_access_key":"your_secret_access_key"}'
  AT MILESTONE "after_second_insert";

 

ATTACH DATABASE bottomless_db ON AZURE "bottomless_db_bucket/bottomless_db_folder"
 CONFIG ''  
 CREDENTIALS '{"account_name":"your_account_name","account_key":"your_account_key"}'
 AT MILESTONE "after_second_insert";

For GCS:

ATTACH DATABASE bottomless_db ON GCP "bottomless_db_bucket/bottomless_db_folder"
 CONFIG ''  
 CREDENTIALS '{"access_id":"your_access_key_id", "secret_key":"your_secret_access_key"}';
 AT MILESTONE "after_second_insert";

Note

Milestones are a convenience for naming points in time to which you may wish to restore, and synchronizing data from local to remote storage to make sure all the data is available to restore.

However, you can restore to any point in time for which all the data is available on an object store. It is not necessary to restore to a named milestone. Data is continuously and asynchronously flushed from the cluster to object storage.