{"id":1130,"date":"2020-05-19T10:36:38","date_gmt":"2020-05-19T17:36:38","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cosmosdb\/?p=1130"},"modified":"2020-08-19T09:32:29","modified_gmt":"2020-08-19T16:32:29","slug":"autoscale-serverless-offers","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cosmosdb\/autoscale-serverless-offers\/","title":{"rendered":"Autoscale + serverless: new offers to fit any workload"},"content":{"rendered":"<p><em>This blog post was co-authored by Deborah Chen and Thomas Weiss, program managers on Azure Cosmos DB.\u00a0<\/em><\/p>\n<p><strong><em>Update<\/em><\/strong>: <a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/serverless-preview\/\">Serverless is available in preview<\/a> for the Core (SQL) API as of August 19, 2020.<\/p>\n<p>Over the years, we\u2019ve heard from many of you that you\u2019d like more flexibility with the Azure Cosmos DB billing model to better balance cost and performance. With our current provisioned throughput model, it\u2019s easy to set the exact throughput you need for your workload, measured in Request Units per second (RU\/s), guaranteed by Azure Cosmos DB\u2019s SLAs. For scenarios where your application doesn\u2019t need constant throughput however, we know choosing the right RU\/s can be a challenge. For example, some apps might have variable, unpredictable traffic, while others might not have consistent usage at all, seeing only sporadic spikes of usage.<\/p>\n<p>To make this easier, we\u2019re excited to announce two new ways to pay for your database operations: the <strong>general availability of autoscale provisioned throughput<\/strong>, which brings automatic scaling to our provisioned throughput model, and the <strong>upcoming preview of serverless<\/strong>. Together, provisioned throughput and serverless ensure that Azure Cosmos DB is, more than ever, a database that delivers the best performance and cost-effectiveness for any kind of workload.<\/p>\n<h2>Autoscale provisioned throughput (GA)<\/h2>\n<p>With autoscale provisioned throughput (formerly known as \u201cautopilot\u201d) Azure Cosmos DB automatically and instantaneously scales your throughput (RU\/s) based on the workload usage within a preset range. This means you can focus on building your application and let Azure Cosmos DB handle the work of capacity and scale management for you. Autoscale is well suited for mission-critical applications that have variable or unpredictable traffic patterns.<\/p>\n<p>It\u2019s backed by all Azure Cosmos DB SLAs, supports all Azure Cosmos DB APIs \u2013 Core (SQL), Gremlin, Cassandra, Table, and API For MongoDB \u2013\u00a0 and helps optimize your RU\/s usage and cost by scaling down when not in use.<\/p>\n<h3>How does autoscale work?<\/h3>\n<p>You set the highest or maximum throughput (RU\/s), T_max, you want your database or container to scale to. Azure Cosmos DB scales the RU\/s based on usage, so that it\u2019s always between 10% of T_max and T_max. For example, if you set a maximum throughput of 10,000 RU\/s, this will scale between 1000 to 10,000 RU\/s. Billing is done on a per-hour basis, for the highest RU\/s the system scaled to within the hour.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-1180 size-full\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/Build-offering-blog-screen_10b.png\" alt=\"Autoscale automatically adjusts the provisioned throughput to your traffic\" width=\"1020\" height=\"539\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/Build-offering-blog-screen_10b.png 1020w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/Build-offering-blog-screen_10b-300x159.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/Build-offering-blog-screen_10b-768x406.png 768w\" sizes=\"(max-width: 1020px) 100vw, 1020px\" \/><\/p>\n<p>Based on your feedback from the preview, with GA, we are introducing several new features to make autoscale easier to use:<\/p>\n<p><strong>Custom values are now supported for the maximum throughput (RU\/s),<\/strong> which replaces the set of values available in the preview. This gives you more flexibility to set the right value based on the needs of your workload. Any resources created during the preview will <a href=\"https:\/\/aka.ms\/cosmos-autoscale-faq\">automatically be compatible<\/a> with the new model.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/create-new-autoscale-container-2.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-1137\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/create-new-autoscale-container-2.png\" alt=\"Create new autoscale container in Azure portal\" width=\"500\" height=\"615\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/create-new-autoscale-container-2.png 500w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/create-new-autoscale-container-2-244x300.png 244w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p><strong>Autoscale can now be enabled on existing databases and containers.<\/strong> This makes it easy to take advantage of autoscale without having to migrate your data or create resources. If you have an existing workload with a variable or unpredictable traffic pattern, and don\u2019t currently do manual scaling yourself, enabling autoscale can help optimize your RU\/s usage and cost, as it will scale down to the minimum of the RU\/s range when not in use.<\/p>\n<p>Finally, we now have <strong>programmatic support<\/strong> in the latest versions of the Azure Cosmos DB SDKs for .NET and Java, Resource Manager, and commands for Cassandra API and API for MongoDB. Support for PowerShell and Azure CLI will be available in an upcoming release.<\/p>\n<h3>How you can save with autoscale provisioned throughput<\/h3>\n<p>Imagine a workload with certain characteristics:<\/p>\n<ul>\n<li>Sustained traffic that varies over time, with no predictable pattern<\/li>\n<li>Peaks of 50,000 RU\/s throughput the month<\/li>\n<li>Peaks occur no more than 25% of the time<\/li>\n<\/ul>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/autoscale-metrics-azure-monitor.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-1138\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/autoscale-metrics-azure-monitor.png\" alt=\"Example of workload with variable traffic between 5000 to 50,000 RU\/s\" width=\"2562\" height=\"773\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/autoscale-metrics-azure-monitor.png 2562w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/autoscale-metrics-azure-monitor-300x91.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/autoscale-metrics-azure-monitor-1024x309.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/autoscale-metrics-azure-monitor-768x232.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/autoscale-metrics-azure-monitor-1536x463.png 1536w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/autoscale-metrics-azure-monitor-2048x618.png 2048w\" sizes=\"(max-width: 2562px) 100vw, 2562px\" \/><\/a><\/p>\n<p>The workload&#8217;s peak is easily identified \u2013 50,000 RU\/s \u2013 but the throughput needs for the rest of the time keeps changing. If you use standard provisioned throughput for this workload, you may decide to simply set the throughput capacity to 50,000 RU\/s in order to manage your peaks over the course of the month. However, doing this would mean that you\u2019d be paying the maximum all month \u2013 despite only needing that capacity 25% of the time.<\/p>\n<p>With autoscale provisioned throughput, you would set 50,000 RU\/s as your maximum and then pay for the throughput your workload uses, starting at 10% of your maximum. \u00a0As long as you don\u2019t use your maximum more than 1\/3 of the time, you can expect considerable savings. Learn more about <a href=\"https:\/\/aka.ms\/cosmos-throughput-comparison\">how to choose between standard and autoscale throughput<\/a>.<\/p>\n<h2>Announcing serverless on Azure Cosmos DB<\/h2>\n<p>Autoscale is a great fit for any situation where you need guaranteed throughput and performance, and your traffic isn\u2019t predictable enough to scale your throughput manually. But what if your workload doesn\u2019t require sustained throughput?<\/p>\n<p>In some scenarios, you may expect your Azure Cosmos DB database to sit idle most of the time, only processing requests occasionally. This is typically the case when you get started with Azure Cosmos DB, build a prototype, or even run small, non-critical applications. Provisioning throughput isn\u2019t required here; instead, you just need a cost-effective way to pay for the individual database requests you are sending.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-1171 size-full\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/Build-offering-blog-screen_9b.png\" alt=\"A spiky workload with sporadic requests\" width=\"1020\" height=\"437\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/Build-offering-blog-screen_9b.png 1020w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/Build-offering-blog-screen_9b-300x129.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/Build-offering-blog-screen_9b-768x329.png 768w\" sizes=\"(max-width: 1020px) 100vw, 1020px\" \/><\/p>\n<p>To best serve this kind of use-cases, we are extremely excited to announce the upcoming preview of Azure Cosmos DB serverless, a purely consumption-based offer. With serverless, you will only pay for:<\/p>\n<ul>\n<li>the request units (RU) consumed by your database operations,<\/li>\n<li>the storage consumed by your data.<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-1172 size-full\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/Build-offering-blog-screen_7b.png\" alt=\"Only RUs consumed by your requests get billed in serverless mode\" width=\"1020\" height=\"517\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/Build-offering-blog-screen_7b.png 1020w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/Build-offering-blog-screen_7b-300x152.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2020\/05\/Build-offering-blog-screen_7b-768x389.png 768w\" sizes=\"(max-width: 1020px) 100vw, 1020px\" \/><\/p>\n<p>Because serverless is a true pay-per-request billing model, it will lower even further the entry price for anyone who wants to start using Azure Cosmos DB or run small applications with light traffic.<\/p>\n<p>Azure Cosmos DB serverless will launch in public preview in the next couple of months and will be available for all Azure Cosmos DB APIs.<\/p>\n<h2>A tour of Azure Cosmos DB pricing models in video<\/h2>\n<p>Watch this video to better understand how autoscale provisioned throughput and serverless make Azure Cosmos DB a cost-effective solution for any kind of workload:<\/p>\n<p style=\"text-align: center;\"><iframe src=\"\/\/www.youtube.com\/embed\/CgYQo6uHyt0\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<h2>Get started<\/h2>\n<p>To get started with autoscale, check out our guide on <a href=\"https:\/\/aka.ms\/cosmos-throughput-comparison\">how to determine if you should use autoscale<\/a> for your workload. Learn more about <a href=\"https:\/\/aka.ms\/cosmos-autoscale-intro\">how autoscale works<\/a> and <a href=\"https:\/\/aka.ms\/cosmos-autoscale-how-to\">how to enable autoscale<\/a> on a new or existing workload.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Azure Cosmos DB is excited to announce two new offers: autoscale provisioned throughput (GA) and the upcoming preview of serverless. These offers complement our existing standard (manual) provisioned throughput and ensure that Azure Cosmos DB is, more than ever, a database that delivers the best cost and performance for any kind of workload.<\/p>\n","protected":false},"author":592,"featured_media":1180,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[12,13],"tags":[1176,499,1177,1178],"class_list":["post-1130","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcements","category-news","tag-autoscale","tag-azure-cosmos-db","tag-serverless","tag-throughput"],"acf":[],"blog_post_summary":"<p>Azure Cosmos DB is excited to announce two new offers: autoscale provisioned throughput (GA) and the upcoming preview of serverless. These offers complement our existing standard (manual) provisioned throughput and ensure that Azure Cosmos DB is, more than ever, a database that delivers the best cost and performance for any kind of workload.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/1130","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\/592"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/comments?post=1130"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/1130\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media\/1180"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media?parent=1130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/categories?post=1130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/tags?post=1130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}