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

Windows Docker Containers can make WIN32 API calls, use COM and ASP.NET WebForms

After the last post , I received two interesting questions related to Docker and Windows. People were interested if we do Win32 API calls from a Docker container and if there is support for COM. WIN32 Support To test calls to WIN32 API, let’s try to populate SYSTEM_INFO class. [StructLayout(LayoutKind.Sequential)] public struct SYSTEM_INFO { public uint dwOemId; public uint dwPageSize; public uint lpMinimumApplicationAddress; public uint lpMaximumApplicationAddress; public uint dwActiveProcessorMask; public uint dwNumberOfProcessors; public uint dwProcessorType; public uint dwAllocationGranularity; public uint dwProcessorLevel; public uint dwProcessorRevision; } ... [DllImport("kernel32")] static extern void GetSystemInfo(ref SYSTEM_INFO pSI); ... SYSTEM_INFO pSI = new SYSTEM_INFO(

ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded

Today blog post will be started with the following error when running DB tests on the CI machine: threw exception: System.InvalidOperationException: The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information. at System.Data.Entity.Infrastructure.DependencyResolution.ProviderServicesFactory.GetInstance(String providerTypeName, String providerInvariantName) This error happened only on the Continuous Integration machine. On the devs machines, everything has fine. The classic problem – on my machine it’s working. The CI has the following configuration: TeamCity .NET 4.51 EF 6.0.2 VS2013 It see

Navigating Cloud Strategy after Azure Central US Region Outage

 Looking back, July 19, 2024, was challenging for customers using Microsoft Azure or Windows machines. Two major outages affected customers using CrowdStrike Falcon or Microsoft Azure computation resources in the Central US. These two outages affected many people and put many businesses on pause for a few hours or even days. The overlap of these two issues was a nightmare for travellers. In addition to blue screens in the airport terminals, they could not get additional information from the airport website, airline personnel, or the support line because they were affected by the outage in the Central US region or the CrowdStrike outage.   But what happened in reality? A faulty CrowdStrike update affected Windows computers globally, from airports and healthcare to small businesses, affecting over 8.5m computers. Even if the Falson Sensor software defect was identified and a fix deployed shortly after, the recovery took longer. In parallel with CrowdStrike, Microsoft provided a too