Top Banner
Dr Frank Munz @frankmunz www.munzandmore.com /blog #DevoxxMA Serve rless Architectu s DOAG 2017
41

Serverless Presentation from Devoxx 2017 Casablanca (AWS Lambda / FaaS / Fn Project)

Jan 24, 2018

Download

Software

Frank Munz
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Dr Frank Munz

@frankmunzwww.munzandmore.com/blog

#DevoxxMA

ServerlessArchitectures

DOAG 2017

Page 2: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)
Page 3: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

• Founded munz & more in 2007

• > 15 years Middleware, Cloud, and Distributed Computing

• Consulting and High-End Training

• Wrote two WebLogic and a Cloud book

Dr. Frank Munz

@frankmunz

Page 4: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Content1. Clouds2. FaaS (AWS Lambda)3. Serverless4. Frameworks (Fn Project)5. Conclusion

#serverless @frankmunz

Page 5: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Clouds

#serverless @frankmunz

Page 6: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

API

@frankmunz

Page 7: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Elasticity

Page 8: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Pay Per Use

• 1 US cent/h (micro), geo-distribution included

• You own a massively parallel, distributed and highly

available supercomputer with linear costs:

1 instance for 100 hours $= 100 instances for 1h

@frankmunz

Page 9: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Cloud Computing

API Elasticity Pay per use

Fully Programmable Data Center

Page 10: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

PaaS

IaaS Amazon EC2Oracle CI

AWS BeanstalkOracle ACCS

FaaS AWS LambdaOracle TBD

Automated elasticity.True pay per use.

Container Service AWS ECSOCCS

API?

Elasticity?

Pay per use?

Page 11: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

AWS Lambda

#serverless @frankmunz

Page 12: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

FaaS: AWS Lambda

• AWS announced Lambda in 2014

• Lambda is Function as a Service (FaaS)

@frankmunz

Page 13: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

AWS Lambda

AWS SAM Local: test and locally run Lambda (Public Beta)

event: event passed to function

context: runtime context

callback: optional return

(or null)

@frankmunz

Page 14: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Create Lambda

S3

@frankmunz

Vendor lock-in?

Page 15: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Test Code1

2

34

Page 16: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Example: REST Request

Page 17: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Example: Image Recognition

Flow

munz & more #19

Extract meta data

AI basedrecognition

Createthumbnail

How to model

flow?

Page 18: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Pricing

Every started request is charged:

• First 1 million req/month are free, forever

+ 400,000 GB seconds of compute time

• Measured in increments of 100 msec

• $0.20 per 1 million req

+ $0.00001667 per GB second

Tip: Use AWS

Cloud Watch

alarms for billing!@frankmunz

Page 19: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Cost Savings

Expedia(2016):

– 2.3 billions calls

– 200k hours / month

– $ 550 a month

Postlight

– API GW, Lambda, Serverless

– Costs dropped 2 orders of magnitude down to $ 370https://www.youtube.com/watch?v=gT9x9LnU_rE

https://trackchanges.postlight.com/serving-39-million-requests-for-370-month-or-how-we-reduced-our-hosting-costs-by-two-orders-of-edc30a9a88cd

http://serverlesscalc.com/

@frankmunz

Page 20: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

FaaS

#serverless @frankmunz

Page 21: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Function as a Service

• Automated elasticity

• True pay per invocation

• Ephemeral compute

Definition

Characteristics• Event based

• Reduced control plane (mem+ CPU + I/O)

• Uses container tech

Page 22: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

AMIGO: Public Cloud ServicesAmazon Microsoft IBM Google Oracle

Name Lambda Azure Functions Open Whisk Cloud Functions tbd

Year 2014 2016 2016 2016 2016

Status prod prod prod beta announced

LanguageSupport

NodeJS 4.3.2, Java8,Python 2.7, .Net C#, native Linux

JS, PHP, C#, F#, Python, bash, PowerShell

NodeJS, Java,Phython,(Docker)

NodeJS(not Java)

Docker based ?

Remarks Bundle functions, OneDrive and Bot integration

Apache Incubator

Deploy from github or BitBucket, CLI

Based onopen source Fn Project?

Link https://aws.amazon.com/lambda/

https://azure.microsoft.com/en-us/services/functions/

https://openwhisk.apache.org/

https://azure.microsoft.com/en-us/services/functions/

https://cloud.oracle.com/home

Page 23: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Security

“Try to attack something that only lives for few milli-seconds”

(AWS)

@frankmunz

Page 24: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Youtube: Gone in 60ms

https://www.youtube.com/watch?v=YZ058hmLuv0@frankmunz

Page 25: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Microservices

Developing a single application as

• a suite of small services

• each running in its own process / owns it‘s data

• communicating with lightweight mechanisms

(M. Fowler / J. Lewis)

https://martinfowler.com/articles/microservices.html@frankmunz

Page 26: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

FaaS = Microservice?

• FaaS fulfills M. Fowler’s microservices definition

• A real micro service consists of multiple functions

• FaaS vs. Docker / Kubernetes?

Benefits of FaaS- Serverless - Zero config auto scaling - True pay per use

-> higher abstraction

Limits of FaaS- Language choice- Resource limits- Vendor lock-in-> reduced flexibility

@frankmunz

Page 27: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Serverless

#serverless @frankmunz

Page 28: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)
Page 29: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Serverless

Mark Cavage, Java One 2017: “Reduce notion of all infrastructure”

Serverless

Example: AWS

SQS

1 Mio Req $0.40@frankmunz

Wasn’t that PaaS ?

Yes it‘s PaaS, but serverless requires…

• Never pay for idle

• Automated elasticity

• Reduced config settings

Page 30: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Frameworks

#serverless @frankmunz

Page 31: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Serverless Frameworks dealing with

@frankmunz

AWS Chalice

PortabilityComplexity Standards

Page 32: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

FaaS OS Frameworks

Overlap in functionality

-> expect consolidation

Survival is about:

• Integration: K8s, Traefik, Zipkin,

Prometheus, Kafka etc.

• Adoption, adoption, adoption

• FaaS as PaaS implementation?https://github.com/faas-lane/FaaS-Lane/tree/master/candidates@frankmunz

Page 33: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Fn Project

• Apache 2, Open Source Java One 2017

• Fn Server (micro API GW), LB, Flow

• Function / Container duality

• Docker is only dependency -> polyglot

@frankmunz

Page 34: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Fn Project

• Jackson for JSON marshalling in Java

• JAX-RS demo

• Hot functions (30 seconds)

• Fn PaaS service likely?

@frankmunz

Page 35: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Fn Flow

Java 8 CompletableFutures API

Page 36: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Fancy a demo?

Page 37: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Outlook

• Oracle’s Cloud Native Container strategy

– Kubernetes

– Wercker

– Pay per invocation (?)

• Fn Project as PaaS and on premises

• Azure Container Instance: pay per invoke (today!)

@frankmunz

Page 38: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

Conclusion

#serverless @frankmunz

Page 39: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

TL;DR #serverless & #FaaS

in all major clouds / could compose

μ out of 𝛌 / PaaS ⊇ Serverless ⊇ FaaS / FaaS

= stateless / true pay per use / automated

scalability / event driven / integrates with

other CS / architect against vendor lock in /

cloud agnostic FaaS frameworks emerge / FaaS

frameworks consolidation ahead /

𝛌 only technically the new μ (AWS).

@frankmunz

Page 40: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

3 Membership Tiers• Oracle ACE Director• Oracle ACE• Oracle ACE Associate

bit.ly/OracleACEProgram

500+ Technical Experts Helping Peers Globally

Connect:

Nominate yourself or someone you know: acenomination.oracle.com

@oracleace

Facebook.com/oracleaces

[email protected]

Page 41: Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn Project)

munzandmore.com/blog

@frankmunz

munzandmore.com/youtube