In this article we will take a deeper dive into the compute services that are offered by the major cloud providers: Amazon Web Services vs Google Cloud Platform vs Microsoft Azure. If, instead, you are looking for a high level overview of everything offered on these public clouds I highly recommend a blog post where Nishal lays out a comparison of all the different services available on AWS, GCP and Azure. This article is not meant to be a ‘be all end all’ comparison but rather a starting point in your research to finding the right cloud platform and service for your application with links to more in depth research on the specific services.
To better understand where all the different cloud compute services fit in, and to be able to quickly compare and contrast them, it’s important to divide them into subsets. These cloud services can be divided into three broad categories:
These categories can then be plotted on a spectrum that runs from highly customizable on the left to highly managed on the right.
For completeness’ sake we find ‘On Premise’ on the complete left side of this spectrum. This allows for complete power of customization but with the burden of complete maintenance responsibility. As we move further to the right the responsibilities slowly get extracted away. One degree more managed than ‘On Prem’ we find our first cloud category, IaaS, where the responsibility for the physical hardware falls on the cloud provider. Now you only pay for the compute time and power actually used. Another step to the right and the host OS is extracted away as well which means we are no longer responsible for maintaining, updating and patching the underlying software. Finally, on the complete right side of this spectrum, we have serverless where we offer up even more customizability for an even more managed experience.
Now the burning question is of course ‘what compute service should I use?’ Well, that depends! There is no one service inherently better than the next one but there is generally one service better for a specific use case than another. Let’s run through some common use cases for the different categories.
IaaS is a popular pick when migrating an application in its entirety (also known as a ‘lift-and-shift’). IaaS is the best choice since you can build out your cloud infrastructure like a carbon copy of your on premise infrastructure. This would save a lot of time and money by not having to refactor the code to run in a different environment.
PaaS on the other hand is a great choice when you need to quickly build out a new application as you don’t have to worry about high-availability and scalability since the cloud provider extracts all the infrastructure and will make sure that your application scales with its demand and makes sure that redundancy is built in to ensure high availability.
Serverless is the epitome of the cloud where everything possible is extracted and the developer only has to provide the code itself. A popular option in this category are functions also known as ‘Function as a Service’. Here you only provide the code and the cloud provider is responsible for running the code. This makes it a very popular choice for loosely coupled infrastructure.
Infrastructure as a Service
Diving into the IaaS offerings we have AWS EC2, Azure Virtual Machines and GCP Compute Engine. When selecting which cloud offering is right for you there are a couple of variables to keep in mind: Availability, VM types, Pricing and Features.
IaaS Availability
If there is a specific region that you want to service with your IaaS machines you want to make sure that you can physically be as close as possible to this region in order to reduce latency and overall increase the customer experience. While a lot of the regions overlap there are certain areas better served by a specific cloud provider. At the moment of this writing GCP for example did not have any presence in Africa or the Middle East. This is bound to keep changing so please refer to the following links to find the current regions offered; AWS Regions, GCP Regions, Azure Regions.
IaaS VM Types
When selecting the VM type it is important to understand what kind of workload you’ll be running. Most workloads can be handled by General Purpose VMs that are widely offered by all three cloud providers but more specialized applications might need a VM that is optimized for Compute, Memory, Storage or High Performance. Currently AWS and Azure offer the widest variety of VM types while your options are more limited with GCP. It is also important to keep in mind that not every VM type is offered in every region, some of the more specialized machine types might not be offered in the fringe regions.
IaaS Pricing
The next consideration is pricing. When using a public provider you know you are swapping capital expenses for operating expenses and will most likely save yourself vast amounts of money. However pricing varies based upon the billing models of the cloud provider and the selected VM types.
All three public cloud providers offer the “on demand” pricing model where you simply “pay as you go.” They also all offer the spot model, called pre-emptible on GCP, which works like an auction and can get you discounts up to 90% for workloads that have flexible stop and start times such as batch processing jobs.
If you have a predictable workload and can commit to a one or three year contract you can benefit from reserved instances offered on AWS and Azure, or GCP’s Committed Use Discount, for significant savings over the on demand pricing (up to 70%). GCP also offers Sustained Use Discounts which require no commitments and are applied automatically when you meet the usage requirements and save you up to 30%. AWS, on the other hand, also offers a Savings Plan which is more flexible as you commit to a dollar per hour amount without locking yourself into a region or zone or instance family.
Now that we know the pricing models and the VM types we can go ahead and calculate the expected costs. As there are so many variables we recommend using the available pricing calculators: AWS Pricing Calculator, Azure Pricing Calculator, GCP Pricing Calculator.
IaaS Features
The last points to take into consideration are the features provided on each cloud’s IaaS platform. One of the main benefits of using a public cloud is only paying for what you need. This is where autoscaling comes in. Autoscaling tracks utilization metrics and automatically adds or deletes resources when target utilization points are met. All three providers offer autoscaling based on metrics and support scheduled scaling where you can set a schedule. This is useful if you have a service with a long start-up time that needs to be running every workday from 9-5 for example. Where the three main cloud providers do differ is that only AWS and GCP offer predictive scaling that utilizes machine learning and can preemptively scale based on historic trends.
Another feature that Azure lacks compared to AWS and GCP is the ability to hibernate your instances. This saves you money by not running your instance but lets you easily resume the instance compared to completely terminating said instance.
Licensing is another complicated ordeal and very dependent on your specific use case. To keep it simple it is important to know that each cloud provider offers on demand licenses which is great for new workloads. However, if you already have software licenses it starts to get complicated and it will require some digging into around the specific license. One thing here is for sure Azure wins when it comes to running Microsoft workloads in the cloud allowing you to save up to 85 percent over the standard pay-as-you-go rate by bringing your Windows Server and SQL Server on-premises licenses to Azure using the Azure Hybrid Benefit.
Finally, the last differentiator that will be discussed is the marketplace. This is where you can use a third party image to quickly set up your VM if you don’t have the resources to configure this yourself. Speaking purely quantitatively, Azure and AWS outnumber GCPs vendors three to one. The most common solutions can be found on each platform but if you are looking for something more specific it can’t hurt to check out each marketplace to see what they offer for your specific use case: GCP Marketplace, AWS Marketplace, Azure Marketplace.
Platform as a Service
Next we will look into the PaaS offerings of AWS, Azure and GCP. Here we see a big divide between the offerings: on one hand we have containerized solutions including kubernetes (k8s) services and on the other hand we have application platforms. Containerized solutions allow you to quickly move your existing containerized application on the cloud and allow you to be more cloud agnostic whereas the application platform allows you to quickly deploy your application but also comes at the cost of more vendor-lock in and limits your ability to move your application off of the cloud provider.
Kubernetes as a Service (KaaS)
Looking at the managed Kubernetes service AWS has Elastic Kubernetes Service (EKS), Azure offers Azure Kubernetes Service (AKS) and GCP offers the original Google Kubernetes Engine (GKE). The differences between these offerings are relatively small and it can make sense to let your current cloud provider guide you in this choice. If you aren’t already on the cloud or use a multi-cloud approach GKE is the original k8s service that Google developed and has the most features out of the box and offers the most automated capabilities and is therefore a logical first pick. The main reasons to go with AWS’ or Azure’s offering over GKE is if you want to have government cloud support, which GKE lacks, and/or want to integrate it more with the rest of your current cloud services. For more detailed information about the strengths and weaknesses of each managed kubernetes service I recommend the following article on A Cloud Guru.
Next to the containerized PaaS: Elastic Kubernetes Service. AWS also offers Elastic Container Service (ECS). Azure and GCP do not have a direct substitute for ECS, and it is AWS’ original container service that was offered before EKS. It has more similarities to EKS than differences but the main differences are that ECS is easier to set up as it doesn’t require as much expertise as setting up a Kubernetes service does.
On top of that it will save you some money as well as you only pay for the compute costs used instead of paying for a Kubernetes cluster on top of it. The downside is that you are using AWS proprietary technology compared to the open source Kubernetes and you are thus risking vendor lock-in. Overall, if you are just dipping your toes into the containerized waters ECS is a great choice but if you are ready to jump into the deep end with Kubernetes the extra costs won’t make much of a difference against your overall compute costs.
PaaS Application Platforms
Next we will discuss the PaaS application platforms: AWS’ Elastic Beanstalk vs. GCP’s App Engine vs. Azure’s App Service. These platforms let you run your code without having to containerize your application. Even though these platforms take care of provisioning servers and scaling the instances they also allow you to access the underlying servers.
All three allow you to run Node.js, Python, Java and .NET. App Engine and Elastic Beanstalk also support PHP and Ruby whereas GCP’s App Engine is the only service natively supporting Go. All three also support containerized applications giving you even more flexibility as far as supported languages. Elastic Beanstalk’s user interface seems to be more appreciated, while App Engine is praised for having better logging and deployment techniques, giving the ability to easily split traffic between different versions of your application.
GCP also offers a serverless version of App Engine, called App Engine standard, offering faster instance startup times, scaling to zero and is intended to run for free or at very low cost. This comes at the cost of not being able to run containers and not being able to access the underlying infrastructure.
Serverless
The last category of compute services are the serverless services. The offerings in this category can be divided into containerized services and Functions as a Service (FaaS).
Serverless Containers
The serverless containerized services allow you to run containers while the orchestration infrastructure is abstracted away. These services are a great option if you want to benefit from the reduced overhead serverless provides but you either already have a containerized application or have a workload that is too large for a function to handle effectively. This is offered on AWS by Fargate, on Azure with Container Instances (ACI) and on GCP with Cloud Run. The limitations vary slightly between the services: they all max out at 4 virtual CPUs and 14, 16 or 30 GB for ACI, Cloud Run and Fargate respectively. Google Cloud Run is built on the Knative API and runs on top of Kubernetes the most efficiently of all three services. Fargate on the other hand allows you to integrate with both EKS as well as ECS. Azure also allows you to integrate the service with its Kubernetes as a Service offering AKS. Check out this article for a more detailed comparison of these services.
Functions as a Service
Looking at the most pure version of serverless, getting all the benefits out of the cloud by really leveraging the abstraction of the infrastructure, almost unlimited scalability and only paying for what you use we find the Functions as a Service offerings. GCP’s and Azure’s FaaS offering uses a straight forward name, Cloud Functions and Azure Functions respectively, whereas AWS’ offer uses a more cryptic name with Lambda. Pricing is very similar across offerings; just be aware that for AWS you will get billed separately to have HTTP integrations using API Gateway whereas GCP and Azure offer a more streamlined HTTP integration that is included in the service. The available runtimes differ slightly between services, but all three services support custom runtimes in case you need a language that is not natively supported:
Custom Runtime | Supported Languages | Custom Runtime |
---|---|---|
AWS Lambda | C#, Java, Node.js, Python, PowerShell, Ruby, Go | Yes |
Azure Functions | C#, Java, Node.js, Python, PowerShell, F#, TypeScript | Yes |
GCP Cloud Functions | C#, Java, Node.js, Python, Ruby, Go, F#, Visual Basic | Yes |
Another interesting difference is in the average cold starts which can seem petty but can have a big staggering effect if you have time sensitive workloads. AWS and GCP are comparatively fast with Azure lagging behind according to this study.
If you have a larger workload the maximum timeout might come into play which differs between Lambda, Azure functions and cloud functions. Azure is both the least generous with 5 minutes on the Consumption plan as well as the most generous on the Premium and Dedicated plans (30 minutes). GCP Cloud Functions and AWS lambda can be found in between with 9 minutes and 15 minutes respectively.
February 2020 Update: Google Cloud Platform just introduced its public preview of Cloud Functions (2nd Gen). These new functions increase the maximum timeout from 9 to 60 minutes, and provides larger upgraded instances up to 16GB and 4vCPUs. It also adds the ability for minimum instances, which can cut down your cold starts. All in all a very welcomed update that can take functions to a whole new level.
Overall these three offerings are very similar and you have to dive into the details to get the little differences. For more details on these differences there is a great article by A Cloud Guru going more in depth.
Conclusion
The three major public cloud providers all offer extensive compute services and most services are offered by all three of AWS, GCP and Azure and overall there are much more similarities than differences between their offerings. The differences are in the small details.
Overall, if you are already in the cloud it usually makes sense to start your research at your preferred cloud provider as their services are bound to integrate more seamlessly with the rest of your cloud products.