如何在预配吞吐量与无服务器之间进行选择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.

备注

目前只有 Azure Cosmos DB Core (SQL) API 支持无服务器。Serverless is currently supported on the Azure Cosmos DB Core (SQL) API only.

详细比较Detailed comparison

条件Criteria 预配的吞吐量Provisioned throughput 无服务器Serverless
状态Status 正式发布Generally available 预览In preview
最适用于Best suited for 需要可预测性能的关键工作负荷Mission-critical workloads requiring predictable performance 流量低的小到中型非关键工作负荷Small-to-medium non-critical workloads with light traffic
工作原理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.
每个帐户的限制Limitations per account Azure 区域的最大数量:不受限制Maximum number of Azure regions: unlimited Azure 区域的最大数量:1Maximum number of Azure regions: 1
每个容器的限制Limitations per container 最大吞吐量:不受限制Maximum throughput: unlimited
最大存储:不受限制Maximum storage: unlimited
最大吞吐量:5,000 RU/秒Maximum throughput: 5,000 RU/s
最大存储:50 GBMaximum storage: 50 GB
性能Performance SLA 涵盖的可用性为 99.99% 到 99.999%99.99% to 99.999% availability covered by SLA
SLA 涵盖的针对点读取和写入的延迟 < 10 毫秒< 10 ms latency for point-reads and writes covered by SLA
SLA 涵盖的保证吞吐量为 99.99%99.99% guaranteed throughput covered by SLA
SLA 涵盖的可用性为 99.9% 到 99.99%99.9% to 99.99% availability covered by SLA
SLA 涵盖的针对点读取的延迟 < 10 毫秒,针对写入的延迟 < 30 毫秒< 10 ms latency for point-reads and < 30 ms for writes covered by SLO
SLA 涵盖的突发性为 95%95% burstability 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.

突发性和预期消耗Burstability and expected consumption

在某些情况下,可能无法确定应当为给定的工作负荷选择预配吞吐量还是选择无服务器。In some situations, it may be unclear whether provisioned throughput or serverless should be chosen for a given workload. 为了做出此决策,你可以估计:To help with this decision, you can estimate:

  • 你的工作负荷的 突发性 需求,即一秒内可能需要消耗的最大 RU 数量Your workload's burstability requirement, that is what's the maximum amount of RUs you may need to consume in one second

如果工作负荷的突发性需求超出每秒 5,000 RU,则应选择预配吞吐量,因为无服务器容器不能超过此限制。If your workload requires to burst above 5,000 RU per second, provisioned throughput should be chosen because serverless containers can't burst above this limit. 如果不是,则可以根据预期的消耗来比较这两种模式的成本。If not, you can compare the cost of both modes based on your expected consumption.

示例 1:工作负荷预计的最大突发需求为 10,000 RU/秒,并且一个月内总共使用 20,000,000 个 RU。Example 1: a workload is expected to burst to a maximum of 10,000 RU/s and consume a total of 20,000,000 RUs over a month.

  • 只有预配吞吐量模式可以提供 10,000 RU/秒的吞吐量Only provisioned throughput mode can deliver a throughput of 10,000 RU/s

备注

上面示例中所示的成本仅用于演示目的。The costs shown in the previous example are for demonstration purposes only. 有关最新定价信息,请参阅定价页See the pricing page for the latest pricing information.

后续步骤Next steps