Skip to main content

Configuring Storage Replication for Disaster Recovery

Learn to choose between LRS, ZRS, and GRS storage replication options based on the actual disaster recovery requirement.

Overview and What You Will Learn

In this lab, you will create Storage Accounts with different replication options, compare their guarantees directly, and understand exactly what each option protects against - so a disaster recovery decision is based on the actual failure scenario being protected against, not just picking the option with the most letters in its name.

Why This Matters in Production

A team at a fintech assumes their data is safe because "it's in the cloud," without checking what replication option their Storage Account actually uses. If that account uses only Locally Redundant Storage and the entire physical datacenter it lives in becomes unavailable, every copy of that data - all three of them - is unavailable at the same time, since all three copies live in the same building.

Core Principles

Azure Storage replication options differ in how many copies of your data exist and where those copies physically live.

◈ DIAGRAM
+------------------------------------------+
| LRS - Locally Redundant Storage |
| 3 copies, same datacenter |
| Protects against: single disk/node failure |
| Does NOT protect against: datacenter loss |
+------------------------------------------+
| ZRS - Zone-Redundant Storage |
| 3 copies, separate datacenters in the same |
| region |
| Protects against: single datacenter loss |
+------------------------------------------+
| GRS - Geo-Redundant Storage |
| LRS copies in primary region PLUS async |
| replicated copies in a secondary region |
| Protects against: entire region loss |
+------------------------------------------+

RA-GRS (Read-Access Geo-Redundant Storage) extends GRS by allowing read access to the secondary region's copy even while the primary region is healthy - useful for read scaling, not just disaster recovery.

Detailed Step-by-Step Practical Lab

  1. Create a Resource Group:
Bash
az group create --name rg-replication-lab-mumbai --location centralindia
  1. Create a Storage Account using LRS - the baseline, cheapest option:
Bash
az storage account create \
--name streplicationlrs \
--resource-group rg-replication-lab-mumbai \
--location centralindia \
--sku Standard_LRS
  1. Create a second Storage Account using ZRS, protecting against a single datacenter failure:
Bash
az storage account create \
--name streplicationzrs \
--resource-group rg-replication-lab-mumbai \
--location centralindia \
--sku Standard_ZRS
  1. Create a third Storage Account using GRS, adding a secondary region copy:
Bash
az storage account create \
--name streplicationgrs \
--resource-group rg-replication-lab-mumbai \
--location centralindia \
--sku Standard_GRS
  1. Compare the replication setting across all three accounts:
Bash
az storage account list \
--resource-group rg-replication-lab-mumbai \
--query "[].name" --output table
az storage account list \
--resource-group rg-replication-lab-mumbai \
--query "[].sku.name" --output table
  1. Check which secondary region GRS automatically paired with the primary region:
Bash
az storage account show \
--name streplicationgrs \
--resource-group rg-replication-lab-mumbai \
--query "secondaryLocation" --output tsv
Note

Azure automatically pairs each region with a specific secondary region for GRS replication - you do not choose the secondary region yourself, it is determined by which region your primary Storage Account is created in.

  1. Clean up:
Bash
az group delete --name rg-replication-lab-mumbai --yes --no-wait

Production Best Practices & Common Pitfalls

Common Mistake

Assuming LRS provides adequate disaster recovery because "there are three copies of the data." All three LRS copies live in the same physical datacenter - if that datacenter becomes unavailable, all three copies are unavailable simultaneously. LRS protects against hardware failure, not datacenter-level disasters.

Tip

Choose replication based on the actual failure scenario your business needs to survive, not by defaulting to the most expensive option "to be safe." An internal, easily-regenerated dataset may only need LRS; a critical financial record likely needs GRS or better.

  • GRS replication to the secondary region is asynchronous. During a real regional failure, there is a small window of the most recent writes that may not have replicated yet - GRS protects against total data loss, not against losing the very last few seconds of writes before a disaster.
  • RA-GRS adds read access to the secondary copy at extra cost. Only choose it if you specifically need to read from the secondary region during normal operation, not purely for the disaster recovery guarantee, which plain GRS already provides.

Quick Reference & Troubleshooting Commands

Command Description
az storage account create --sku Standard_LRS Create an account with local-only replication
az storage account create --sku Standard_ZRS Create an account replicated across datacenters in-region
az storage account create --sku Standard_GRS Create an account replicated to a secondary region
az storage account show --query "secondaryLocation" Check which secondary region GRS is paired with

Explore More in Azure Storage Solutions

All 6 Topics

Frequently Asked Questions

Is Configuring Storage Replication for Disaster Recovery free to learn on DevOps Network?

Yes - this topic, like everything on DevOps Network, is 100% free with no paywall or sign-up gate.

What does the Configuring Storage Replication for Disaster Recovery topic cover?

Learn to choose between LRS, ZRS, and GRS storage replication options based on the actual disaster recovery requirement.