Hosting Web Applications on Google Cloud: An Overview

Get Cooking in Cloud

Introduction

“Get Cooking in Cloud” is a blog and video series to help enterprises and developers build business solutions on Google Cloud. In this series we plan on identifying specific topics that developers are looking to architect on Google cloud. Once identified we will create a mini series on that topic.

In this first mini series we will cover, how to create websites on Google Cloud. If your business revenue and customer satisfaction depends on the availability and scalability of your website, then you are at the right place. In the next few blogs, we will elaborate on creating websites:

  1. Hosting web apps on Google Cloud: An Overview (This article)
  2. Hosting a web app on Google Cloud using Google Cloud Storage
  3. Hosting a web app on Google Cloud using Cloud Run
  4. 5 Steps to deploy websites on Google Cloud using Google Compute Engine
  5. Scaling web app on Google Compute Engine
  6. Case Study

In this article, we will see four tools that help you scale from small to large website, depending on the needs. So, read on!

What you’ll learn

  • Overview of different ways to create websites on Google Cloud

Prerequisites

  • Basic concepts and constructs of Google Cloud so you can recognize the names of the products.
  • This picture (by Greg Wilson) is a good place to start and learn about all the products in less than four words:
Google Cloud Developers Cheat Sheet

Check out the video

How to create websites on Google Cloud

At a high level, there are four recipes to build a website or an application on Google Cloud. Depending on where you are in your Google Cloud journey, your business needs, and the maturity of the development and infrastructure team, one of these options should fit your needs.

Google Cloud Storage

Static websites are a good option for sites like blogs — where the page rarely changes after it has been published, or where there isn’t any dynamically-generated content. All you need to set up a static website on Google Cloud is a cloud storage bucket connected to your domain name and that’s it!!

As your business starts to mature and customers are interested in buying things from your website, you might need to generate dynamic content and enable payments. But if your company is still small, you want to be able to grow your website without worrying about scaling the website based on the increase in demand.

App Engine

In such a scenario, Google Cloud’s managed and serverless offerings like App Engine or Cloud Run would be apt, this allows you to focus on delivering features and let Google worry about operating and managing the infrastructure.This provides a wide range of features that make scalability, load balancing, logging, monitoring, and security much easier than if you had to build and manage the website yourself.

Cloud Run

When you use Cloud Run, you can code in any programming language, because your application is deployed as a container, and Google will seamlessly launch and scale your application for you. So give it a try!

For websites with higher complexity, you probably want more options and control than a managed platform offers. Whether it’s configuring your servers or virtual machines, or if it’s a need for specific memory, SSDs, and GPUs, it makes sense to use Compute Engine.

Compute Engine

Compute Engine provides a robust computing infrastructure, but you must choose and configure the platform components that you want to use. Google ensures that resources are available, reliable, and ready for you to use, but it’s up to you to provision and manage them.

The advantage of using compute engine is that you have complete control of the systems and unlimited flexibility. The easiest way to deploy a complete web-serving stack on Compute engine is by using Google Cloud Marketplace. With just a few clicks, you can deploy any of over 100 fully-realized solutions.

Google Cloud Marketplace

For a more detailed explanation of how to set up Compute engine to serve scalable and resilient websites, stay tuned for upcoming articles.

Kubernetes Engine

Finally, for a larger business with more developers and more complicated problems, it makes sense to containerize your application. You will notice that it becomes really hard to manage feature roll outs if the website is one big monolith, which makes it difficult to keep up with the increase in demand and pace of business.

Containerizing web applications provides three key advantages:

  • Componentization: As your app’s design becomes more complex, containers are a good fit for a service-oriented architecture, including microservices. This supports scalability.
  • Portability: A container has everything it needs to run — your app and its dependencies are bundled together. this facilitates portability and fixes the “it-works-on-my-machine” problem that many developers have.
  • Rapid deployment: When it’s time to deploy, your system is built from a set of definitions and images, so the parts can be deployed quickly, reliably, and automatically. Compared to virtual machines, Containers are typically smaller and deploy much more quickly.

Using Container to deploy web apps on GKE has further advantages because:

  1. Container orchestration is built in.
  2. Google Cloud offers container registry which is a private storage for container images
  3. You can easily use the other components of the Google Cloud platform in this architecture.

Using Kubernetes Engine makes sense in following situations:

  • If you have a complicated website with multiple different pieces which are better off in separate services for easy management.
  • If there are separate development teams for each service so teams can work independently at their own pace.
  • If you need to ship changes quickly and easily.

Conclusion

Whether you are a small blogger looking to grow your community, or a huge, multi-scale eCommerce site, hopefully this has been helpful in identifying which tools within the Google Cloud Platform are right for your specific web use case.

Next steps

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store