Replication protects your data and preserves your application up-time in the event of transient hardware failures. To ensure durability and high availability, replication copies your data, either within the same data center, or to a second data center, depending on which replication option you choose.
Replication ensures that your storage account meets the Service-Level Agreement (SLA) for Storage even in the face of failures. If your data is replicated to a second data center, that also protects your data against a catastrophic failure in the primary location.
On Azure, you can select one of the following replication options when creating a storage account:
Read-Access Geo-Redundant Storage (RA-GRS) is the default option when you create a new storage account.
Here is a quick overview of the differences between LRS, ZRS, GRS, and RA-GRS:
|Data is replicated across multiple data centers.
|Data can be read from the secondary location as well as from the primary location.
|Number of copies of data maintained on separate nodes.
Locally Redundant Storage (LRS)
Locally Redundant Storage (LRS) replicates your data 3 times within a storage scale unit which is hosted in a data center in the same region in which you created your storage account.
A write request returns successfully only once it has been written to all 3 replicas. These 3 replicas each reside in separate Fault Domains (FD) and Upgrade Domains (UD) within one storage scale unit. A storage scale unit is a collection of racks of storage nodes.
Fault Domain (FD)
A fault domain is a group of nodes that represent a physical unit of failure and can be considered as nodes belonging to the same physical rack.
Update Domain (UD)
An upgrade domain is a group of nodes that are upgraded together during the process of a service upgrade (rollout).
The 3 replicas are spread across UDs and FDs within one storage scale unit to ensure that data is available even if hardware failure impacts a single rack or when nodes are upgraded during a rollout.
LRS is the lowest cost option and offers least durability compared to other options. In the event of a data center level disaster (fire, flooding etc.) all 3 replicas might be lost or unrecoverable.
To mitigate this risk, Geo Redundant Storage (GRS) is recommended for most applications.
LRS may still be desirable in certain scenarios:
- Provides highest maximum bandwidth of Azure Storage replication options.
- If your application stores data that can be easily reconstructed, you may opt for LRS.
- Some applications are restricted to replicating data only within a country due to data governance requirements. A paired region could be in another country; please see Azure regions for information on region pairs.
Zone-Redundant Storage (ZRS)
Zone-Redundant Storage (ZRS) replicates your data asynchronously across data centers within one or two regions in addition to storing 3 replicas similar to LRS, thus providing higher durability than LRS. Data stored in ZRS is durable even if the primary data center is unavailable or unrecoverable.
- ZRS is only available for block blobs in general purpose storage accounts, and is supported only in storage service versions 2014-02-14 and later.
- Since asynchronous replication involves a delay, in the event of a local disaster it is possible that changes that have not yet been replicated to the secondary will be lost if the data cannot be recovered from the primary.
- The replica may not be available until Microsoft initiates fail-over to the secondary.
- ZRS accounts cannot be converted later to LRS or GRS. Similarly, an existing LRS or GRS account cannot be converted to a ZRS account.
- ZRS accounts do not have metrics or logging capability.
Geo-Redundant Storage (GRS)
Geo-Redundant Storage (GRS) replicates your data to a secondary region that is hundreds of miles away from the primary region. If your storage account has GRS enabled, then your data is durable even in the case of a complete regional outage or a disaster in which the primary region is not recoverable.
For a storage account with GRS enabled, an update is first committed to the primary region, where it is replicated 3 times. Then the update is replicated asynchronously to the secondary region, where it is also replicated 3 times.
With GRS both the primary and secondary regions manage replicas across separate Fault Domains and Upgrade Domains within a storage scale unit as described with LRS.
- Since asynchronous replication involves a delay, in the event of a regional disaster it is possible that changes that have not yet been replicated to the secondary region will be lost if the data cannot be recovered from the primary region.
- The replica is not available unless Microsoft initiates fail-over to the secondary region.
- If an application wants to read from the secondary region the user should enable RA-GRS.
When you create a storage account, you select the primary region for the account. The secondary region is determined based on the primary region, and cannot be changed.
The following table shows the primary and secondary region pairings.
|North Central US
||South Central US
|South Central US
||North Central US
|US East 2
||US East 2
|South East Asia
||South East Asia
||South Central US
|US Gov Iowa
||US Gov Virginia
|US Gov Virginia
||US Gov Iowa
|West US 2
||West Central US
|West Central US
||West US 2
For up-to-date information about regions supported by Azure, see Azure Regions.
Read-Access Geo-Redundant Storage (RA-GRS)
Read-Access Geo-Redundant Storage (RA-GRS) maximizes availability for your storage account, by providing read-only access to the data in the secondary location, in addition to the replication across two regions provided by GRS.
When you enable read-only access to your data in the secondary region, your data is available on a secondary endpoint, in addition to the primary endpoint for your storage account. The secondary endpoint is similar to the primary endpoint, but appends the suffix
–secondary to the account name.
For example, if your primary endpoint for the Blob service is
myaccount.blob.core.windows.net, then your secondary endpoint is
myaccount-secondary.blob.core.windows.net. The access keys for your storage account are the same for both the primary and secondary endpoints.
- Your application has to manage which endpoint it is interacting with when using RA-GRS.
- RA-GRS is intended for high-availability purposes. For scalability guidance, please review the performance checklist.