停用 S1、S2 和 S3 性能级别Retiring the S1, S2, and S3 performance levels

Important

本文所述的 S1、S2 和 S3 性能级别即将停用,在新的 Azure Cosmos DB 帐户中将不再提供。The S1, S2, and S3 performance levels discussed in this article are being retired and are no longer available for new Azure Cosmos DB accounts.

本文概述 S1、S2 和 S3 性能级别,并介绍如何将使用这些性能级别的集合迁移到单分区集合。This article provides an overview of S1, S2, and S3 performance levels, and discusses how the collections that use these performance levels can be migrated to single partitioned collections. 阅读本文后,可以回答以下问题:After reading this article, you'll be able to answer the following questions:

为何要停用 S1、S2 和 S3 性能级别?Why are the S1, S2, and S3 performance levels being retired?

S1、S2 和 S3 性能级别无法提供标准 Azure Cosmos DB 产品提供的灵活性。The S1, S2, and S3 performance levels do not offer the flexibility that the standard Azure Cosmos DB offer provides. 使用 S1、S2、S3 性能级别时,吞吐量和存储容量都是预设的,没有任何弹性。With the S1, S2, S3 performance levels, both the throughput and storage capacity were pre-set and did not offer elasticity. 现在,Azure Cosmos DB 允许用户自定义吞吐量和存储,大幅提高随需求变化而缩放的灵活性。Azure Cosmos DB now offers the ability to customize your throughput and storage, offering you much more flexibility in your ability to scale as your needs change.

单区集合和分区集合与 S1、S2、S3 性能级别有哪些区别?How do single partition collections and partitioned collections compare to the S1, S2, S3 performance levels?

下表比较了单区集合、分区集合以及 S1、S2、S3 性能级别提供的吞吐量和存储选项。The following table compares the throughput and storage options available in single partition collections, partitioned collections, and S1, S2, S3 performance levels. 下面是“中国东部 2”区域的一个示例:Here is an example for China East 2 region:

分区集合Partitioned collection 单区集合Single partition collection S1S1 S2S2 S3S3
最大吞吐量Maximum throughput 无限制Unlimited 10K RU/s10K RU/s 250 RU/秒250 RU/s 1 K RU/秒1 K RU/s 2.5 K RU/秒2.5 K RU/s
最小吞吐量Minimum throughput 2.5 K RU/秒2.5 K RU/s 400 RU/s400 RU/s 250 RU/s250 RU/s 1 K RU/秒1 K RU/s 2.5 K RU/秒2.5 K RU/s
最大存储Maximum storage 无限制Unlimited 10 GB10 GB 10 GB10 GB 10 GB10 GB 10 GB10 GB

是 EA 客户吗?Are you an EA customer? 如果是,请参阅 如果我是 EA 客户,我会受到怎样的影响?If so, see How am I impacted if I'm an EA customer?

我需要做些什么才能确保不间断地访问我的数据?What do I need to do to ensure uninterrupted access to my data?

如果有 S1、S2 或 S3 集合,则应使用 .NET SDK 以编程方式将该集合迁移到单分区集合。If you have an S1, S2, or S3 collection, you should migrate the collection to a single partition collection programmatically by using the .NET SDK.

迁移后,集合会发生怎样的变化?How will my collection change after the migration?

如果有 S1 集合,可以将该集合迁移到吞吐量为 400 RU/秒的单分区集合。If you have an S1 collection, you can migrate them to a single partition collection with 400 RU/s throughput. 400 RU/s 是单区集合提供的最低吞吐量。400 RU/s is the lowest throughput available with single partition collections. 但是,单分区集合中 400 RU/秒吞吐量的费用大致与 S1 集合中 250 RU/秒吞吐量的费用相同 - 因此,不需要为提供的额外 150 RU/秒付费。However, the cost for 400 RU/s in a single partition collection is approximately the same as you were paying with your S1 collection and 250 RU/s - so you are not paying for the extra 150 RU/s available to you.

如果有 S2 集合,可以将该集合迁移到吞吐量为 1000 RU/秒的单分区集合。If you have an S2 collection, you can migrate them to a single partition collection with 1 K RU/s. 吞吐量级别没有可见变化。You will see no change to your throughput level.

如果有 S3 集合,可以将该集合迁移到吞吐量为 2500 RU/秒的单分区集合。If you have an S3 collection, you can migrate them to a single partition collection with 2.5 K RU/s. 吞吐量级别没有可见变化。You will see no change to your throughput level.

对于上面的每种情况,在迁移集合后,便可以根据需要自定义吞吐量级别,或者将它调高和调低,以便向用户提供低延迟的访问。In each of these cases, after you migrate the collection, you will be able to customize your throughput level, or scale it up and down as needed to provide low-latency access to your users.

如果需要 10 GB 以上的存储,应该怎么做?What if I need more than 10 GB of storage?

无论使用的是 S1、S2 或 S3 性能级别的集合还是单分区集合,它们的可用存储都是 10 GB。可以使用 Azure Cosmos DB 数据迁移工具将数据迁移到分区集合,它们的存储空间几乎无限。Whether you have a collection with S1, S2, or S3 performance level, or have a single partition collection, all of which have 10 GB of storage available, you can use the Azure Cosmos DB Data Migration tool to migrate your data to a partitioned collection with virtually unlimited storage. 有关分区集合优势的信息,请参阅 Azure Cosmos DB 中的分区和缩放For information about the benefits of a partitioned collection, see Partitioning and scaling in Azure Cosmos DB.

在计划的迁移期限之前,是否可以在 S1、S2 和 S3 性能级别之间切换?Can I change between the S1, S2, and S3 performance levels before the planned migration?

只有使用 S1、S2 和 S3 性能的现有帐户才能使用 .NET SDK 以编程方式切换和更改性能级别层。Only existing accounts with S1, S2, and S3 performance can be changed and alter performance level tiers programmatically by using the .NET SDK. 如果从 S1、S3 或 S3 切换到了单区集合,则无法恢复到 S1、S2 或 S3 性能级别。If you change from S1, S3, or S3 to a single partition collection, you cannot return to the S1, S2, or S3 performance levels.

如何自行从 S1、S2、S3 性能级别迁移到单区集合?How do I migrate from the S1, S2, S3 performance levels to single partition collections on my own?

可以使用 .NET SDK 以编程方式从 S1、S2 和 S3 性能级别迁移到单分区集合。You can migrate from the S1, S2, and S3 performance levels to single partition collections programmatically by using the .NET SDK. 可以在计划的迁移期限之前自行执行此操作,即可享用单分区集合提供的灵活吞吐量选项。You can do this on your own before the planned migration to benefit from the flexible throughput options available with single partition collections.

使用 .NET SDK 迁移到单分区集合Migrate to single partition collections by using the .NET SDK

本部分只介绍了使用 SQL .NET API 更改集合的性能级别,但对于我们的其他 SDK,过程也是相似的。This section only covers changing a collection's performance level using the SQL .NET API, but the process is similar for our other SDKs.

以下代码片段可将集合吞吐量更改为每秒 5,000 个请求单位:Here is a code snippet for changing the collection throughput to 5,000 request units per second:

    //Fetch the resource to be updated
    Offer offer = client.CreateOfferQuery()
                      .Where(r => r.ResourceLink == collection.SelfLink)    
                      .AsEnumerable()
                      .SingleOrDefault();

    // Set the throughput to 5000 request units per second
    offer = new OfferV2(offer, 5000);

    //Now persist these changes to the database by replacing the original resource
    await client.ReplaceOfferAsync(offer);

请访问 MSDN 以查看其他示例并了解更多有关服务方法的信息:Visit MSDN to view additional examples and learn more about our offer methods:

EA 客户会受到怎样的影响?How am I impacted if I'm an EA customer?

EA 客户在当前合同到期之前,价格将受到保护。EA customers will be price protected until the end of their current contract.

后续步骤Next steps

若要了解更多有关 Azure Cosmos DB 的定价和管理数据的信息,请浏览以下资源:To learn more about pricing and managing data with Azure Cosmos DB, explore these resources:

  1. 对 Cosmos DB 中的数据进行分区Partitioning data in Cosmos DB. 了解单区容器与分区容器的差异,以及有关实施分区策略以进行无缝缩放的提示。Understand the difference between single partition container and partitioned containers, as well as tips on implementing a partitioning strategy to scale seamlessly.
  2. Cosmos DB 定价Cosmos DB pricing. 了解预配吞吐量和使用存储的费用。Learn about the cost of provisioning throughput and consuming storage.
  3. 请求单位Request units. 了解不同操作类型(例如读取、写入和查询)的吞吐量消耗。Understand the consumption of throughput for different operation types, for example Read, Write, Query.