I have some doubts about implementing a multi-region architecture in azure, I am running my application currently in one region and I am saving some data in blob storage and others in the PostgreSQL database. I wanted to replicate my whole architecture in different regions to be near to other customers. So I will be using Traffic manager to route the traffic based on the source region, but when doing my research about the replica for databases and data storage I find that the replica is in read-only mode. So if want to have active/ active region architecture what should I do exactly?
Asked
Active
Viewed 1,151 times
1 Answers
1
Building a true active-active architecture with any relational database is tricky, since as you pointed out, all the replicas are read-only. There are a couple of avenues you can pursue:
- Can you switch to Cosmos DB? That would provide a true active-active architecture.
- If you have to stick with Postgres, you could still run your entire app active-active but write queries need to go cross-region. But you can (if you have control of your app code) still make use of local reads.
- If you are willing to rewrite your app quite a bit, while still staying with SQL, you can build an append-only data model with cross-region replicas and UNION'ed views across them (complicated stuff, we are currently building an example architecture for that but will take a bit longer).
You can explore general guidance about Mission-Critical workloads on Azure here. And there is a fully fledged reference implementation for active-active using Cosmos DB: https://github.com/Azure/Mission-Critical-Online

silent
- 14,494
- 4
- 46
- 86
-
thank you for your detailed answer. And for blob storage, is there any recommendation on this point? – Hkni Apr 07 '22 at 08:35
-
depends a lot on what data (and how often you write to blob). you might be ok with a RA-GZRS storage for low-write scenarios – silent Apr 07 '22 at 08:38
-
the reference implementation I linked about uses such a storage to store some product images in the sample app https://github.com/Azure/Mission-Critical-Online/blob/main/src/infra/workload/globalresources/storage.tf – silent Apr 07 '22 at 08:39
-
And is it truly needed to have an active-active architecture for my case, to replicate the whole architecture only to make the software reachable from other regions, is it possible to do it with active stand by regions architecture? – Hkni Apr 07 '22 at 08:40
-
well, that totally depends on your requirements ;) A true active-active of course comes with a certain price tag. Hence you usually do this when you have very high availability requirements. If you are ok with a) higher latency for some users and b) with a potential downtime when you need to failover, active-passive might be ok for your workload, too. – silent Apr 07 '22 at 08:48
-
Is it a good idea to use azure CDN with blob storage for multi-region architecture instead of RA-GZRS because it is read-only storage? – Hkni Apr 07 '22 at 10:51
-
I would definitely use CDN (or better: Azure Front Door) in front of your storage account. The reason to use RA-GRS is that even if the primary region goes down, CDN/Front Door are still able to at least read and serve the data, even before you fail over your storage – silent Apr 07 '22 at 11:49