Azure Cosmos DB 中的定价模型Pricing model in Azure Cosmos DB

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

Azure Cosmos DB 的定价模型可简化成本管理和计划。The pricing model of Azure Cosmos DB simplifies the cost management and planning. 使用 Azure Cosmos DB,你需要为你针对数据库执行的操作以及你的数据使用的存储付费。With Azure Cosmos DB, you pay for the operations you perform against the database and for the storage consumed by your data.

  • 数据库操作:数据库操作的收费方式取决于你使用的 Azure Cosmos 帐户的类型。Database operations: The way you get charged for your database operations depends on the type of Azure Cosmos account you are using.

    • 预配的吞吐量预配的吞吐量(也称为预留吞吐量)可在任何规模提供高性能。Provisioned Throughput: Provisioned throughput (also called reserved throughput) provides high performance at any scale. 请以每秒请求单位数 (RU/s) 形式指定所需吞吐量,Azure Cosmos DB 会专门配备必需的资源来提供配置的吞吐量。You specify the throughput that you need in Request Units per second (RU/s), and Azure Cosmos DB dedicates the resources required to provide the configured throughput. 可以在数据库或容器上预配吞吐量You can provision throughput on either a database or a container. 根据工作负载需求,可以随时纵向扩展/缩减吞吐量或使用自动缩放(尽管数据库或容器上有一个保证 SLA 所需的最低吞吐量)。Based on your workload needs, you can scale throughput up/down at any time or use autoscale (although there is a minimum throughput required on a database or a container to guarantee the SLAs). 按指定时间内最大的预配吞吐量以小时来收费。You are billed hourly for the maximum provisioned throughput for a given hour.

      备注

      由于预配的吞吐量模型会将资源提供给容器或数据库,因此即使不运行任何工作负载,你也要为你已预配的吞吐量付费。Because the provisioned throughput model dedicates resources to your container or database, you will be charged for the throughput you have provisioned even if you don't run any workloads.

    • 无服务器:在 无服务器模式下,无需在 Azure Cosmos 帐户中创建资源时预配任何吞吐量。Serverless: In serverless mode, you don't have to provision any throughput when creating resources in your Azure Cosmos account. 在计费周期结束时,会针对你的数据库操作已使用的请求单位量计费。At the end of your billing period, you get billed for the amount of Request Units that has been consumed by your database operations.

  • 存储:对于一个给定小时内你的数据和索引所使用的存储总量(以 GB 为单位),将按单一费率计费。Storage: You are billed a flat rate for the total amount of storage (in GBs) consumed by your data and indexes for a given hour. 存储按使用量计费,因此你不必提前预留任何存储。Storage is billed on a consumption basis, so you don't have to reserve any storage in advance. 仅为所使用的存储付费。You are billed only for the storage you consume.

Azure Cosmos DB 中的定价模型在所有 API 中都是一致的。The pricing model in Azure Cosmos DB is consistent across all APIs. 有关详细信息,请参阅 Azure Cosmos DB 定价页了解 Azure Cosmos DB 帐单Azure Cosmos DB 定价模型如何对客户而言更具经济效益For more information, see the Azure Cosmos DB pricing page, Understanding your Azure Cosmos DB bill and How Azure Cosmos DB pricing model is cost-effective for customers.

免费试用 Azure Cosmos DBTry Azure Cosmos DB for free

Azure Cosmos DB 免费为开发人员提供众多选项。Azure Cosmos DB offers many options for developers to it for free. 这些选项包括:These options include:

  • Azure Cosmos DB 免费层:使用 Azure Cosmos DB 免费层,可以轻松上手、开发和测试应用程序,甚至免费运行小型生产工作负载。Azure Cosmos DB free tier: Azure Cosmos DB free tier makes it easy to get started, develop and test your applications, or even run small production workloads for free. 如果在帐户上启用了免费层,那么在该帐户的生存期内,你将在该帐户中免费获得前 400 RU/秒的吞吐量和 5 GB 的存储空间。When free tier is enabled on an account, you'll get the first 400 RU/s and 5 GB of storage in the account free, for the lifetime of the account. 每个 Azure 订阅最多可以有一个免费层帐户,并且必须在创建帐户时选择加入使用。You can have up to one free tier account per Azure subscription and must opt-in when creating the account. 首先,在 Azure 门户中创建一个启用了免费层的新帐户 或使用 ARM 模板To get started, create a new account in Azure portal with free tier enabled or use an ARM Template.
  • Azure 试用帐户:Azure 提供了一个 免费层,它在前 30 天为你提供了价值人民币 1500 元的 Azure 额度。Azure trial account: Azure offers a free tier that gives you CNY 1500 in Azure credits for the first 30 days.
  • Azure Cosmos DB 模拟器:为方便进行开发,Azure Cosmos DB 模拟器提供了一个模拟 Azure Cosmos DB 服务的本地环境。Azure Cosmos DB emulator: Azure Cosmos DB emulator provides a local environment that emulates the Azure Cosmos DB service for development purposes. 模拟器免费提供,并且具有对云服务的高保真度。Emulator is offered at no cost and with high fidelity to the cloud service. 使用 Azure Cosmos DB 模拟器可在本地开发和测试应用程序,无需创建 Azure 订阅且不会产生任何费用。Using Azure Cosmos DB emulator, you can develop and test your applications locally, without creating an Azure subscription or incurring any costs. 投入生产之前,可以在本地使用模拟器开发应用程序。You can develop your applications by using the emulator locally before going into production. 如果对模拟器的应用程序功能感到满意,可切换到云中的“使用 Azure Cosmos DB 帐户”,从而大幅节省成本。After you are satisfied with the functionality of the application against the emulator, you can switch to using the Azure Cosmos DB account in the cloud and significantly save on cost. 有关模拟器的详细信息,请参阅使用 Azure Cosmos DB 进行开发和测试一文。For more information about emulator, see Using Azure Cosmos DB for development and testing article for more details.

后续步骤Next steps

可在以下文章中了解更多关于优化 Azure Cosmos DB 资源成本的信息:You can learn more about optimizing the costs for your Azure Cosmos DB resources in the following articles: