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

399 views Asked by At

I have built an ASP .Net 5 website and web API and the schema for a backing SQL database. I now want to move beyond test and deploy them to Azure. I would like to replicate the entire service (ASP and SQL) across continents so that people who use our app in the USA are routed to servers in the USA, users who use our app in Europe are routed to servers in Europe, etc. then something would keep the different continent's copy of the database in sync.

I cannot find documentation on how to do this. I have found documentation on geo-replicating the SQL server in Azure, but that is aimed at people who want to back up their data securely in another location (for, for example, disaster recovery) whereas I need multiple live locations accepting CRUD at each place.

How do I do this? How do I keep the databases moving towards synchronisation and how do I route the traffic from the app to the nearest copy of the Azure service?

(N.B. I'm not sure that questions which boil down to requests to find documentation qualify for Stack Overflow, apologies if this is not welcome here.)

1

There are 1 answers

0
Alexander Nosov On BEST ANSWER

My article Design an application for cloud disaster recovery using geo-replication in SQL Database should help.

In the article I look at three design patterns for disaster recovery:

  1. Active-passive deployment for cloud disaster recovery with a colocated database
  2. Active-active deployment for application load balancing
  3. Active-passive deployment for data preservation

and it is the second of these that covers your scenario.

Here's a paragraph from the article that outlines the pattern.

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.

And here's a diagram summarising the architecture you will end up with if you follow the advice in the article.

Diagram showing traffic manager configured for performance routing

There's more detail in my article; if you have additional questions feel free to post and I will follow up.