Deploying an application on a global scale

Running your application on global scale is now much more easier than ever before, here i go through one scenario how to achieve this.

Building and deploying an application on a global scale is now easier than ever. Using the cloud you can easily have your application running close to the customers no matter where they are located.

There are some things to take into consideration when planning and building a deployment. In this post I am using Microsoft Azure service offering as an example but at least Amazon Web Services and Google Cloud Platform have similar services available.

As with real estate, most important thing is location, location, location.

Your end user location defines which cloud to use and where to push applications. China is a totally different game compared to running everything in EU/US area.

Make sure that your application is built to scale from the start, for example DB should be something that is geo-replicated. SQL or Cosmos DB on Azure.

Once you have mapped the regions where an application will be mostly used you can start planning the deployment process.

Traffic manager for geo-balancer

Use the Azure traffic manager to route incoming requests into the nearest region to get the lowest latency from application to end users. Also, with this design if one region is having an outage, the nearest one will continue to serve the customers. Also make sure you put different regions into separate resource groups as this lets you manage each region as a single collection.

Failover can be done with a Traffic manager health probe, which probes the application and checks the health of app services, storage and DB. Make sure you follow design patterns on the health probe so that some lower priority outages don’t mark the whole regions as unavailable.

Traffic manager also supports several routing methods, and, in this case, we would be using Geographic as we want to use location as deciding factor where to route traffic.

Multiregion deployment needs some extra attention

For storage, the best option is to use Read-access geo-redundant storage (RA-GRS) as this gives best replication options for this use case. But there are some caveats to consider when using this option. For example, if there is a zone wide outage then there is a short time period when the data is in a read-only model until the failover happens from region to region.

Deploying an application into a single region is pretty straightforward. But as we are planning to do a multi-region deployment, we should deploy the application into multiple regions in an automated fashion. If you are using Azure DevOps, all you have to do is make several deployment slots to push the application into different regions.

This article covered just one scenario about what to consider when deploying an application to the cloud. When you build your application to be cloud capable from day one, the more benefits the cloud can offer. Don’t let the old ways hold you back. Explore and test different workloads, try containers and see how easy it is to have a true scaling and build deployment pipelines in the cloud.