azure functions vs aws lambda: overview and comparison

31

Upload: alex-zyl

Post on 16-Apr-2017

497 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Azure Functions VS AWS Lambda: overview and comparison
Page 2: Azure Functions VS AWS Lambda: overview and comparison

Alexander ZylSenior Software Engineer

[email protected]

https://facebook.com/zyl.alex

Page 3: Azure Functions VS AWS Lambda: overview and comparison

‘As-a-Service’

Page 4: Azure Functions VS AWS Lambda: overview and comparison

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

Page 5: Azure Functions VS AWS Lambda: overview and comparison

FaaS benefits

No servers to manageContinuous scalability Cost effectiveness

Page 6: Azure Functions VS AWS Lambda: overview and comparison

• Mobile backend• Serverless websites• Data processing• Event processing• Scheduled tasks

Use cases

Page 7: Azure Functions VS AWS Lambda: overview and comparison

Back in 2014

Azure VM (IaaS)

Azure App Service (PaaS)

AWS Elastic Beanstalk (PaaS)

Amazon EC2 (IaaS)

Page 8: Azure Functions VS AWS Lambda: overview and comparison

Azure WebJobs

WebJob 3WebJob 2WebJob 1

w3wp (SCM)

ZipZip Zip

App Service Web App

w3wp (Main App)

Web Application

WebJob 4

Zip

Page 9: Azure Functions VS AWS Lambda: overview and comparison

Zero administrativeAutoscalingFine-grained pricingBring your own code

AWS Lambda

Page 10: Azure Functions VS AWS Lambda: overview and comparison

Functions Apps

App Service Eco-System

Page 11: Azure Functions VS AWS Lambda: overview and comparison

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

Page 12: Azure Functions VS AWS Lambda: overview and comparison

What is function?

ConfigurationCodeTrigger Result

Page 13: Azure Functions VS AWS Lambda: overview and comparison

• Triggered by event source• On-Demand• Scheduled

Function types

Page 14: Azure Functions VS AWS Lambda: overview and comparison

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

...

Page 15: Azure Functions VS AWS Lambda: overview and comparison

Binding: before and after

Page 16: Azure Functions VS AWS Lambda: overview and comparison

Azure Functions

app

Azure Functions host

Code

Dependencies

WebJobs SDK Default assemblies

Function 1 Function 2 Function 3

Page 17: Azure Functions VS AWS Lambda: overview and comparison

Demo

Page 18: Azure Functions VS AWS Lambda: overview and comparison

User OCR Service function

OCR RecognitionService

Recognized images container

Email sender function

Result message queue

Image

Sends

Stores

TriggersSends

Page 19: Azure Functions VS AWS Lambda: overview and comparison

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

Page 20: Azure Functions VS AWS Lambda: overview and comparison

Event Models: Pull and PushPull model:

Push model:

Event Source

Invokes

Event Source

Polls

Page 21: Azure Functions VS AWS Lambda: overview and comparison

Service Bus

Storage queue

Storage blobNotification

Hubs

Connected services

Pull model

Event models: Azure way

Page 22: Azure Functions VS AWS Lambda: overview and comparison

Push model

Bitbucket

Azure alert

Dropbox

Logic App

GitHub

Scheduler

HTTP Request

Event models: Azure way

Page 23: Azure Functions VS AWS Lambda: overview and comparison

Push model

Event models: Lambda way

Amazon S3

Amazon DynamoDB

Amazon Kinesis

Amazon SNS

Amazon CloudWatch

AWS CloudFormation

API Gateway

Amazon SES

Pull model

Page 24: Azure Functions VS AWS Lambda: overview and comparison

Lambda function:

• Has its own unique id (ARN)arn:aws:lambda:eu-central-

1:854958518097:function:QueuePoller

• Has role with permissions

Page 25: Azure Functions VS AWS Lambda: overview and comparison

AWS Authorization types

• Role-based• Identity-based

Amazon S3 Amazon DynamoDB

AWS STS

Role

Role

AWS STS

PermissionsUser

Page 26: Azure Functions VS AWS Lambda: overview and comparison
Page 27: Azure Functions VS AWS Lambda: overview and comparison

Architecture: Azure Functions

w3wp (SCM)

Azure Functions

app

w3wp (WebHost app)

APIScript Host

Event Source Event Source Event Source

Page 28: Azure Functions VS AWS Lambda: overview and comparison

AWS Lambda infrastructureContainer pool

Functions

Container

Wraps

Executes

Wraps

Goes to pool

Architecture: AWS Lambda

Page 29: Azure Functions VS AWS Lambda: overview and comparison

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

Page 30: Azure Functions VS AWS Lambda: overview and comparison

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

Page 31: Azure Functions VS AWS Lambda: overview and comparison

Q&A