{"id":121,"date":"2026-06-02T12:15:37","date_gmt":"2026-06-02T19:15:37","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/documentdb\/?p=121"},"modified":"2026-06-02T11:15:06","modified_gmt":"2026-06-02T18:15:06","slug":"graceful-failovers-in-azure-documentdb-now-generally-available","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/documentdb\/graceful-failovers-in-azure-documentdb-now-generally-available\/","title":{"rendered":"Graceful Failovers in Azure DocumentDB &#8211; Now Generally Available"},"content":{"rendered":"<p>We are excited to announce the general availability of graceful failovers in Azure DocumentDB.<\/p>\n<p>Not every region switch is because of availability loss. Whether you&#8217;re migrating your primary workload to a different Azure region or proactively moving ahead of a forecasted application-level upgrade, you need a failover mechanism that prioritizes data integrity over speed. One that lets you move deliberately, not reactively.<\/p>\n<p>With Graceful Failover, you initiate a controlled promotion of your replica cluster to read-write and the service guarantees that every write committed on the primary is replicated before the switch happens. No data loss. No surprises.<\/p>\n<p><strong>How It Works<\/strong><\/p>\n<p>Azure DocumentDB&#8217;s cross-region replication keeps a replica cluster in a secondary Azure region which is continuously and asynchronously synchronized with your primary. Under normal conditions, the replica trails the primary by a small window (usually in milliseconds) to avoid impacting write performance on the primary, but close enough to make a clean handoff possible.<\/p>\n<p>When you trigger a Graceful Failover, Azure DocumentDB executes a precise, ordered sequence:<\/p>\n<ol>\n<li>Drains the replication queue &#8211; waiting until the replica in Region B is fully caught up with the former primary.<\/li>\n<li>Promotes the replica in Region B to the primary.<\/li>\n<li>Demotes the former primary in Region A to read-only and reverses the replication direction.<\/li>\n<li>Automatically points the global connection string to the newly promoted primary.<\/li>\n<\/ol>\n<p>The result is a clean, zero-data-loss region switch. Your application continues operating against the global read-write connection string, which automatically updates to point to the newly promoted cluster with no connection string change required.<\/p>\n<p><strong>Choosing the Right Failover Mode<\/strong><\/p>\n<p>Graceful Failover is one of three ways a replica cluster can assume the read-write role. Here&#8217;s how they compare:<\/p>\n<table>\n<thead>\n<tr>\n<td><strong>Mode<\/strong><\/td>\n<td><strong>Trigger<\/strong><\/td>\n<td><strong>Zero Data Loss<\/strong><\/td>\n<td><strong>Automatic<\/strong><\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Graceful promotion<\/strong><\/td>\n<td>User-initiated<\/td>\n<td>\u2705<\/td>\n<td>\u274c<\/td>\n<\/tr>\n<tr>\n<td><strong>Forced promotion<\/strong><\/td>\n<td>User-initiated<\/td>\n<td>\u274c<\/td>\n<td>\u274c<\/td>\n<\/tr>\n<tr>\n<td><strong>Service-managed failover<\/strong><\/td>\n<td>Automatic (Azure DocumentDB)<\/td>\n<td>\u274c<\/td>\n<td>\u2705<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Graceful Failover is the right choice when:<\/p>\n<ul>\n<li>You&#8217;re executing a planned region migration, which is typical during changes in business traffic from one region to another.<\/li>\n<li>You want to validate your DR runbook without risking data loss<\/li>\n<li>You&#8217;re proactively moving ahead of a scheduled application maintenance window<\/li>\n<\/ul>\n<p>If an actual regional outage occurs and the primary is unreachable, Forced Promotion or Service-Managed Failover are the appropriate mechanisms. Graceful Failover requires the primary to be reachable in order to drain the queue and is thus not the right choice in that scenario.<\/p>\n<p><strong>What You Need to Use It<\/strong><\/p>\n<p>Graceful Failover requires cross-region replication to be configured. To use it:<\/p>\n<ol>\n<li>Set up cross-region replication with a replica cluster in a secondary Azure region.<\/li>\n<li>Use the global read-write connection string in your application, which automatically redirects after the promotion completes.<\/li>\n<li>Initiate Graceful Failover via the Azure Portal or programmatically through the management API when you&#8217;re ready to switch.<\/li>\n<\/ol>\n<p>No application-side changes are needed beyond using the global connection string.<\/p>\n<p><strong>In-Region HA and Cross-Region DR: The Full Picture<\/strong><\/p>\n<p>Graceful Failover addresses planned or proactive region switches, but it works alongside and not instead of in-region high availability (HA). Here&#8217;s how the layers fit together:<\/p>\n<ul>\n<li>In-region HA protects against physical shard failures within your primary region automatically, synchronously, and with zero data loss.<\/li>\n<li>Graceful Failover gives you a controlled, zero-data-loss path to move your primary workload to a different region on your own terms.<\/li>\n<li>Service-Managed Failover covers the unplanned scenario where human intervention isn&#8217;t fast enough.<\/li>\n<\/ul>\n<p>Running all three in combination gives you comprehensive coverage across failure scenarios at every scale.<\/p>\n<p><strong>Getting Started<\/strong><\/p>\n<p>Cross-region replication and Graceful Failover are available across Azure regions that support Azure DocumentDB.<\/p>\n<p>To learn more, see: <a href=\"https:\/\/aka.ms\/documentdb-graceful-failover\">https:\/\/aka.ms\/documentdb-graceful-failover<\/a><\/p>\n<h2><strong>About Azure DocumentDB<\/strong><\/h2>\n<p>Azure DocumentDB is a fully managed document database service for building and modernizing MongoDB-compatible applications. Powered by the open-source DocumentDB engine, it combines familiar APIs, tools, and workflows with Azure&#8217;s security, scalability, and operational simplicity. Whether you&#8217;re developing new applications or migrating existing MongoDB workloads, Azure DocumentDB helps you get started quickly and scale with confidence.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are excited to announce the general availability of graceful failovers in Azure DocumentDB. Not every region switch is because of availability loss. Whether you&#8217;re migrating your primary workload to a different Azure region or proactively moving ahead of a forecasted application-level upgrade, you need a failover mechanism that prioritizes data integrity over speed. One [&hellip;]<\/p>\n","protected":false},"author":64774,"featured_media":144,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-121","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure-document-db"],"acf":[],"blog_post_summary":"<p>We are excited to announce the general availability of graceful failovers in Azure DocumentDB. Not every region switch is because of availability loss. Whether you&#8217;re migrating your primary workload to a different Azure region or proactively moving ahead of a forecasted application-level upgrade, you need a failover mechanism that prioritizes data integrity over speed. One [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/documentdb\/wp-json\/wp\/v2\/posts\/121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/documentdb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/documentdb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/documentdb\/wp-json\/wp\/v2\/users\/64774"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/documentdb\/wp-json\/wp\/v2\/comments?post=121"}],"version-history":[{"count":2,"href":"https:\/\/devblogs.microsoft.com\/documentdb\/wp-json\/wp\/v2\/posts\/121\/revisions"}],"predecessor-version":[{"id":149,"href":"https:\/\/devblogs.microsoft.com\/documentdb\/wp-json\/wp\/v2\/posts\/121\/revisions\/149"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/documentdb\/wp-json\/wp\/v2\/media\/144"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/documentdb\/wp-json\/wp\/v2\/media?parent=121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/documentdb\/wp-json\/wp\/v2\/categories?post=121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/documentdb\/wp-json\/wp\/v2\/tags?post=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}