Thursday, May 2, 2024
No menu items!
HomeCloud ComputingFirestore adds point-in-time recovery and scheduled backups

Firestore adds point-in-time recovery and scheduled backups

We are excited to announce the launch of two new disaster recovery features for Firestore: point-in-time recovery (PITR) and scheduled backups. These features will provide data protection against human errors and disasters. 

This is in addition to Firestore’s automatic and redundant data replication, which allows the service to guarantee up to 99.999% SLA availability with replica failovers demonstrating 0 RPO and 0 RTO.

Point-in-time recovery provides protection against accidental deletion or writes by giving you the ability to version control and query data from the past seven days, and surgically write the needed data back into your database.

Scheduled backups lets you backup your entire database on a chosen frequency of either daily and/or weekly onto cold storage. These backups can be used to restore to a new database in the same project. 

Point-in-time recovery example walkthrough

Let’s say you would like to enable point-in-time recovery. Below you will see how to enable this feature with the Google Cloud console: 

To enable point-in-time recovery, navigate to the “Disaster recovery” page and select the “EDIT” icon.

Select the checkbox for “Enable point-in-time recovery” and click “SAVE”.

The “Disaster recovery” page now includes “Earliest version time” and “Retention period”.

That’s it! Point-in-time recovery is enabled and will begin storing data. Please refer to the documentation for more information. 

Scheduled backups example walkthrough

Now we will walk you through how to generate a backup schedule using gcloud commands for both daily and weekly, as well as how to validate that the backups were created. 

To prepare, you’ll want to:

Upgrade gcloud to the newest version

Run `gcloud config set project <project-id>` for the project in which you want to manage backups 

To create a daily backup schedule, use the “backups schedules create” command. Below is an example of daily backup schedule creation:

code_block[StructValue([(u’code’, u”$ gcloud alpha firestore backups schedules create –database=”(default)” –retention=’7d’ –recurrence=’daily'”), (u’language’, u”), (u’caption’, <wagtail.wagtailcore.rich_text.RichText object at 0x3e3a99f2f890>)])]

To create a weekly backup schedule, use the “backups schedules create” command. Below is an example of weekly backup schedule creation:

code_block[StructValue([(u’code’, u”$ gcloud alpha firestore backups schedules create –database=’testdb’ –retention=’14w’ –recurrence=u2019weeklyu2019 –day-of-week=u2019MONu2019″), (u’language’, u”), (u’caption’, <wagtail.wagtailcore.rich_text.RichText object at 0x3e3a9b0b5d90>)])]

To validate the backup schedules have been created successfully, use the “backup schedules list” command:

code_block[StructValue([(u’code’, u’$ gcloud alpha firestore backups schedules list’), (u’language’, u”), (u’caption’, <wagtail.wagtailcore.rich_text.RichText object at 0x3e3a9b0b5250>)])]

Next steps

For more information on how to set up and configure either of these features, simply check out our documentation for point-in-time recovery and scheduled backups for more information.

Thanks to Minh Nguyen, Senior Product Manager Lead for Firestore, for his contributions to this blog post.

Cloud BlogRead More

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments