{"id":7073,"date":"2023-11-15T08:00:59","date_gmt":"2023-11-15T16:00:59","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cosmosdb\/?p=7073"},"modified":"2023-11-10T08:23:18","modified_gmt":"2023-11-10T16:23:18","slug":"announcing-dynamic-scaling-per-region-and-per-partition-for-azure-cosmos-dbs-autoscale","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cosmosdb\/announcing-dynamic-scaling-per-region-and-per-partition-for-azure-cosmos-dbs-autoscale\/","title":{"rendered":"Announcing Dynamic Scaling Per Region and Per Partition  for Azure Cosmos DB\u2019s Autoscale"},"content":{"rendered":"<p>We\u2019re excited to announce<strong> dynamic scaling per region and per partition<\/strong> <strong>(public preview)<\/strong> for all new Azure Cosmos DB accounts to help optimize and lower costs for your workload!<\/p>\n<p>By default, Azure Cosmos DB autoscale scales workloads based on the most active region and partition. For non-uniform workloads that have different workload patterns across regions and partitions, this can cause unnecessary scale-ups.<\/p>\n<p>Over the years, we\u2019ve heard feedback from our autoscale customers that this can be pretty unforgiving for unpredictable workloads. With this improvement to autoscale, the per region and per partition autoscale feature now allows your workloads\u2019 regions and partitions to scale independently based on usage.<\/p>\n<h3><strong>What is dynamic scaling per region and per partition?<\/strong><\/h3>\n<p><iframe src=\"\/\/www.youtube.com\/embed\/EThMhmJYhhM?feature=youtu\" width=\"560\" height=\"314\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>As you may already know, Azure Cosmos DB\u2019s autoscale automatically and instantly scales your throughput (RU\/s) based on the workload\u2019s usage. This is well-suited for mission-critical applications that have variable or unpredictable traffic patterns.<\/p>\n<p>Previously, multi-region accounts were billed based on your hottest region. Now, autoscale per region and per partition bills you for the consumption of all regions independently.<\/p>\n<p>This also applies to partitions. Previously, all partitions scaled uniformly based on the most active partition which causes unnecessary scale-ups if only one or few partitions were active.\u00a0With this new feature, we\u2019re excited to announce that partitions now scale independently, improving cost efficiency for non-uniform large-scale workloads with multiple partitions.<\/p>\n<h3><strong>Example scenario<\/strong><\/h3>\n<p>To dig into the benefits of this feature even more, let\u2019s go through an example scenario:<\/p>\n<p>Alice is currently suffering from a hot partition problem in her autoscale workload and her workload is scaling to this one partition and region. Her workload consists of a collection <strong>with 1000 RUs and 2 partitions &#8211; each partition can go up to 500 RU\/s.<\/strong> For one hour of activity, let\u2019s see what her bill would look like.<\/p>\n<p><strong>Today with 2 regions:<\/strong><\/p>\n<ul>\n<li><strong>Region 1 (Write Region)<\/strong>\n<ul>\n<li>P1: Scales up to 500 RU\/s (100% utilization) \u2013 50 RU\/s for writes &amp; 450 RU\/s for reads<\/li>\n<li>P2: Scales up to 200 RU\/s (40% utilization) \u2013 200 RU\/s for all reads<\/li>\n<\/ul>\n<\/li>\n<li><strong>Region 2 (Read Region)<\/strong>\n<ul>\n<li>P1: Scales up to 150 RU\/s (30% utilization) \u2013 50 RU\/s for write replication &amp; 100 RU\/s for reads<\/li>\n<li>P2: Scales up to 50 RU\/s (10% utilization) \u2013 no writes or reads at all (10% minimum rule applied)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" width=\"2361\" height=\"973\" class=\"wp-image-7075\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-graph-with-blue-squares-and-black-text-descript.png\" alt=\"A graph with blue squares and black text Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-graph-with-blue-squares-and-black-text-descript.png 2361w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-graph-with-blue-squares-and-black-text-descript-300x124.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-graph-with-blue-squares-and-black-text-descript-1024x422.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-graph-with-blue-squares-and-black-text-descript-768x317.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-graph-with-blue-squares-and-black-text-descript-1536x633.png 1536w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-graph-with-blue-squares-and-black-text-descript-2048x844.png 2048w\" sizes=\"(max-width: 2361px) 100vw, 2361px\" \/><\/p>\n<p><strong>Total Bill:<\/strong> 2000 RUs since region 1 reached 100% utilization (1000 RU\/s) at some point during the hour and we multiply this by the number of regions which is 2.<\/p>\n<p>Alice is frustrated as she was only able to use one of her partitions to max utilization (500 RU\/s) but is getting charged for her whole offer. Moreover, one of her regions was more idle than the other but is getting charged at its full offer, for a total charge of 2000 RU\/s.<\/p>\n<p>Let\u2019s see how Alice can benefit from this new feature.<\/p>\n<p><strong>With both dynamic scaling per region and per partition feature:\u00a0<\/strong><\/p>\n<ul>\n<li><strong>Region 1 (Write Region)<\/strong>\n<ul>\n<li>P1: Scales up to 500 RU\/s (100% utilization) \u2013 50 RU\/s for writes &amp; 450 RU\/s for reads<\/li>\n<li>P2: Scales up to 200 RU\/s (40% utilization) \u2013 200 RU\/s for all reads<\/li>\n<\/ul>\n<\/li>\n<li><strong>Region 2 (Read Region)<\/strong>\n<ul>\n<li>P1: Scales up to 150 RU\/s (30% utilization) \u2013 50 RU\/s for write replication &amp; 100 RU\/s for reads<\/li>\n<li>P2: Scales up to 50 RU\/s (10% utilization) \u2013 no writes or reads at all (10% minimum rule applied)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" width=\"2380\" height=\"978\" class=\"wp-image-7076\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-screenshot-of-a-graph-description-automatically.png\" alt=\"A screenshot of a graph Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-screenshot-of-a-graph-description-automatically.png 2380w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-screenshot-of-a-graph-description-automatically-300x123.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-screenshot-of-a-graph-description-automatically-1024x421.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-screenshot-of-a-graph-description-automatically-768x316.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-screenshot-of-a-graph-description-automatically-1536x631.png 1536w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-screenshot-of-a-graph-description-automatically-2048x842.png 2048w\" sizes=\"(max-width: 2380px) 100vw, 2380px\" \/><\/p>\n<p><strong>Total Bill:<\/strong> 900 RUs since we sum up all max RU\/s utilized per hour per region per partition.<\/p>\n<p>Alice is much happier with the overall consumption of her workload!<\/p>\n<h3><strong>Ideal use cases<\/strong><\/h3>\n<p>We recommend this feature to all new customers interested in autoscale, but there are two specific use cases that can benefit the most from dynamic scaling per region and per partition:<\/p>\n<ul>\n<li><strong>Database workloads that have a highly trafficked primary region and a secondary passive region for disaster recovery. <\/strong>\n<ul>\n<li>By enabling autoscale per region and partition, you can now save on costs as the secondary region will independently and automatically scale down while idle and automatically scale-up as it becomes active and while handling write replication from the primary region.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Multi-region database workloads. <\/strong>\n<ul>\n<li>These workloads often observe uneven distribution of requests across regions due to natural traffic growth and dips throughout the day (e.g. a database might be active during business hours across globally distributed time zones).<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3><strong>Getting started<\/strong><\/h3>\n<p>To get started, create a new Azure Cosmos DB autoscale account. Use this guide to learn <a href=\"https:\/\/aka.ms\/cosmos-autoscale-how-to\" target=\"_blank\" rel=\"noopener\">how to enable autoscale<\/a>\u00a0on a new or existing workload.<\/p>\n<p>Once your account is created, head over to the Features pane in Azure Portal. Here, you\u2019ll be able to enable to feature. Please note that this enables the feature on all autoscale collections within the account.<\/p>\n<p><img decoding=\"async\" width=\"1908\" height=\"831\" class=\"wp-image-7077\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-screenshot-of-a-computer-description-automatica.png\" alt=\"A screenshot of a computer Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-screenshot-of-a-computer-description-automatica.png 1908w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-screenshot-of-a-computer-description-automatica-300x131.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-screenshot-of-a-computer-description-automatica-1024x446.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-screenshot-of-a-computer-description-automatica-768x334.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/a-screenshot-of-a-computer-description-automatica-1536x669.png 1536w\" sizes=\"(max-width: 1908px) 100vw, 1908px\" \/><\/p>\n<p>For more information, please visit our documentation on <a href=\"https:\/\/learn.microsoft.com\/azure\/cosmos-db\/autoscale-per-partition-region\">dynamic scaling per region and partition<\/a>.<\/p>\n<h3>About Azure Cosmos DB<\/h3>\n<p>Azure Cosmos DB is a fully managed and serverless distributed database for modern app development, with SLA-backed speed and availability, automatic and instant scalability, and support for open-source PostgreSQL, MongoDB, and Apache Cassandra. <a href=\"https:\/\/cosmos.azure.com\/try\/\" target=\"_blank\" rel=\"noopener\">Try Azure Cosmos DB for free here.<\/a>\u00a0To stay in the loop on Azure Cosmos DB updates, follow us on\u00a0<a href=\"https:\/\/twitter.com\/AzureCosmosDB\" target=\"_blank\" rel=\"noopener\">Twitter<\/a>,\u00a0<a href=\"https:\/\/www.youtube.com\/AzureCosmosDB\" target=\"_blank\" rel=\"noopener\">YouTube<\/a>, and\u00a0<a href=\"https:\/\/www.linkedin.com\/company\/azure-cosmos-db\/\" target=\"_blank\" rel=\"noopener\">LinkedIn<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We\u2019re excited to announce dynamic scaling per region and per partition (public preview) for all new Azure Cosmos DB accounts to help optimize and lower costs for your workload! By default, Azure Cosmos DB autoscale scales workloads based on the most active region and partition. For non-uniform workloads that have different workload patterns across regions [&hellip;]<\/p>\n","protected":false},"author":119639,"featured_media":7077,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14],"tags":[],"class_list":["post-7073","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-core-sql-api"],"acf":[],"blog_post_summary":"<p>We\u2019re excited to announce dynamic scaling per region and per partition (public preview) for all new Azure Cosmos DB accounts to help optimize and lower costs for your workload! By default, Azure Cosmos DB autoscale scales workloads based on the most active region and partition. For non-uniform workloads that have different workload patterns across regions [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/7073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/users\/119639"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/comments?post=7073"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/7073\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media\/7077"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media?parent=7073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/categories?post=7073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/tags?post=7073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}