Azure Cosmos DB Continuous backup with the point in time restore

Raju RH
3 min readApr 4, 2021

--

In Microsoft Ignite (March) 2021 there were several new announcements made by different product teams (e.g. Data, AI, etc.) within Azure. As part of today’s blog post, I am going to cover one such announcement made by the CosmosDB team — Continuous backup with the point in time restore capability which is in public preview now.

Prior to this new feature announcement now you might be wondering what was the option for CosmosDB backup? Until this new announcement made the option we had was Periodic backup mode where the backup is taken at a periodic interval which will be defined by the end-user. The minimum backup interval can’t be less than one hour. Unfortunately, with Periodic back up you can’t access the backup by yourself. You’d need to raise a support request/ticket with the Microsoft team, who would then perform the backup for you. Another option was implementing custom implementation by yourself which comes with Time, Cost, and Effort.

By using Continuous backup, you can easily backup and restore your databases as a true PaaS offering similar to Azure SQL. Right now point in time restore option is available only for SQL API and Mongo API. Just like periodic backups, these backups are performed without affecting the performance of your database and without consuming any extra provisioned throughput (RUs).

Few things to be known with the Point in time restore feature:

  • The restore window is only 30 days for a given container or database and you don’t have an option to modify it.
  • Continuous Backup is available only for new accounts. This means if you already have an existing CosmosDB you can’t make use of this new feature.
  • Azure Cosmos DB stores these backups in Azure Blob storage in the respective regions
  • Azure sovereign and Azure Government cloud regions are not supporting this new feature.
  • Multi-regions write accounts are not supported.
  • The restore process restores all the properties of a container including its TTL configuration. As a result, it is possible that the data restored is deleted immediately. In order to prevent this situation, the restore timestamp must be before the TTL properties were added into the container.

The following configurations aren’t restored after the point-in-time recovery:

  • Firewall, VNET, private endpoint settings.
  • Consistency settings. By default, the account is restored with session consistency.
  • Regions.
  • Stored procedures, triggers, UDFs.

To know more about the limitations of this public preview feature can be found here. Just like any other Azure Services good to know the pricing for the restore option which can be found here.

Now let’s see within Azure Portal where we can see these options.

  • Enable the Continuous backup option while creating a new Azure CosmosDB account.
Enable Continuous Backup option
  • To restore, select a point in time in the past (UTC format) along with the option of whether you want to restore the entire account or a database.
Point In Time Restore option

Note: Continuous backup with the point in time restore feature is still in preview so be cautious before implementing it in the production workload.

Originally published at https://rajurh.blogspot.com on April 4, 2021.

--

--

Raju RH
Raju RH

Written by Raju RH

Specialties: Azure,.Net Core, Docker, Containers, Azure DevOps, Cognitive Services (AI)

No responses yet