Part 6 in Azure Cosmos DB architecture Series Keep Learning and Spread your Knowledge if you don’t read the previous parts I highly recommend you to take a look into them:

Azure Cosmos DB High Availability

Let us start first by high availability in Case of region failure Microsoft solved this issue by multiple regions solution Setup and this is the first benefits from global distribution, that’s why Microsoft recommended to Setup at least two regions to save your data from any failure because at this time your data will be replicated in multiple regions, in cosmos DB the container is partitioned horizontally

So, in each region the partition will be protected by something called replica-sets and each group of replica-set is hosted in partition-set

AS we can see from above 👆 diagram in Azure Cosmos DB Account we have Container (in Azure Cosmos DB account we can set up multiple of containers) Data saved in the container and it is hosted in multiple physical partitioning and the partitioning replicated into the regions you set up it and the data committed based on the Consistency level you choose it from the 5 Consistency options and the partition protected by Replica-Set and the replica-set hosted in partition-Set. You can set up the multiple regions from Replicated data Globally in the settings bald in Azure Cosmos DB, also if you are creating your First Cosmos DB account you will find this option during the installation options by enabling Geo-redundancy, Multi-region Writes.

That’s why Cosmos DB Provides users around the world fast access to data with low latency for reading and write as comprehensive SLAs starting from 99.9 % to 99.999 %.

What Happen if region down for some reasons

 First thing you should configure the Automatic Failover in Cosmos DB and do this you need to go for Geo-replication and Select Automatic Failover, manual Failover not Recommended because it will require high connectivity between the regions to do the consistency process to ensure data is fully replicated to the secondary region and there is no data loss and in our case of the Primary server down for any reason, the consistency process will not be completed and at this time you will lose your data. Be caution

Another important point in case if we have configured multiple regions but with one single region as write and the others used for read-only and suddenly the primary region down, Azure Cosmos DB will do Automatic Failover “IF you enabled it” to another region and the APP will be able to complete the write transaction but what about the transactions not committed and not replicated to the second region before this disaster now this data not Exists in the region we do a failover to it, don’t worry these transactions are available in conflicts feed and the APP can read this data from conflicts feed based on some logic and can write this transaction to update the data in Azure Cosmos DB  For more information about this disaster scenarios check Microsoft documentation

Azure Cosmos DB Disaster recovery

Disaster recovery as a concept it is a plan and configuration to save your data from any disaster can happen and the first thing we are thinking about it is a backup solution, That’s why in Azure Cosmos DB you will find the backup is taken automatically every 4 hours to secure your data from any disaster and you can recover your data, but you need to understand

  1. Azure Cosmos DB stored the latest two backups only.
  2. Azure Cosmos DB taking snapshot from the container and saved it for 30 days
  3. Azure Cosmos DB saved the backup in Azure blob storage to reduce the latency during the backup process
  4. If you are configuring the multiple regions your backup will be replicated to these regions
  5. Microsoft did not charge you in the backup process Throughput
  6. If you need more than two backups to be saved you can configure Azure Data Factory to move your backups, or you can configure change feeds
  7. For more information about the backup process in Cosmos DB check this article

Keep Following

Cloud Tech Website blog survey

IF you found this blog is helpful and sharing useful content please take few second to do rate the website blog from here

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.