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...

Cloud Myths: Migrating to the cloud is quick and easy (Pill 2 of 5 / Cloud Pills)

The idea that migration to the cloud is simple, straightforward and rapid is a wrong assumption. It’s a common misconception of business stakeholders that generates delays, budget overruns and technical dept. A migration requires laborious planning, technical expertise and a rigorous process.  Migrations, especially cloud migrations, are not one-size-fits-all journeys. One of the most critical steps is under evaluation, under budget and under consideration. The evaluation phase, where existing infrastructure, applications, database, network and the end-to-end estate are evaluated and mapped to a cloud strategy, is crucial to ensure the success of cloud migration. Additional factors such as security, compliance, and system dependencies increase the complexity of cloud migration.  A misconception regarding lift-and-shits is that they are fast and cheap. Moving applications to the cloud without changes does not provide the capability to optimise costs and performance, leading to ...

Cloud Myths: Cloud is Cheaper (Pill 1 of 5 / Cloud Pills)

Cloud Myths: Cloud is Cheaper (Pill 1 of 5 / Cloud Pills) The idea that moving to the cloud reduces the costs is a common misconception. The cloud infrastructure provides flexibility, scalability, and better CAPEX, but it does not guarantee lower costs without proper optimisation and management of the cloud services and infrastructure. Idle and unused resources, overprovisioning, oversize databases, and unnecessary data transfer can increase running costs. The regional pricing mode, multi-cloud complexity, and cost variety add extra complexity to the cost function. Cloud adoption without a cost governance strategy can result in unexpected expenses. Improper usage, combined with a pay-as-you-go model, can result in a nightmare for business stakeholders who cannot track and manage the monthly costs. Cloud-native services such as AI services, managed databases, and analytics platforms are powerful, provide out-of-the-shelve capabilities, and increase business agility and innovation. H...