serverless - when to faas?

67
The Rise of Serverless - When to FaaS? Photo by Shane Perry Icon by Serverless

Upload: benny-bauer

Post on 11-Apr-2017

270 views

Category:

Software


6 download

TRANSCRIPT

Page 1: Serverless - When to FaaS?

The Rise of Serverless - When to FaaS?

Photo by Shane PerryIcon by Serverless

Page 2: Serverless - When to FaaS?

◉ Cloud Architecture & Development Consulting◉ Serverless Enthusiast◉ Ex-

Find me at @benikbauer

I am Benny Bauer

Shalom!

Page 3: Serverless - When to FaaS?

EvolutionGenesis Custom Built Product (+ rental) Commodity (+ utility)

Cloud evolution in 60 sec

Data center Hosting

Virtualization IaaS

Icons made by freepik from www.flaticon.com & unlimicon from Noun Project

On Premise

Compute

Platform PaaS Serverless

Page 4: Serverless - When to FaaS?

What is Serverless

FaaS BaaS B2D SaaS

Page 5: Serverless - When to FaaS?

What is FaaS - Function as a Service

Fully-managed compute

Provisioning, patching, scaling, monitoring, logging are provided out-of-the- box

Deploy your code

Just package and upload the code

Pay for actual usage

Getting charged only upon code execution, per 100ms

100%

UTILIZATION

LESS OPS

Page 6: Serverless - When to FaaS?

How it works

Deploy your code

Define triggers

Code execution

(ephemeral instance)

EVENT-DRIVEN

AUTO SCALING

+

AVAILABILITY

Page 7: Serverless - When to FaaS?

Event-driven on steroids

◉ HTTP requests

◉ Storage (e.g. file upload)

◉ DB (e.g. row insert)

◉ Events stream

◉ Queue/Messaging

◉ Scheduled job

◉ Monitoring

◉ Infrastructure events

◉ Code build events

◉ Many more...

Page 8: Serverless - When to FaaS?

Distributed architecture on steroids

Monolith Microservices Serverless

Source: http://ryanjbaxter.com/2015/07/15/using-microservices-to-build-cloud-native-applications-part-1/

Page 9: Serverless - When to FaaS?

Bad

◉ Monitoring

◉ Debugging

◉ Deployment

◉ Security

Distributed architecture on steroids

Good

◉ Scaling

◉ Fault tolerance

◉ Ownership

◉ Cost (better utilization)

Page 10: Serverless - When to FaaS?

Let’s combine these building blocks to something useful

Use Cases

Page 11: Serverless - When to FaaS?
Page 12: Serverless - When to FaaS?

Use case: Web backend

Page 13: Serverless - When to FaaS?

Use case: Web backend

Source: https://www.linkedin.com/pulse/serverless-architecture-cloud-guru-ryan-kroonenburg

Page 14: Serverless - When to FaaS?
Page 15: Serverless - When to FaaS?

Use case: Mobile backend

Page 16: Serverless - When to FaaS?

Use case: Mobile backend

Async request

Page 17: Serverless - When to FaaS?
Page 18: Serverless - When to FaaS?

Use case: File processing

Page 19: Serverless - When to FaaS?

Use case: File processing

Page 20: Serverless - When to FaaS?
Page 22: Serverless - When to FaaS?

Use case: Bot

Page 23: Serverless - When to FaaS?
Page 24: Serverless - When to FaaS?

Use case: Distributed compute

import pywren

def my_function(x):

return x + 7

wrenexec = pywren.default_executor()

futures = wrenexec.map(my_function, range(10))

pywren.get_all_results(futures)

pywren

Page 25: Serverless - When to FaaS?
Page 26: Serverless - When to FaaS?

Use case: Stream processing

◉ Log processing

◉ Analytics

◉ etc.

Page 27: Serverless - When to FaaS?
Page 28: Serverless - When to FaaS?

Use case: Scheduled tasks

◉ Health checks

◉ Monitoring

◉ Periodical digest

◉ etc.

Page 29: Serverless - When to FaaS?
Page 30: Serverless - When to FaaS?

Use case: Operations

Policy enforcement on AWS resources.

Examples:

● Unmanaged instances handling● Low utilized instances resizing

Triggered by:

● CloudWatch events● Scheduled

Page 31: Serverless - When to FaaS?
Page 32: Serverless - When to FaaS?

Use case: CI

Source: https://github.com/lambci/lambci

Page 33: Serverless - When to FaaS?

Use case: CI

Source: https://github.com/lambci/lambci

LambCI(Travis alternative)

Page 34: Serverless - When to FaaS?
Page 35: Serverless - When to FaaS?

Use case: IoT backend

Source: https://www.hackster.io/jose-troche/alexa-drone-pilot-7f2deb

Page 36: Serverless - When to FaaS?

Use case: IoT backend

Source: https://medium.com/serverless-stories/building-a-serverless-garden-monitoring-system-with-lambda-c72c54113df2

Garden Monitoring

System

Page 37: Serverless - When to FaaS?
Page 38: Serverless - When to FaaS?

Use case: CDN

Source: https://www.slideshare.net/AmazonWebServices/new-launch-bringing-aws-lambda-to-the-edge

◉ Purpose:

○ Better UX

○ Reduce load from

backend

◉ Use cases:

○ Request validation

○ A/B testing

○ Content customizations

according to user-agent

Page 39: Serverless - When to FaaS?

Use case: CDN

Source: https://www.slideshare.net/AmazonWebServices/new-launch-bringing-aws-lambda-to-the-edge

Page 40: Serverless - When to FaaS?
Page 41: Serverless - When to FaaS?

Source: https://www.slideshare.net/AmazonWebServices/aws-welcome-to-reinvent-recap-20161214

Use case: @Device

Page 42: Serverless - When to FaaS?

Use case: @Device - example

Source: https://www.slideshare.net/AmazonWebServices/aws-welcome-to-reinvent-recap-20161214

Page 43: Serverless - When to FaaS?
Page 44: Serverless - When to FaaS?

Use case: More

Page 45: Serverless - When to FaaS?

But isn’t it limitationless??

Mind The Limitations

Page 46: Serverless - When to FaaS?

Limitations: Stateless

◉ Instances are ephemeral (memory, storage)but not necessarily disposable

◉ No sticky sessions◉ Workarounds:

○ Websockets through IoT (MQTT)

○ Manage state yourself:

■ Pass on request

■ Store in cache/db

Page 47: Serverless - When to FaaS?

Execution time:5 min

Memory:1.5GB

Disk:500MB

Package (zip):50MB

Limitations: Provider limits

Page 48: Serverless - When to FaaS?

◉ Ephemeral => cold start on first or infrequent calls

◉ Inconsistent

Limitations: Latency

Source: http://www.yusp.com/blog/cold-start-problem-recommender-systems/

Page 49: Serverless - When to FaaS?

Limitations: Latency

Source: https://blog.newrelic.com/2017/01/11/aws-lambda-cold-start-optimization/

Frequency:

1 minute

10 minutes

30 minutes

60 minutes

Page 50: Serverless - When to FaaS?

Limitations: Latency

Source: http://ericjonas.com/pywren.html

Page 51: Serverless - When to FaaS?

Limitations: Costs

AWS Lambda EC2

Duration Per 100 msPer 1 hourReduced cost for RI

Cost of ownership

Low High

Additional costs RequestsRedundancyStorage

Cost effective For low or changing load For high utilization

Page 52: Serverless - When to FaaS?

Limitations: Costs

Cost

Usage

EC2

AWS Lambda

Page 53: Serverless - When to FaaS?

Limitations: Vendor lock-in

◉ The real lock-in is the integrated services

◉ A tradeoff: control vs. convenienceSource: https://www.slideshare.net/AmazonWebServices/reinvent-recap-session-1-whats-new-with-aws-lambda

Page 54: Serverless - When to FaaS?

Limitations: Vendor lock-in(alternatives)

Kubeless

funktion

Page 55: Serverless - When to FaaS?

Limitations: Vendor lock-in(alternatives)

Page 56: Serverless - When to FaaS?

Know the challenges

◉ Development○ Local development

○ Integration tests

○ Debugging

◉ Granularity○ Deployment

○ Monitoring

○ Logging

○ Security

○ Service discovery

Page 57: Serverless - When to FaaS?

Frameworks

Chalise

Page 58: Serverless - When to FaaS?

Tools

Page 59: Serverless - When to FaaS?

The FaaS effectNew emerging practices

Photo by TimOve (https://flic.kr/p/4aTMMx)

Page 60: Serverless - When to FaaS?

Business model

◉ Worth Based Development (“FinDev”)

https://hackernoon.com/why-the-fuss-about-serverless-4370b1596da0#.yct5knd7h by Simon Wardley

Page 61: Serverless - When to FaaS?

Business model

◉ API Marketplace

Page 62: Serverless - When to FaaS?

Architecture

◉ More distributed and pluggable ◉ More event-driven◉ Frameworks are changing

Page 63: Serverless - When to FaaS?

Operations

DevOps is changing

◉ Less about provisioning, capacity planning◉ More about distributed systems:

○ Monitoring & visibility ○ Debuggability○ Graceful degradation & Resiliency○ CI/CD○ Costs optimisations

Page 64: Serverless - When to FaaS?

SummaryWhat was it all about?

Page 65: Serverless - When to FaaS?

Predicting the future

◉ Lower costs◉ Less limitations◉ More use cases◉ More tooling

Page 66: Serverless - When to FaaS?

Takeaways

◉ Deliver faster with lower costs for many use cases

◉ Consider limitations◉ Get ready for new emerging practices

Page 67: Serverless - When to FaaS?

Any questions?

Thanks!

Slides template by SlidesCarnival

You can find me at

◉ @benikbauer◉ [email protected]

This work is licensed under a CC Attribution 4.0 International License.