Hot Disaster Recovery for Applications on Google Cloud

Get Cooking in Cloud

Priyanka Vergadia
Google Cloud - Community
4 min readJan 7, 2020

--

Introduction

Get Cooking in Cloud is a blog and video series to help enterprises and developers build business solutions on Google Cloud. In this second miniseries I am covering Disaster Recovery on Google Cloud. Disasters can be pretty hard to deal with when you have an online presence. In the these articles, we will elaborate on how to deal with disasters like earthquakes, power outages, floods, fires etc.

Here is the plan for the series.

  1. Disaster Recovery Overview
  2. Cold Disaster recovery on Google Cloud for on-premise applications
  3. Warm Disaster recovery on Google Cloud for on-premise applications
  4. Hot Disaster recovery on Google Cloud for on-premise applications
  5. Cold Disaster recovery for applications in Google Cloud
  6. Warm Disaster recovery for applications in Google Cloud
  7. Hot Disaster recovery for applications in Google Cloud (This article)
  8. Disaster recovery on Google Cloud for Data: Part 1
  9. Disaster recovery on Google Cloud for Data: Part 2

In this article, you will learn to set up a Hot DR pattern for the applications that are deployed on Google Cloud. So, read on!

What you’ll learn

  • Hot DR pattern for Google Cloud applications, with an example
  • Steps to be taken before a disaster hits
  • Steps to be taken during a disaster
  • Steps to be taken after a disaster

Prerequisites

  • Basic concepts and constructs of Google Cloud so you can recognize the names of the products.
  • Read the overview article for DR related definitions.

Check out the video

Hot DR on Google Cloud

Let’s learn Hot DR pattern with an example

We met Mane-Street-Art in the previous article but now they’ve become really popular and acquired a huge and global customer base which requires them to be online all the time without fail. So we will help them set up a Hot DR pattern with next-to-no downtime.

Mane-Street-Art went global

Mane-street-art has a unique advantage, since they are deploying their production application on Google cloud they can take full advantage of the built-in High Availability (HA) features.

Note: If you are unfamiliar with the terms used here (RTO, RPO, DR Patterns) checkout the previous blog to get an overview.

In any DR pattern you need to understand what steps need to be taken before, during and after a disaster.

Hot DR Pattern — How does it work?

Steps to be taken before disaster hits

  • They would have to Create a VPC network
  • Create a custom image that’s configured with the application service.
  • Use that image to create an instance template.
Hot DR Pattern: Steps to be taken before disaster hits
  • Using this instance template, configure a regional managed instance group. This is to ensure resilience, if the whole zone was to go down, the instances will still be available in other region to keep the application running.
  • Make sure the HTTP and instance health checks are configured at the managed instance groups to verify that the services and instances are properly running within a group. This ensures that if a service on an instance fails, the group automatically re-creates that instance.
  • Configure load balancing using the managed instance group that spans across three zones.
  • Create CloudSQL in one zone as a master and enable a replica in another zone. Doing this means that in case the master becomes unavailable replica can be promoted to become the master.
  • Finally, configure the Cloud DNS to point at the primary application.
Hot DR Pattern: Steps to be taken before disaster hits

Steps to be taken when disaster hits

When a disaster hits, all Mane-street-art has to do, is to watch the system heal itself.

Steps to be taken after the disaster has passed

Since we built a self healing system with High Availability built in, there is not much to do during and after the disaster. The instances come and go as needed in different zones during the disaster.

Conclusion

If you are deploying an application on Google Cloud and have to meet those really low RTO and RPO values, like Mane-Street-Art, then use some of the built-in Google Cloud HA features. Stay tuned for upcoming articles, where you will learn to set up more DR for Data.

Next steps

--

--

Priyanka Vergadia
Google Cloud - Community

Developer Advocate @Google, Artist & Traveler! Twitter @pvergadia