如何在预配吞吐量与无服务器之间进行选择How to choose between provisioned throughput and serverless

适用于: SQL API Cassandra API Gremlin API 表 API Azure Cosmos DB API for MongoDB

Azure Cosmos DB 提供了两种不同的容量模式:预配吞吐量无服务器Azure Cosmos DB is available in two different capacity modes: provisioned throughput and serverless. 在这两种模式下,你可以执行完全相同的数据库操作,但这些操作的收费方式截然不同。You can perform the exact same database operations in both modes, but the way you get billed for these operations is radically different.

详细比较Detailed comparison

条件Criteria 预配的吞吐量Provisioned throughput 无服务器Serverless
状态Status 正式发布Generally available 预览In preview
最适用于Best suited for 具有持续流量的工作负载,需要可预测的性能Workloads with sustained traffic requiring predictable performance 具有间歇性或不可预测流量且平均峰值流量比低的工作负载Workloads with intermittent or unpredictable traffic and low average-to-peak traffic ratio
工作原理How it works 对于每个容器,你预配一定数量的吞吐量(以每秒请求单位数表示)。For each of your containers, you provision some amount of throughput expressed in Request Units per second. 每秒此数量的请求单位可用于你的数据库操作。Every second, this amount of Request Units is available for your database operations. 预配的吞吐量可以手动更新,也可以通过自动缩放自动调整。Provisioned throughput can be updated manually or adjusted automatically with autoscale. 你对容器运行数据库操作,无需预配任何容量。You run your database operations against your containers without having to provision any capacity.
地理分布Geo-distribution 可用(Azure 区域数不受限制)Available (unlimited number of Azure regions) 不可用(无服务器帐户只能在 1 个 Azure 区域中运行)Unavailable (serverless accounts can only run in 1 Azure region)
每个容器的最大存储Maximum storage per container 无限制Unlimited 50 GB50 GB
性能Performance SLA 涵盖的针对点读取和写入的延迟 < 10 毫秒< 10 ms latency for point-reads and writes covered by SLA SLA 涵盖的针对点读取的延迟 < 10 毫秒,针对写入的延迟 < 30 毫秒< 10 ms latency for point-reads and < 30 ms for writes covered by SLO
计费模式Billing model 对于预配的 RU/s,无论消耗了多少 RU,都按每小时计费。Billing is done on a per-hour basis for the RU/s provisioned, regardless of how many RUs were consumed. 根据数据库操作所消耗的 RU 数量,按小时收费。Billing is done on a per-hour basis for the amount of RUs consumed by your database operations.

重要

当无服务器正式发布时,一些无服务器限制可能会被解除或删除,你的反馈 将有助于我们做出决定!Some of the serverless limitations may be eased or removed when serverless becomes generally available and your feedback will help us decide! 请与我们联系,并告诉我们有关无服务器体验的详细信息:azurecosmosdbserverless@service.microsoft.comReach out and tell us more about your serverless experience: azurecosmosdbserverless@service.microsoft.com.

估计预期消耗量Estimating your expected consumption

在某些情况下,可能无法确定应当为给定的工作负荷选择预配吞吐量还是选择无服务器。In some situations, it may be unclear whether provisioned throughput or serverless should be chosen for a given workload. 为了帮助做出此决定,你可以估算总体“预期消耗”,即一个月内可能消耗的 RU 总数。To help with this decision, you can estimate your overall expected consumption, that is what's the total number of RUs you may consume over a month.

后续步骤Next steps