Choosing the right compute option: VMs vs containers vs PaaS vs FaaSSyah Ismail
Are you thinking of building a web application but couldn’t decide on which of Google Cloud Platform (GCP) compute offerings? It is a very confusing situation to be in especially when you have four offerings to choose from – Google Compute Engine (VMs), Google Kubernetes Engine (containers), Google App Engine (PaaS), and Google Cloud Functions (FaaS).
Before deciding on the right choice for you, you need to think about these three things:
- Level of abstraction
- Technical requirements and constraints
- Where is your team and organisation going
Developers prefer to take advantage of the higher levels of compute abstraction ladder, as it allows them to focus on the application and the problem they are solving, while avoiding undifferentiated work such as server maintenance and capacity planning. With Cloud Functions, all you need to think about is code that runs in response to events. But depending on the details of the problem you are trying to solve, technical constraints can pull you down the stack.
GCP supports the Go, Java, .NET, Node.js, PHP, Python, and Ruby. The best language is a function of many factors, including the task at hand as well as personal preference.
Compute Engine lets you create and run virtual machines on Google infrastructure. Compute Engine provides control of every component but also assumes it’s your responsibility to keep things running. With VMs, you need to install/configure your own web hosting stack from scratch and also decide how to provide for load balancing and scalability, from a variety of options.
Compute Engine does offer load balancing and autoscaling for groups of instances but it requires additional setup, maintenance, as well as general understanding of scalable web architectures and distributed systems design.
Kubernetes Engine provides a managed environment for deploying, managing, and scaling your containerised applications using Google infrastructure. A container cluster is the foundation of Kubernetes Engine. Containerized applications all run on top of container clusters that consist of at least one cluster master and multiple worker machines called nodes. These master and node machines run the Kubernetes cluster orchestration system.
Kubernetes is primarily targeted at applications composed of multiple containers. It therefore groups containers using pods and labels into formations for easy management and discovery. A pod is a group of one or more containers with shared storage/network and a specification for how to run them. Kubernetes Engine also comes with the cluster autoscaler feature that automatically resizes clusters based on the demands of the workloads you want to run.
App Engine is a framework and computing platform for developing and hosting web applications in Google-managed data centers. App Engine offers automatic scaling — as the number of requests increases, it automatically allocates more resources for the application to handle the additional demand.
App Engine provides standard and flexible environment. The standard environment has the ability to scale down to 0 instances when there is no traffic which is ideal for free or very low cost experimentation. The flexible environment are suitable for applications that receive consistent traffic, experience regular traffic fluctuations, or meet the parameters for scaling up and down gradually. App Engine provides automatic scaling and manual scaling options. App Engine comes fully equipped with features required to run web applications at scale, including memcache, a NoSQL document database, task scheduling, version management and traffic splitting for new version rollouts and A/B testing.
Cloud Functions is GCP’s serverless compute platform that runs your code in response to events originating from Google and/or 3rd-party services. At this level of compute service abstraction, you write and deploy single-purpose functions and your code executes in a fully-managed environment.
It is the simplest way to run your code in the cloud. It automatically manages and scales underlying infrastructure with the size of workload. Cloud Functions allows you to trigger your code from Google Cloud Platform, Firebase, and Google Assistant, or call it directly from any web, mobile, or backend application via HTTP.
Hopefully, after reading this, you will get a better idea of each GCP compute offerings and ultimately help you decide on which is the right option for you. To delve deeper into each compute products, go to cloud.google.com/products.
Get Started Today
Click the button below to get a FREE US$500 credit to kickstart your GCP journey.