serverless - when to faas?

Post on 11-Apr-2017

270 Views

Category:

Software

6 Downloads

Preview:

Click to see full reader

TRANSCRIPT

The Rise of Serverless - When to FaaS?

Photo by Shane PerryIcon by Serverless

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

Find me at @benikbauer

I am Benny Bauer

Shalom!

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

What is Serverless

FaaS BaaS B2D SaaS

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

How it works

Deploy your code

Define triggers

Code execution

(ephemeral instance)

EVENT-DRIVEN

AUTO SCALING

+

AVAILABILITY

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...

Distributed architecture on steroids

Monolith Microservices Serverless

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

Bad

◉ Monitoring

◉ Debugging

◉ Deployment

◉ Security

Distributed architecture on steroids

Good

◉ Scaling

◉ Fault tolerance

◉ Ownership

◉ Cost (better utilization)

Let’s combine these building blocks to something useful

Use Cases

Use case: Web backend

Use case: Web backend

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

Use case: Mobile backend

Use case: Mobile backend

Async request

Use case: File processing

Use case: File processing

Use case: Bot

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

Use case: Stream processing

◉ Log processing

◉ Analytics

◉ etc.

Use case: Scheduled tasks

◉ Health checks

◉ Monitoring

◉ Periodical digest

◉ etc.

Use case: Operations

Policy enforcement on AWS resources.

Examples:

● Unmanaged instances handling● Low utilized instances resizing

Triggered by:

● CloudWatch events● Scheduled

Use case: CI

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

Use case: CI

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

LambCI(Travis alternative)

Use case: IoT backend

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

Use case: IoT backend

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

Garden Monitoring

System

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

Use case: CDN

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

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

Use case: @Device

Use case: @Device - example

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

Use case: More

But isn’t it limitationless??

Mind The Limitations

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

Execution time:5 min

Memory:1.5GB

Disk:500MB

Package (zip):50MB

Limitations: Provider limits

◉ Ephemeral => cold start on first or infrequent calls

◉ Inconsistent

Limitations: Latency

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

Limitations: Latency

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

Frequency:

1 minute

10 minutes

30 minutes

60 minutes

Limitations: Latency

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

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

Limitations: Costs

Cost

Usage

EC2

AWS Lambda

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

Limitations: Vendor lock-in(alternatives)

Kubeless

funktion

Limitations: Vendor lock-in(alternatives)

Know the challenges

◉ Development○ Local development

○ Integration tests

○ Debugging

◉ Granularity○ Deployment

○ Monitoring

○ Logging

○ Security

○ Service discovery

Frameworks

Chalise

Tools

The FaaS effectNew emerging practices

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

Business model

◉ Worth Based Development (“FinDev”)

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

Business model

◉ API Marketplace

Architecture

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

Operations

DevOps is changing

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

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

SummaryWhat was it all about?

Predicting the future

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

Takeaways

◉ Deliver faster with lower costs for many use cases

◉ Consider limitations◉ Get ready for new emerging practices

Any questions?

Thanks!

Slides template by SlidesCarnival

You can find me at

◉ @benikbauer◉ bennybauer@gmail.com

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

top related