透過 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. 透過其 novel 多宿主複寫通訊協定, 每個區域都支援寫入和讀取。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 DB 複寫通訊協定會提供五個定義完善、實用且直覺式的一致性模型。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: