Amazon DocumentDB 集群存储配置 - Amazon DocumentDB

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

Amazon DocumentDB 集群存储配置

从 Amazon DocumentDB 5.0 开始,基于实例的集群支持两种存储配置类型:

  • 亚马逊 DocumentDB 标准存储:专为低至中度 I/O 消耗的客户而设计。如果您预计 I/O 成本将低于亚马逊文档数据库集群总量的 25%,那么此选择可能非常适合您。使用 Amazon DocumentDB 标准存储配置,除了实例费用和存储费用外,您还需要 pay-per-request I/O 按比例计费。这意味着您的账单可能会根据周期和使用量有所不同。该配置经过量身定制,可适应您的应用不断变 I/O 化的需求。

  • Amazon DocumentDB I/O 优化存储:专为优先考虑价格可预测性或拥有密集型应用程序的客户而设计。 I/O 运I/O-optimized configuration offers improved performance, increased throughput, and reduced latency for customers with I/O intensive workloads. If you expect your I/O costs to exceed 25% of your total Amazon DocumentDB cluster costs, this option offers enhanced price performance. With the Amazon DocumentDB I/O-optimized storage configuration, you won't be charged based on I/O营,确保每个计费周期的成本可预测。该配置可以稳定成本,同时改善性能。

您可以每 30 天将现有数据库集群切换到 Amazon DocumentDB。I/O-optimized storage. You can switch back to Amazon DocumentDB standard storage at any time. The next date to modify the storage configuration to I/O经过优化的可以通过集群配置页面 AWS Management Console 中的describe-db-clusters命令使用 AWS CLI 或进行跟踪。

您可以创建包含 Amazon DocumentDB I/O 优化配置的新数据库集群,也可以通过点击几下AWS Management Console、在 AWS Command Line Interface (AWS CLI) 中更改单个参数或通过以下方式转换现有数据库集群。AWS SDKs在修改存储配置期间或修改之后,无需停机或重启实例。

图片:Amazon DocumentDB 标准存储和优化存储差异表。

创建 I/O 优化集群

Using the AWS Management Console

要使用以下方法创建或修改 I/O 优化的集群,请执行以下操作: AWS Management Console

  1. 在 Amazon DocumentDB 管理控制台的集群下,选择创建或选择集群,再选择操作,然后选择修改

  2. 如果要创建新集群,请确保在 “集群类型” 部分中选择 “基于实例的集群”(这是默认选项)。

    图片:含有集群类型选项的控制台屏幕截图。
  3. 配置部分的集群存储配置下,选择亚马逊 DocumentDB I/O 优化。

    图片:含有集群存储配置选项的控制台屏幕截图。
  4. 完成集群的创建或修改,并选择创建集群修改集群

    有关创建集群的完整流程,请参阅 使用创建集群和主实例 AWS Management Console

    有关修改集群的完整流程,请参阅 修改 Amazon DocumentDB 集群

Using the AWS CLI

要使用以下方法创建 I/O 优化的集群,请执行以下操作: AWS CLI

在以下示例中,用您自己的信息替换每个user input placeholder示例。

对于 Linux、macOS 或 Unix:

aws docdb create-db-cluster \ --db-cluster-identifier sample-cluster \ --engine docdb \ --engine-version 5.0.0 \ --storage-type iopt1 \ --deletion-protection \ --master-username username \ --master-user-password password

对于 Windows:

aws docdb create-db-cluster ^ --db-cluster-identifier sample-cluster ^ --engine docdb ^ --engine-version 5.0.0 ^ --storage-type iopt1 ^ --deletion-protection ^ --master-username username ^ --master-user-password password

确定存储配置的成本分析

借助 Amazon DocumentDB,您可以灵活地为自己拥有的每个数据库集群选择存储配置。为了在标准集群和 I/O 优化集群之间正确分配集群,可以按集群跟踪 Amazon DocumentDB 成本。为此,您可以向现有集群添加标签,在 AWS 账单与成本管理 控制面板中启用成本分配标签,并在 AWS Cost Explorer Service 中分析给定集群的成本。有关成本分析的信息,请参阅博客“使用成本分配标签”。