地理复制和流量路由 Azure 托管的 ASP .Net 5 站点和支持跨大陆的 SQL 数据库

Geo-replicating and traffic routing an Azure hosted ASP .Net 5 site and backing SQL database across continents

我已经建立了一个 ASP .Net 5 网站和 Web API 以及支持 SQL 数据库的模式。我现在想超越测试并将它们部署到 Azure。我想在各大洲复制整个服务(ASP 和 SQL),以便在美国使用我们的应用程序的人被路由到美国的服务器,在欧洲使用我们的应用程序的用户被路由到到欧洲等地的服务器,然后某些东西将使不同大陆的数据库副本保持同步。

我找不到有关如何执行此操作的文档。我找到了有关在 Azure 中异地复制 SQL 服务器的文档,但这是针对那些想要在另一个位置安全地备份数据(例如,灾难恢复)的人,而我需要多个实时位置在每个地方接受 CRUD。

我该怎么做?如何使数据库保持同步以及如何将流量从应用路由到最近的 Azure 服务副本?

(N.B。我不确定归结为请求查找文档的问题是否符合 Stack Overflow 的条件,如果这里不受欢迎,我们深表歉意。)

我的文章 Design an application for cloud disaster recovery using geo-replication in SQL Database 应该有所帮助。

在这篇文章中,我看到了灾难恢复的三种设计模式:

  1. 使用并置数据库的云灾难恢复主动-被动部署
  2. 应用负载均衡的双活部署
  3. 用于数据保存的主动-被动部署

其中第二个涵盖了您的场景。

本文中的一段概述了该模式。

In this pattern, the application switches to read-only mode when connected to the secondary database. The application logic in the primary region is colocated with the primary database and operates in read-write mode (RW), the application logic in the secondary region is colocated with the secondary database and is ready to operate in read-only mode (RO). Traffic manager should be set up to use failover routing with end-point monitoring enabled for both application instances.

这里有一张图表,总结了如果您遵循本文中的建议,您最终会得到的架构。

my article 中有更多详细信息;如果您还有其他问题,请随时 post,我会跟进。