您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

使用 Azure Cosmos DB 在全球范围内分发数据 - 概述Global data distribution with Azure Cosmos DB - overview

如今的应用程序需要具备高响应能力并始终联机。Today’s applications are required to be highly responsive and always online. 若要实现低延迟和高可用性,需要在靠近用户的数据中心部署这些应用程序的实例。To achieve low latency and high availability, instances of these applications need to be deployed in datacenters that are close to their users. 这些应用程序通常部署在多个数据中心,称为全球分布式应用程序。These applications are typically deployed in multiple datacenters and are called globally distributed. 全球分布式应用程序需要全球分布式数据库,以便在全球范围内以透明方式复制数据,从而确保应用程序能在靠近用户的数据副本上执行操作。Globally distributed applications need a globally distributed database that can transparently replicate the data anywhere in the world to enable the applications to operate on a copy of the data that's close to its users.

Azure Cosmos DB 是一个全局分布式数据库服务,旨在提供低延迟、吞吐量弹性缩放和明确定义的语义,以实现数据一致性和高可用性。Azure Cosmos DB is a globally distributed database service that's designed to provide low latency, elastic scalability of throughput, well-defined semantics for data consistency, and high availability. 简而言之, 如果你的应用程序需要在世界各地的任何地方保证快速响应时间, 则如果要求始终处于联机状态, 并且需要吞吐量和存储的无限制和弹性可伸缩性, 则应 Azure Cosmos DB 上生成应用程序。In short, if your application needs guaranteed fast response time anywhere in the world, if it's required to be always online, and needs unlimited and elastic scalability of throughput and storage, you should build your application on Azure Cosmos DB.

可将数据库配置为全局分布,并使其可在任何 Azure 区域中使用。You can configure your databases to be globally distributed and available in any of the Azure regions. 为了降低延迟,请将数据放置在更靠近用户的位置。To lower the latency, place the data close to where your users are. 选择所需的区域数目取决于应用程序的全球覆盖范围以及用户所处的位置。Choosing the required regions depends on the global reach of your application and where your users are located. Cosmos DB 以透明方式将数据复制到与 Cosmos 帐户关联的所有区域。Cosmos DB transparently replicates the data to all the regions associated with your Cosmos account. 它提供全局分布式 Azure Cosmos 数据库和容器的单个系统映像,使应用程序能够在本地读取和写入。It provides a single system image of your globally distributed Azure Cosmos database and containers that your application can read and write to locally.

使用 Azure Cosmos DB 可以随时添加或删除与帐户关联的区域。With Azure Cosmos DB, you can add or remove the regions associated with your account at any time. 无需暂停或重新部署应用程序即可添加或删除区域。Your application doesn't need to be paused or redeployed to add or remove a region. 得益于该服务原生提供的多宿主功能,它始终都能保持高可用性。It continues to be highly available all the time because of the multi-homing capabilities that the service natively provides.

高度可用的部署拓扑

全局分布的重要优势Key benefits of global distribution

生成全局主动 - 主动应用。Build global active-active apps. 使用新式多主数据库复制协议,每个区域都支持写入和读取。With its novel multi-master replication protocol, every region supports both writes and reads. 多主数据库功能还可以实现:The multi-master capability also enables:

  • 无限弹性写入和读取可伸缩性。Unlimited elastic write and read scalability.
  • 在全球 99.999% 的读写可用性。99.999% read and write availability all around the world.
  • 在 99% 的时间内,在 10 毫秒内为读写提供服务。Guaranteed reads and writes served in less than 10 milliseconds at the 99th percentile.

使用 Azure Cosmos DB 的多宿主 API,应用程序始终知道最靠近的区域并将请求发送到该区域。By using the Azure Cosmos DB multi-homing APIs, your application is aware of the nearest region and can send requests to that region. 无需进行任何配置更改就能识别最靠近的区域。The nearest region is identified without any configuration changes. 在 Azure Cosmos 帐户中添加和删除区域时,无需重新部署或暂停应用程序,它始终会保持高可用性。As you add and remove regions to and from your Azure Cosmos account, your application does not need to be redeployed or paused, it continues to be highly available at all times.

生成高响应能力的应用。Build highly responsive apps. 应用程序可以在为数据库选择的所有区域中执行近乎实时的读写。Your application can perform near real-time reads and writes against all the regions you chose for your database. Azure Cosmos DB 在内部处理区域之间的数据复制,并保证提供所选的一致性级别。Azure Cosmos DB internally handles the data replication between regions with consistency level guarantees of the level you've selected.

生成高度可用的应用。Build highly available apps. 在世界各地的多个区域中运行数据库可提高数据库的可用性。Running a database in multiple regions worldwide increases the availability of a database. 如果一个区域不可用,其他区域可自动处理应用程序请求。If one region is unavailable, other regions automatically handle application requests. Azure Cosmos DB 为多区域数据库提供 99.999% 的读取和写入可用性。Azure Cosmos DB offers 99.999% read and write availability for multi-region databases.

在区域性中断期间保持业务连续性。Maintain business continuity during regional outages. Azure Cosmos DB 支持在区域性中断期间进行自动故障转移Azure Cosmos DB supports automatic failover during a regional outage. 在区域性中断期间,Azure Cosmos DB 会继续维持其延迟、可用性、一致性和吞吐量方面的 SLA。During a regional outage, Azure Cosmos DB continues to maintain its latency, availability, consistency, and throughput SLAs. 为帮助确保整个应用程序高度可用,Cosmos DB 提供手动故障转移 API 来模拟区域性中断。To help make sure that your entire application is highly available, Cosmos DB offers a manual failover API to simulate a regional outage. 使用此 API 可以执行常规业务连续性演练。By using this API, you can carry out regular business continuity drills.

全局缩放读写吞吐量。Scale read and write throughput globally. 可以使每个区域都可写, 并在世界各地弹性缩放读取和写入。You can enable every region to be writable and elastically scale reads and writes all around the world. 保证应用程序针对 Azure Cosmos 数据库或容器配置的吞吐量可在与 Azure Cosmos 帐户关联的所有区域中实现。The throughput that your application configures on an Azure Cosmos database or a container is guaranteed to be delivered across all regions associated with your Azure Cosmos account. 预配的吞吐量有 SLA 的资金保障The provisioned throughput is guaranteed up by financially backed SLAs.

从多个明确定义的一致性模型中进行选择。Choose from several well-defined consistency models. Azure Cosmos 数据库复制协议提供了五种明确定义、实用且直观的一致性模型。The Azure Cosmos DB replication protocol offers five well-defined, practical, and intuitive consistency models. 每个模型在一致性与性能之间进行了权衡。Each model has a tradeoff between consistency and performance. 使用这些一致性模型可轻松生成全球分布式应用程序。Use these consistency models to build globally distributed applications with ease.

后续步骤Next steps

阅读以下文章详细了解全局分布:Read more about global distribution in the following articles: