Replicate Azure Cosmos DB for PostgreSQL into different resource group than primary cluster

James Sampica 0 Reputation points
2024-10-25T21:38:09.1233333+00:00

On it states...
https://video2.skills-academy.com/en-us/azure/cosmos-db/postgresql/concepts-read-replicas

Cross-region replication Read replicas can be created in the region of the primary cluster, or in any other region supported by Azure Cosmos DB for PostgreSQL. The limit of five replicas per cluster counts across all regions, meaning five total, not five per region.

Two problem scenarios for DR are as follows... If my resource group in West US is accidentally deleted my primary cluster as well as all of my replicas are also deleted without any ability to recover. Another DR scenario is West US goes down which since the resource group will also be impacted this will limit the ability to make the East US replica a primary cluster.

Replicas can be in different regions but there does not appear to be a a way to have the replica sit in a the same resource group as the region it is in. When we go to add a replica, the resource group is already chosen. Is there a way to select a different resource group? How do we design for this?

Thank you

User's image

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,659 questions
Azure Database for PostgreSQL
{count} votes

1 answer

Sort by: Most helpful
  1. Sai Raghunadh M 820 Reputation points Microsoft Vendor
    2024-10-26T04:05:28.21+00:00

    Hi @James Sampica,

    Thanks for the question and using MS Q&A platform

    As you've noted, replicas are created in the same resource group as the primary cluster, and there’s no option to select a different resource group during the replica creation process.

    Consider designing your architecture to use multiple resource groups for your primary and replicas. This could involve creating the primary cluster in one resource group and managing replicas in different resource groups. However, this might require additional overhead in managing the clusters.

    Accidental Deletion of Resource Group:

    Use Azure resource locks on your primary resource group to stop it from being accidentally deleted. This will help keep your clusters and resources safe from unwanted changes.

    Also, make sure to regularly back up your database. This way, if needed, you can restore it in another resource group.

    Regional Outage:

    In the event of a West US region failure, the associated resource group would also be impacted, limiting the ability to promote an East US replica to primary.

    When creating read replicas, they must reside in the same resource group as the primary cluster. There’s no option to choose a different resource group during replica creation.

    Set up an independent primary cluster in a different region (e.g., East US) with its own resource group. This cluster can act as a DR solution, allowing you to maintain continuity if the West US cluster is compromised.

    Schedule regular backups of your primary cluster. This ensures that you can restore your data in a new primary cluster in a different resource group if needed.

    Consider creating additional replicas in other regions (like East US) as part of a broader strategy. While they’ll still be tied to the same resource group, having multiple replicas can help manage load and improve redundancy.

    Hope this helps. Do let us know if you any further queries. If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.