Skip to main content

Windows Azure Storage and Read-Access Geo Redundant Feature

The end this year brought to me a great news. Azure team announced that we have support for Read Access of Geo Redundant Storage.
Until now, we could activate geo redundant feature, that guaranty us that all the content would be duplicated to another data center and in case of a disaster, Azure would be able to recover our content from the storage. But until the recovery would be made and so on we would not be able to access the content until the cluster failover storage recovery mechanism would be triggered.
Read Access of Geo Redundant Storage is a long and complicate name. But more important than name is what the feature offer to us. From now, if we activate it and the data center used by to store our data goes down, we will be able to use the second one (that is used for geo-redundancy) to access our content. We’ll not be able to write content, but we can read content for it – in read only mode. For application that store updates, configuration or resources this is a crucial thing.
Activating this feature is very simple. Additionally to Locally Redundant and Geo Redundant we have a new option called Read Access Geo-Redundancy (RA-GRS). We need to switch to this 3rd options and we are ready to go.

What other things we should know?
First of all, you should know that you cannot control what the secondary location is for RA-GRS. The same thing happen for Geo Redundant feature. There is a list of predefined data centers that are paired (usually the paired one is on the same continent).
Once you activate this feature, you can access it using “fooAccount-secondary…”. “-secondary” is the key world in this case. The accounts keys are the same as for the primary account. Basically all the access rules and keys are duplicated from the primary account to the secondary account.
The switching between the primary accounts to the secondary account is made automatically when a failover action is triggered by the “matrix”. In that moment all the DNS are updated from the primary account to the second one.  Based on this pattern we don’t need to change from our application the storage URL. When the storage from the primary node will be recover the DNS will be updated again. If you want you could do this from the code because you know the address of the secondary account – but be aware you will respond this actions and take into account the synchronization latency.
All the request of type add/update/delete on the second node will trigger a 403 error code.
We have a field in our storage services that tell us when the last synchronization was made. This field is called “Last Sync Time”.

Specific API
On the second account we have a service API that can be used to get the “Last Sync Time” and find the status of the replication action. The API is called “GetServiceStats()” and can be used for all storage services (Table, Queue and Blob). The response of this service will contain the last sync time and the status of geo-replication. The status can be:

  • Live 
  • Bootstrap – initialize phase, when we change the replication option we can have this status
  • Unavailable – last sync time cannot be calculated because a problem occurred

Also you will notice that there are new metrics that provide us information related to the transaction and synchronization status.
When we are in C#, we can switch the storage client between the primary and the secondary one very easily by changing the value of “LocationMode” property to “LocationMode.SecondaryOnly”. When you are make this switch you will hit and use the secondary storage. This is pretty cool, we don’t need to edit the connection string by our self (10+). If you want to execute write actions on the secondary account a Storage Exception will be throw.
This enum has another 2 values available:

  • PrimaryOnly – all the actions/requests are made only on the first one
  • PrimaryThenSecondary – by default actions/requests hit the primary account. If something happen with him (404) than all the read requests are redirected to the secondary one
  • SecondaryOnly – (already presented) the read request are redirected to the second account

From the cost perceive we will pay for all the storage that we used on the secondary account and all the transactions that are made between this two storage.
Don’t forget that this feature is in preview for now and you need to sign in for the preview using the following link https://account.windowsazure.com/PreviewFeatures.
In the next post we will see how we can set the retry policy in a way that the secondary account will be used when we set the location mode property to “PrimaryThenSecondary”.

Comments

Popular posts from this blog

Why Database Modernization Matters for AI

  When companies transition to the cloud, they typically begin with applications and virtual machines, which is often the easier part of the process. The actual complexity arises later when databases are moved. To save time and effort, cloud adoption is more of a cloud migration in an IaaS manner, fulfilling current, but not future needs. Even organisations that are already in the cloud find that their databases, although “migrated,” are not genuinely modernised. This disparity becomes particularly evident when they begin to explore AI technologies. Understanding Modernisation Beyond Migration Database modernisation is distinct from merely relocating an outdated database to Azure. It's about making your data layer ready for future needs, like automation, real-time analytics, and AI capabilities. AI needs high throughput, which can be achieved using native DB cloud capabilities. When your database runs in a traditional setup (even hosted in the cloud), in that case, you will enc...

How to audit an Azure Cosmos DB

In this post, we will talk about how we can audit an Azure Cosmos DB database. Before jumping into the problem let us define the business requirement: As an Administrator I want to be able to audit all changes that were done to specific collection inside my Azure Cosmos DB. The requirement is simple, but can be a little tricky to implement fully. First of all when you are using Azure Cosmos DB or any other storage solution there are 99% odds that you’ll have more than one system that writes data to it. This means that you have or not have control on the systems that are doing any create/update/delete operations. Solution 1: Diagnostic Logs Cosmos DB allows us activate diagnostics logs and stream the output a storage account for achieving to other systems like Event Hub or Log Analytics. This would allow us to have information related to who, when, what, response code and how the access operation to our Cosmos DB was done. Beside this there is a field that specifies what was th...

[Post Event] Azure AI Connect, March 2025

On March 13th, I had the opportunity to speak at Azure AI Connect about modern AI architectures.  My session focused on the importance of modernizing cloud systems to efficiently handle the increasing payload generated by AI.