azure functions vs aws lambda: overview and comparison
TRANSCRIPT
Alexander ZylSenior Software Engineer
https://facebook.com/zyl.alex
‘As-a-Service’
Functions
Application
Runtime
Operating System
Virtualization
Networking
Storage
Hardware
FaaS
Customer Managed Customer Managed Unit of Scale Provider Managed
Functions
Application
Runtime
Operating System
Virtualization
Networking
Storage
Hardware
Functions
Application
Runtime
Operating System
Virtualization
Networking
Storage
Hardware
Functions
Application
Runtime
Operating System
Virtualization
Networking
Storage
Hardware
On Premises IaaS PaaS
Functions
Application
Runtime
Operating System
Virtualization
Networking
Storage
Hardware
SaaS
FaaS benefits
No servers to manageContinuous scalability Cost effectiveness
• Mobile backend• Serverless websites• Data processing• Event processing• Scheduled tasks
Use cases
Back in 2014
Azure VM (IaaS)
Azure App Service (PaaS)
AWS Elastic Beanstalk (PaaS)
Amazon EC2 (IaaS)
Azure WebJobs
WebJob 3WebJob 2WebJob 1
w3wp (SCM)
ZipZip Zip
App Service Web App
w3wp (Main App)
Web Application
WebJob 4
Zip
Zero administrativeAutoscalingFine-grained pricingBring your own code
AWS Lambda
Functions Apps
App Service Eco-System
App Service Dynamic RuntimeHosting, CI, Deployment Slots, Remote Debugging, etc.
WebJobs CoreProgramming model, common abstractions
WebJobs ExtensionsTriggers, input and output bindings
WebJobs Script RuntimeAzure Functions Host – Dynamic Compilation, Language abstractions, etc.
Code Config
• Language RuntimeC#, Node.js, F#, PHP, etc.
Azure Functions
What is function?
ConfigurationCodeTrigger Result
• Triggered by event source• On-Demand• Scheduled
Function types
Functions: Azure wayAzure
subscriptionFunctions
app 1
Functions app N
Func 1
Func 1 Func 2 Func 3 Func 4 Func 5
Configuration
ConfigurationFunc 2 Func 3
...
Binding: before and after
Azure Functions
app
Azure Functions host
Code
Dependencies
WebJobs SDK Default assemblies
Function 1 Function 2 Function 3
Demo
User OCR Service function
OCR RecognitionService
Recognized images container
Email sender function
Result message queue
Image
Sends
Stores
TriggersSends
Triggers
User OCR Service function
Incoming images container
Task Info table
New task message queue
Image processing function
Invokes
Task completion topic
Email sender function
SMS sender function
Triggers
Triggers
Task result container
New task poison message queue
Poison message processing function
Triggers
OCR RecognitionService
Event Models: Pull and PushPull model:
Push model:
Event Source
Invokes
Event Source
Polls
Service Bus
Storage queue
Storage blobNotification
Hubs
Connected services
Pull model
Event models: Azure way
Push model
Bitbucket
Azure alert
Dropbox
Logic App
GitHub
Scheduler
HTTP Request
Event models: Azure way
Push model
Event models: Lambda way
Amazon S3
Amazon DynamoDB
Amazon Kinesis
Amazon SNS
Amazon CloudWatch
AWS CloudFormation
API Gateway
Amazon SES
Pull model
Lambda function:
• Has its own unique id (ARN)arn:aws:lambda:eu-central-
1:854958518097:function:QueuePoller
• Has role with permissions
AWS Authorization types
• Role-based• Identity-based
Amazon S3 Amazon DynamoDB
AWS STS
Role
Role
AWS STS
PermissionsUser
Architecture: Azure Functions
w3wp (SCM)
Azure Functions
app
w3wp (WebHost app)
APIScript Host
Event Source Event Source Event Source
AWS Lambda infrastructureContainer pool
Functions
Container
Wraps
Executes
Wraps
Goes to pool
Architecture: AWS Lambda
Features comparisonAzure Functions AWS Lambda
Input/Output binding -Deep integration with other servicesMultiple trigger sourceHTTP functions out-of-the boxAutomatic package restore supportCode sharingCall function from another function +
IDE support - +
Number of supported languages 7 3Wide list of deployment options + -
Debugging Local/Remote LocalTesting Local/Remote Local/Remote
AWS Lambda documentation:https://aws.amazon.com/documentation/lambda/
Azure Functions documentation: https://azure.microsoft.com/en-us/documentation/services/functions/
SDK repositories:https://github.com/Azure/azure-webjobs-sdkhttps://github.com/Azure/azure-webjobs-sdk-scripthttps://github.com/Azure/azure-webjobs-sdk-extensions
Resources
Q&A