|
Cloud Computing has changed the the way software is developed, deployed and operated. It has made a huge impact on the way businesses operate and it is still growing rapidly. With a connected world over the internet using smart devices, event driven architecture is gaining popularity. The entire application code is run in response to a request or an event.
In this article, we will compare the serverless offerings from three major cloud providers – AWS, Azure and Google Cloud Platform.
Table of Contents
What is Serverless Architecture?
Serverless architecture is reimagining the way we thinking about cloud computing. Serverless Architecture refers to the practice of designing and running applications without having to manage servers. Instead, applications are run on a platform-as-a-service (PaaS).
Serverless takes the control of managing the virtual machines out of the developers hands and puts it in the cloud provider hands. The solution is scalable by default and keeps the guess work out in terms of servers needed.
What is Event Driven Architecture?
Event-driven architecture is a system of loosely coupled microservices that uses events to communicate between services. It ensures that when something happens, there should be a way for the people who need to know about it to get the information they need.
Related: Understand the basics of cloud computing architecture in this blog.
What is Function as a Service (FaaS) and why should you use it?
In FaaS, you don’t have to worry about the underlying infrastructure. You simply specify the function code and the runtime environment takes care of provisioning and managing your resources. FaaS is great for building custom functions or turning off features in pre-built ones.
Functions provides features such as managed execution contexts (MECs), which allow you to manage multiple functions in parallel from a single console experience. Another important point to remember is that the serverless functions are stateless.
FaaS is built with developers in mind. No longer you need to worry about infrastructure, scaling and patching. Developers can just write the code and let it run. You can use FaaS to run any type of application, including those that require high performance and low latency. However, it is important to note that not all the development use cases are meant for Serverless architecture or FaaS.
Offerings from AWS, Azure, GCP
When it comes to serverless cloud-based computing, three of the most popular options are Amazon Web Services (AWS) Lambda and Azure Functions from Microsoft Azure and Google Cloud Platform (GCP) Cloud Functions.
These three services offer different advantages and disadvantages, so it’s important to understand which one is best for your needs. Let’s take a look at each one!
Comparison of AWS Lambda vs Azure Functions vs Cloud Functions
Pricing Model
Unlike GCP and AWS, Azure has more flexibility in choosing the right plan. Azure offers consumption plan, premium plan and a dedicated plan. AWS also offers offers tiered pricing options for on-demand duration above certain monthly usage thresholds. Below are some considerations for choosing the right plan or cloud provider
1. How long your function runs or execution time,
2. How many times a function is invoked,
3. How many resources you provision for the function
4. You incur charges regardless of the outcome of the function or its duration.
AWS Lambda | Azure Functions | Google Cloud Functions |
---|---|---|
AWS Free Tier (Default) AWS Lambda@Edge | Consumption (Default) Premium Dedicated | GCP Free Tier (Default) Cloud Functions (2nd gen) |
1 Million Req/month free | 1 Million Req/month free | 2 Million Req/month free |
400,000 GB-seconds of compute time per month free | 400,000 GB-seconds of compute time per month free | 400,000 GB-seconds of compute time per month free |
Functions Triggers
Developers can set up Cloud Functions to execute in response to various events/scenarios by specifying a trigger for your function. Below is a side by side comparison for the three:
AWS Lambda | Azure Functions | Google Cloud Functions |
---|---|---|
Amazon Alexa Amazon Managed Streaming for Apache Kafka Self-managed Apache Kafka Amazon API Gateway (HTTP Requests) AWS CloudFormation Amazon CloudFront (Lambda@Edge) Amazon EventBridge (CloudWatch Events) Amazon CloudWatch Logs AWS CodeCommit AWS CodePipeline Amazon Cognito AWS Config Amazon Connect Amazon DynamoDB Amazon Elastic File System Elastic Load Balancing (Application Load Balancer) AWS IoT AWS IoT Events Amazon Kinesis Amazon Kinesis Data Firehose Amazon Lex Amazon MQ Amazon Simple Email Service Amazon Simple Notification Service Amazon Simple Queue Service Amazon Simple Storage Service (Amazon S3) Amazon Simple Storage Service Batch Secrets Manager AWS X-Ray | HTTP Triggers Event Grid Timer Queue Blob Storage Event Hub Cosmos Db Service Bus Queue Service Bus Topic Azure SQL IoT hub Table Storage | HTTP Triggers Pub/Sub triggers Cloud Storage triggers Firestore triggers (1st Gen) Google Analytics for Firebase triggers (1st Gen) Firebase (1st Gen) Generalized Eventarc triggers (2nd Gen) Cloud Logging Cloud Scheduler Cloud Tasks Gmail |
The above list is not exhaustive and based on your serverless application and cloud servive, it is more than likely that a trigger exists for your use case.
These are the links for the documentation – GCP, Azure, AWS.
Languages and Runtime
The runtime across all cloud service providers is more or less the same. Below is a quick comparison of languages and runtime serverless environment supported:
AWS Lambda | Azure Functions | Google Cloud Functions |
---|---|---|
Java Go PowerShell Node.js C# Python Ruby code Custom Runtime | C# F# JavaScript Python Java PowerShell TypeScript Go/Rust/other with Custom Handlers | Java Go Node.js C# Python Ruby PHP |
Orchestration
Serverless architecture relies on microservices to perform a unit of work. To build a large application, there are some out of the box cloud computing services available to use.
There are several patterns provided to combine multiple serverless functions into stateful long-running flows. The library handles communication for each block of code, taking care of the state management, while keeping the API surface simple.
AWS Lambda | Azure Functions | Google Cloud Functions |
---|---|---|
Step Functions | Durable Functions | Workflows |
Logic Apps |
Monitoring
Each cloud provider has cloud native monitoring solutions. Below are some ways you can monitor and log cloud events and status for the functions:
AWS Lambda | Azure Functions | Google Cloud Functions |
---|---|---|
Cloud Watch | Application Insight | Operations Suite (formerly Stackdriver) |
CodeGuru | Metrics Explorer | |
X-Ray | Log Analytics Workspace |
Conclusion
Ultimately, it is important to look at your specific needs when choosing a cloud-based computing platform. Each service offers its own advantages and disadvantages, so its important to understand which one is best for your needs.
Further Reading: Cloud Well-Architected Framework is a must for all Cloud Architects. Check out this blog on easy to understand concepts