Overview
AWS Lambda, Google Cloud Functions and Azure Functions are all event-driven computing services offered by major cloud providers that allow you to run code without having to provision and manage servers. Here's a comparison of the three services on different aspects.
Pricing
The cost of using AWS Lambda, Google Cloud Functions, and Azure Functions can vary depending on several factors, such as the number of invocations, the duration of each execution, the memory allocation, and the number of executions. Here's a high-level comparison of the pricing models for each service (Assuming Region Asia Pacific)
Pricing Model
|
AWS Lambda
|
Google Cloud Functions
|
Azure Functions
|
Price per Request
|
Free for first 1M requests, then $0.20 per 1M requests
|
First 2M requests per month are free, then $0.40 per 1M
requests
|
First 1M requests per month are free, then $0.20 per 1M
requests
|
Price per GB- Second
|
$0.00001667 per GB-second
|
$0.0000025 per GB-second
|
$0.000016 per GB-second
|
Free Tier
|
1M free requests per month and 400,000 GB-seconds of compute time
per month
|
2M free requests per month and 400,000 GB-seconds of compute time
per month
|
1M free requests per month and 400,000 GB-seconds of compute time
per month
|
We can estimate the expenses by using our actual request patterns for the three service providers in the following situation:
Scenario 1: Request pattern for well-established companies such as Clappia.
Average Lambda Requests: 49.8 M per month
Average Allocated memory: 128MB per Invocation
Average Execution Time: 500ms per Invocation
Cost (in USD)
|
AWS Lambda
|
Google Cloud Functions
|
Azure Functions
|
Invocations
|
$9.76
|
$19.12
|
$9.80
|
CPU Utilization
|
$45.22
|
$66.92
|
$43.40
|
Others
|
nil
|
-
RAM (Gib-second) : $9.49
-
Minimum number of instance(in this case 1): $1.92
|
nil
|
Total (in USD)
|
$54.98 / month
|
$97.45 / month
|
$53.20 / month
|
Scenario 2: Some early age Startups ( Hooli, Aviato etc 🙂)
Average Lambda Requests: 2M per month
Average Allocated memory: 128MB per Invocation
Average Execution Time: 500ms / per Invocation
Cost (in USD)
|
AWS Lambda
|
Google Cloud Functions
|
Azure Functions
|
Invocations
|
$0.20
|
$0.0
|
$0.20
|
CPU Utilization
|
$0.0
|
$0.0
|
$0.0
|
Others
|
nil
|
-
RAM (Gib-second) : $0.0
-
Minimum number of instance(in this case 1): $1.92
|
nil
|
Total (in USD)
|
$0.20 / month
|
$1.92 / month
|
$0.20 / month
|
It is crucial to keep in mind that the costs outlined above are general approximations, and the actual expenses incurred will vary depending on the specific usage patterns of each service.
Language Support
Language
|
AWS Lambda
|
Google Cloud Functions
|
Azure Functions
|
C#
|
Yes
|
Yes
|
Yes
|
Java
|
Yes
|
Yes
|
Yes
|
Python
|
Yes
|
Yes
|
Yes
|
Go
|
Yes
|
Yes
|
Yes
|
Node.js
|
Yes
|
Yes
|
Yes
|
Ruby
|
Yes
|
No
|
No
|
PHP
|
Yes
|
No
|
Yes
|
PowerShell
|
Yes
|
No
|
Yes
|
Custom Runtime
|
Yes
|
Yes
|
Yes
|
Scale
AWS Lambda, Google Cloud Functions, and Azure Functions can all automatically scale to meet the demands of incoming requests. However, the exact scale capabilities may vary between services.
Scaling Capability
|
AWS Lambda
|
Google Cloud Functions
|
Azure Functions
|
Scaling Type
|
Automatic
|
Automatic
|
Automatic
|
Scaling Limit
|
No limit, can request limit increase
|
2nd gen Cloud Functions have a default limit of 100 for both HTTP
and event-driven functions. 1st gen Cloud Functions have a default
limit of 3000 for event-driven functions, but there is no default
limit for 1st gen HTTP Cloud Functions.
|
Up to 200 instances per function per region
|
Scaling Speed
|
MilliSeconds
|
Seconds
|
Seconds
|
Scaling Granularity
|
Per function or per account
|
Per function
|
Per function
|
Scaling Policy
|
Concurrent executions
|
Request per second
|
Request per instance
|
Warm Start
|
Supported
|
Supported
|
Supported
|
Integrations
Capability
|
AWS Lambda
|
Google Cloud Functions
|
Azure Functions
|
API Gateway Integration
|
Yes
|
Yes
|
Yes
|
Compute Platform
|
AWS Elastic Container Service, AWS Elastic Kubernetes Service,
Amazon EC2,
|
Google Kubernetes Engine, Compute Engine
|
Azure Kubernetes Service, Azure Container Instances
|
Messaging Service
|
Amazon Simple Notification Service, Amazon Simple Queue
Service
|
Cloud Pub/Sub, Firebase Cloud Messaging
|
Azure Service Bus, Azure Event Hubs
|
Database Integration
|
Amazon RDS, Amazon DynamoDB,
|
Cloud SQL, Cloud Spanner
|
Azure Cosmos DB, Azure SQL Database
|
DevOps Integration
|
AWS CodePipeline, AWS CodeCommit
|
Cloud Build, Cloud Source Repositories
|
Azure DevOps, Azure Repos
|
Event Trigger Sources
|
Lambda can be integrated with over 140 AWS services directly or
through the Amazon EventBridge event bus. The commonly utilized
event sources for Lambda are:
|
Cloud Functions (2nd gen) offers support for various triggers,
which includes:
HTTP triggers Event triggers, such as: Pub/Sub triggers Cloud
Storage triggers Generalized Eventarc triggers Any event type
supported by Eventarc, including 90+ event sources via Cloud Audit
Logs.
|
Over 20 sources including Event Grid, Blob Storage, and
more
|
Monitoring and Logging
- AWS Lambda: AWS Lambda provides CloudWatch for monitoring and logging. CloudWatch allows you to monitor the performance of your functions and view logs for troubleshooting and debugging. You can also set up alarms to notify you of any issues with your functions.
- Google Cloud Functions: Google Cloud Functions integrates with StackDriver for monitoring and logging. StackDriver provides a unified view of logs and metrics from your cloud resources, and allows you to set up alerts and dashboards for quick and easy access to key metrics.
- Azure Functions: Azure Functions provides Application Insights for monitoring and logging. Application Insights provides real-time monitoring of your functions and allows you to view logs and diagnose issues. You can also set up custom alerts and dashboards to keep track of the health and performance of your functions.
Execution Duration and other Constraints
Service
|
AWS Lambda
|
Google Cloud Functions
|
Azure Functions
|
Max Execution Duration
|
900 sec or 15 mins
|
540 sec or 9 mins
|
600 sec or 10mins
|
Max Memory
|
10GB
|
8GB
|
3.5GB
|
Max Concurrent Executions
|
1000
|
1000
|
Varies by plan
|
Note: the maximum concurrent executions on AWS Lambda and Google Cloud Functions are the default limits, which can be increased by contacting the provider's support team.
Conclusion
After comparing the three services, AWS Lambda is the preferred choice for us. The cost of using AWS Lambda is significantly lower than the other two providers, especially for established companies that have high request patterns. Additionally, AWS Lambda supports a wide range of programming languages and has practically no limits on scaling. AWS Lambda also offers extensive integrations with other AWS services, making it a highly versatile service for developers. While Google Cloud Functions and Azure Functions also have their unique strengths, AWS Lambda is the most cost-effective and versatile option for event-driven computing.