In the event of an Azure data center outage, Cosmos DB automatically triggers failovers of all Cosmos DB databases with a presence in the affected region.
There are two types of failover handling supported:
- Automatic failover handling
- Manual failover handling
Let's look at each of them briefly.
If any read region fails, then Cosmos DB automatically disconnects that read region from a write region and diverts all its traffic to the preferred region list provided by the user.
If the user has not provided any region list then the traffic will be diverted to the main write region for further processing.
Once the read region is online, traffic will be automatically diverted to that region. All of this happens without a single line of code change in your application.
If the write region fails, then using a consensus protocol, another read region would be promoted as the write region. You can also specify which read region should become the write region in case of failure...