SlideShare a Scribd company logo
munz & more
Serverless
Architectures OTNLaTAM
AUG 2017
Dr. Frank Munz
2
Frank Munz
• Founded munz & more in 2007
• 17 years Oracle Middleware,
Cloud, and Distributed Computing
• Consulting and
High-End Training
• Wrote two Oracle WLS and
one Cloud book
Oracle announced FaaS
at OOW2016
AWS API: JSON Snippet
munz & more #4
AWS SDKs
munz & more #5
AWS language
bindings
Oracle language
bindings, e.g. Java:
https://github.com/oracle/bmcs-java-sdk
CLI
munz & more #6
$ aws ec2 describe-regions --output table
Oracle	open	sourced	
Bare	Metal	CLI	
https://blogs.oracle.com/de
velopers/open-sourcing-
bare-metal-cloud-services-
cli
AWS Console: Services
munz & more #7
Oracle Cloud Console
munz & more #8
True Elasticity
9
Oracle: Pay Per Use
munz & more #11
https://www.blog.google/topics/google-cloud/google-invests-indigo-undersea-cable-improve-cloud-infrastructure-southeast-asia/
New Undersea Cable (Google)
munz & more #12
Pay Per Use
• You own a massively parallel and
distributed and highly available
supercomputer with linear costs
• 100h of 1 instance
= 1h of 100 instances
• Your IT resources are not fixed anymore
Cloud Computing
API Elasticity Pay	per	use
Fully	Programmable	Data	Center
PaaS
IaaS Oracle	Bare	Metal
Amazon	EC2
Oracle	ACCS
AWS	Beanstalk
FaaS Oracle	TBD
AWS	Lambda
automatic	elasticity.
True	pay	per	use.
Min/Max,	trigger,	
IaaS	pricing
API	✅
Elasticity?
Pay	per	use?
Container	Service OCCS	
AWS	ECS
Launch	Configuration
+Autoscaling Groups
+Scaling	Events,
pay	/h	/	server
Easy	scaling	(OCCS)
IaaS	pay	per	use	pricing
Serverless
Serverless / FaaS / Lambda and how it relates to Microservices
Serverless vs. FaaS
munz & more #18
• AWS announced Lambda in 2014
as serverless.
• Lambda is Function as a Service (FaaS)
• PaaS is ”serverless” (in a broader sense)
• FaaS is the cool thing – not “serverless”
https://dzone.com/articles/serverless-architecture-1
Serverless Example: S3
munz & more #19
Replicated	to	3	availability	zones	(=DC)
Availability		99.99%
Durability				99.999999999% (eleven	9s)
14	worldwide	regions	
region	->	API	parameter
Blob	storage	with	RESTful Interface:
PUT (key, value)
S3
munz & more #20
GET	http://fmtestweb.s3-website.eu-central-1.amazonaws.com/
Serverless Example: S3
munz & more #21
• Never provision storage
• Off instance service = NO server
-> “serverless”
• NO web server
• $0,02 per GB + requests
Werner Vogel’s blog is on S3:
http://www.allthingsdistributed.com/
S3 is to data
as FaaS is to code
munz & more #22
FaaS
Edit Code Inline / Upload
munz & more #24
npm node-lambda package for locally running and remotely deploying your node.js
event: event passed to function
context: runtime context
callback: optional return
(or null)
Definition: Function as a Service
• Automated elasticity
• True pay per invokation
• Stateless
• Event based
munz & more #25
Definition
• Choose memory
-> compute power, I/O
• Using container tech
Characteristics
FaaS Implementations
Amazon Google Microsoft Oracle
Name Lambda Cloud	Functions Azure	Functions tbd
Year 2014 2016 2016 2016
Status prod alpha beta announced
Language
Support
NodeJS 4.3.2,	Java	
8,	Python	2.7, .Net
1.0.1	C#,	native	
Linux
NodeJS JS,	PHP, C#,	F#,	
Python,	bash,	
PowerShell
?
Remarks Deploy	from	github
or	BitBucket,	CLI
Bundle functions,	
OneDrive	and	Bot	
Service	integration
Linked to	Event	
Hub	CS?
Link https://aws.amazon.com/la
mbda/
https://azure.microsoft.com/e
n-us/services/functions/
https://azure.microsoft.com/en-
us/services/functions/
https://cloud.oracle.com
/home
Lambda Tech Details
• Retries + dead letter Q
• Metering in 100 ms (compute x time)
• You can use environment variables,
threads and start processes
• Invocation times may differ
• No scaling parameter
munz & more #27
Lambda: Limits per Function
munz & more #28
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 to $ 370
munz & more #29
https://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
Events to Trigger Functions
munz & more #30
Events	from	Cloud	Service
- API-Gateway
- S3
- SNS
- Kinesis
- Cognito
- Cloud	Formation
- Cloud	Watch	
log	/	events	/	scheduled
- Code	Commit
- Apps	using	AWS	SDK	
λVendor	lock-in?
also	multiple	sources
Create Lambda
munz & more #31
S3
Example 1: Simple Scenario
munz & more #32
Test Code
munz & more #33
1
2
34
API-Gateway
Design and expose API to consumer, can trigger Lambda
and brings more features:
• Authentication
• Traffic management
• Import Swagger definitions
• Create JavaScript, Android, iOS SDKs
• XML to REST conversion
• Uses Cloud Front (CDN) internally
Pricing: #calls + outbound traffic (+cache)
munz & more #34
Example 2: Image Recognition
35
https://github.com/awslabs/lambda-refarch-imagerecognition
Image Recognition
munz & more #36
Extract	
meta	data
AI	based
ecognition
Create
thumbnail
37
BaaS
Pay Per Use
Every started request is charged:
• First 1 million req/month are free
+ 400,000 GB seconds of compute time
• $0.20 per 1 million req
+ $0.00001667 per GB second
Lambda: free tier is forever.
munz & more #38
Security
“Try to attack something
that only lives for few milli-seconds”
(AWS)
Gone in 60ms
munz & more #41
https://www.youtube.com/watch?v=YZ058hmLuv0
Security
• Not discussed here: Are Clouds Safe?
• Small attack surface:
– Container lifetime -> request = milli-seconds
– No open ports
– Not listening to an IP
– You cannot call Lambdas directly:
triggered by events
“Exploit video” by CCC: “Gone in 60ms”
munz & more #42
Microservices
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
Serverless / FaaS / Lambda and how it relates to Microservices
Serverless / FaaS / Lambda and how it relates to Microservices
Frank Munz / OTN Latam 2016 #47
Service owns its data
Less enterprise, more application centric
Continuous Unlocking
munz & more #48
Is	𝛌 the	new	μ ?
FaaS vs. K8s Microservices
FaaS fulfills M. Fowler’s microservices definition
munz & more #49
AWS Lambda (compared to Docker with Kubernetes)
✅
Benefits	of	FaaS
- “serverless”	
- zero	config auto	scaling	
- true	pay	per	use
->	higher	abstraction
Limits	of	FaaS
- language/framework	choice
- resource	limits
- execution	time	/	size	limit
- vendor	lock-in
->	reduced	flexibility
A. Cockroft
Ten years ago, a monolithic application was the best
way to deliver business logic,
… five years ago the best option shifted to
microservices
Today, another shift is taking place, to event driven
functions (FaaS)
munz & more #50
https://read.acloud.guru/evolution-of-business-logic-from-monoliths-through-microservices-to-functions-ff464b95a44d
Software
Serverless Framework
Why a framework if your code runs in a “frame”?
• Repeating patterns:
IAM, API-GW, S3 bucket etc
• NodeJS, Python, Java
• AWS and Azure
• Generates, deploys, runs Lambda in 3 LOC
based on generated YAML + .py file
munz & more #52https://serverless.com/
Serverless Framework
munz & more #53
Hardware
- 100	TB	Storage,	256	bit	TPM
- 3x	10	GB/s	NICs
- Cluster	up	to	5,	
99.999%	data	durability
- iSCSI,	Ethernet,	SIM	Card		
- Lambda	in	Python:	Greengrass
- S3	PUT	->	Lambda	
- Lambda	functions	
->	public	API,	e.g.	AWS
- E-Ink	Shipping	label	that	updates
- $	300	/	10	days
AWS Snowball Edge (FaaS in a Box):
AWS Greengrass
Lambda in embedded devices
• Linux 4.4+
• Locally execute Lambda
triggered by local event
• Greengrass Core + IoT SDK
munz & more #56
TL;DR #serverless / #FaaS
”Serverless” ∋ FaaS / all major
clouds / event driven / stateless
/ true pay per use / automatic
scalability / integrates with
other CS / vendor lock in? /
-> cross-cloud frameworks emerge /
𝛌 could be the new µ!
@frankmunz
www.linkedin.com/in/frankmunz/
www.munzandmore.com/blog
facebook.com/cloudcomputingbook
facebook.com/weblogicbook
@frankmunz
youtube.com/weblogicbook
-> more than 50 web casts
Don’t be
shy J

More Related Content

What's hot (20)

PPTX
Docker and Microsoft - Windows Server 2016 Technical Deep Dive
Docker, Inc.
 
PPTX
Docker Practice in Alibaba Cloud by Li Yi (Mark) & Zuhe Li (Sogo)
Docker, Inc.
 
PDF
Running the Oracle SOA Suite Environment in a Docker Container
Guido Schmutz
 
PDF
Jelastic - Containers Live Migration Behind the Scene
Jelastic Multi-Cloud PaaS
 
PDF
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
wallyqs
 
PDF
Angular2, Spring Boot, Docker Swarm
🐊 Erwin Alberto
 
PPTX
Cloud Computing Open Stack Compute Node
Palak Sood
 
PPTX
Docker Roadshow 2016
Docker, Inc.
 
PPTX
Docker Datacenter Overview and Production Setup Slides
Docker, Inc.
 
PPTX
NetflixOSS for Triangle Devops Oct 2013
aspyker
 
PDF
Orchestrating Linux Containers while tolerating failures
Docker, Inc.
 
PDF
DockerCon US 2016 - Docker Practice in Alibaba Cloud
Li Yi
 
PDF
[OpenStack Days Korea 2016] Track1 - Mellanox CloudX - Acceleration for Cloud...
OpenStack Korea Community
 
PDF
Cloudfoundry Overview
rajdeep
 
PDF
Docker HK Meetup - 201707
Clarence Ho
 
PPTX
Why docker | OSCON 2013
dotCloud
 
PDF
Tupperware: Containerized Deployment at FB
Docker, Inc.
 
PPTX
Docker SF Meetup January 2016
Patrick Chanezon
 
PPTX
Open shift enterprise 3.1 paas on kubernetes
Samuel Terburg
 
PDF
Docker Online Meetup: Infrakit update and Q&A
Docker, Inc.
 
Docker and Microsoft - Windows Server 2016 Technical Deep Dive
Docker, Inc.
 
Docker Practice in Alibaba Cloud by Li Yi (Mark) & Zuhe Li (Sogo)
Docker, Inc.
 
Running the Oracle SOA Suite Environment in a Docker Container
Guido Schmutz
 
Jelastic - Containers Live Migration Behind the Scene
Jelastic Multi-Cloud PaaS
 
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
wallyqs
 
Angular2, Spring Boot, Docker Swarm
🐊 Erwin Alberto
 
Cloud Computing Open Stack Compute Node
Palak Sood
 
Docker Roadshow 2016
Docker, Inc.
 
Docker Datacenter Overview and Production Setup Slides
Docker, Inc.
 
NetflixOSS for Triangle Devops Oct 2013
aspyker
 
Orchestrating Linux Containers while tolerating failures
Docker, Inc.
 
DockerCon US 2016 - Docker Practice in Alibaba Cloud
Li Yi
 
[OpenStack Days Korea 2016] Track1 - Mellanox CloudX - Acceleration for Cloud...
OpenStack Korea Community
 
Cloudfoundry Overview
rajdeep
 
Docker HK Meetup - 201707
Clarence Ho
 
Why docker | OSCON 2013
dotCloud
 
Tupperware: Containerized Deployment at FB
Docker, Inc.
 
Docker SF Meetup January 2016
Patrick Chanezon
 
Open shift enterprise 3.1 paas on kubernetes
Samuel Terburg
 
Docker Online Meetup: Infrakit update and Q&A
Docker, Inc.
 

Viewers also liked (20)

PDF
Docker from A to Z, including Swarm and OCCS
Frank Munz
 
PDF
Serverless
Young Yang
 
PPTX
The Serverless Revolution: AWS Lambda and the Serverless Framework in Action
Toby Hede
 
PDF
AWS Lambda from the Trenches
Yan Cui
 
PDF
Serverless - When to FaaS?
Benny Bauer
 
PPTX
Containerless in the Cloud with AWS Lambda
Ryan Cuprak
 
PDF
Azure vs AWS Best Practices: What You Need to Know
RightScale
 
PPTX
Serverless Architectures and Continuous Delivery
Robin Weston
 
PDF
QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz
OpenCredo
 
PDF
Build Features, Not Apps
Natasha Murashev
 
PPTX
Azure Functions VS AWS Lambda: overview and comparison
Alex Zyl
 
PPTX
Webinar - Mobile Apps: Monolithic to Serverless
OpenXcell Technolabs
 
PDF
Serverless Architecture
Lena Barinova
 
PDF
Open stack ocata summit enabling aws lambda-like functionality with openstac...
Shaun Murakami
 
PDF
Transforming your business with PaaS
Omar Nawaz
 
PPTX
AWS vs Azure - Cloud Services Comparison
Aniket Kanitkar
 
PPTX
Adapt or Die Sydney - 5 Things Developers Should Know About Serverless
Apigee | Google Cloud
 
PDF
Building serverless apps with Node.js
Julien SIMON
 
PDF
Serverless - Lunch&Learn CleverToday - Mars 2017
Brice Argenson
 
PPTX
Serverless with Azure Functions
Andreas Willich
 
Docker from A to Z, including Swarm and OCCS
Frank Munz
 
Serverless
Young Yang
 
The Serverless Revolution: AWS Lambda and the Serverless Framework in Action
Toby Hede
 
AWS Lambda from the Trenches
Yan Cui
 
Serverless - When to FaaS?
Benny Bauer
 
Containerless in the Cloud with AWS Lambda
Ryan Cuprak
 
Azure vs AWS Best Practices: What You Need to Know
RightScale
 
Serverless Architectures and Continuous Delivery
Robin Weston
 
QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz
OpenCredo
 
Build Features, Not Apps
Natasha Murashev
 
Azure Functions VS AWS Lambda: overview and comparison
Alex Zyl
 
Webinar - Mobile Apps: Monolithic to Serverless
OpenXcell Technolabs
 
Serverless Architecture
Lena Barinova
 
Open stack ocata summit enabling aws lambda-like functionality with openstac...
Shaun Murakami
 
Transforming your business with PaaS
Omar Nawaz
 
AWS vs Azure - Cloud Services Comparison
Aniket Kanitkar
 
Adapt or Die Sydney - 5 Things Developers Should Know About Serverless
Apigee | Google Cloud
 
Building serverless apps with Node.js
Julien SIMON
 
Serverless - Lunch&Learn CleverToday - Mars 2017
Brice Argenson
 
Serverless with Azure Functions
Andreas Willich
 
Ad

Similar to Serverless / FaaS / Lambda and how it relates to Microservices (20)

PPTX
Serverless Presentation from Devoxx 2017 Casablanca (AWS Lambda / FaaS / Fn ...
Frank Munz
 
PPTX
Serverless Architectures
SuraiyaHasan19004210
 
PDF
Čtvrtkon #64 - AWS Serverless - Michal Haták
Ctvrtkoncz
 
PDF
Serverless - The Future of the Cloud?!
Bert Ertman
 
PDF
Microservices and Serverless for Mega Startups - DevOps IL Meetup
Boaz Ziniman
 
PPTX
Primeros pasos en desarrollo serverless
javier ramirez
 
PPTX
Building serverless app_using_aws_lambda_b4usolution
Hoa Le
 
PDF
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Boaz Ziniman
 
PPTX
What is Serverless Computing?
AIMDek Technologies
 
PPTX
Demistifying serverless on aws
AWS Riyadh User Group
 
PDF
Serverless Node.js
The Software House
 
PDF
Introduction to Serverless Computing - OOP Munich
Boaz Ziniman
 
PDF
State of serverless
Anurag Saran
 
PDF
Microservices Manchester: Serverless Architectures By Rafal Gancarz
OpenCredo
 
PDF
GreatLearning Webinar - Microservices and Event-Driven Architecture.pdf
Dhaval Nagar
 
PDF
Microservices and serverless for MegaStartups - DLD TLV 2017
Boaz Ziniman
 
PPTX
Serverless applications
mbaric
 
PPTX
awslambda-240508203904-07xsds253491.pptx
FarooqKhurshid1
 
PDF
Why Serverless?
Ridwan Fadjar
 
PDF
The future will be Serverless (FrontConf Munich 2017)
Luciano Mammino
 
Serverless Presentation from Devoxx 2017 Casablanca (AWS Lambda / FaaS / Fn ...
Frank Munz
 
Serverless Architectures
SuraiyaHasan19004210
 
Čtvrtkon #64 - AWS Serverless - Michal Haták
Ctvrtkoncz
 
Serverless - The Future of the Cloud?!
Bert Ertman
 
Microservices and Serverless for Mega Startups - DevOps IL Meetup
Boaz Ziniman
 
Primeros pasos en desarrollo serverless
javier ramirez
 
Building serverless app_using_aws_lambda_b4usolution
Hoa Le
 
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Boaz Ziniman
 
What is Serverless Computing?
AIMDek Technologies
 
Demistifying serverless on aws
AWS Riyadh User Group
 
Serverless Node.js
The Software House
 
Introduction to Serverless Computing - OOP Munich
Boaz Ziniman
 
State of serverless
Anurag Saran
 
Microservices Manchester: Serverless Architectures By Rafal Gancarz
OpenCredo
 
GreatLearning Webinar - Microservices and Event-Driven Architecture.pdf
Dhaval Nagar
 
Microservices and serverless for MegaStartups - DLD TLV 2017
Boaz Ziniman
 
Serverless applications
mbaric
 
awslambda-240508203904-07xsds253491.pptx
FarooqKhurshid1
 
Why Serverless?
Ridwan Fadjar
 
The future will be Serverless (FrontConf Munich 2017)
Luciano Mammino
 
Ad

More from Frank Munz (7)

PDF
From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017
Frank Munz
 
PPTX
Oracle Service Bus 12c (12.2.1) What You Always Wanted to Know
Frank Munz
 
PDF
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
Frank Munz
 
PDF
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
Frank Munz
 
PDF
12 Things About WebLogic 12.1.3 #oow2014 #otnla15
Frank Munz
 
PDF
WebLogic JMX for DevOps
Frank Munz
 
PDF
Oracle Service Bus (OSB) for the Busy IT Professonial
Frank Munz
 
From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017
Frank Munz
 
Oracle Service Bus 12c (12.2.1) What You Always Wanted to Know
Frank Munz
 
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
Frank Munz
 
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
Frank Munz
 
12 Things About WebLogic 12.1.3 #oow2014 #otnla15
Frank Munz
 
WebLogic JMX for DevOps
Frank Munz
 
Oracle Service Bus (OSB) for the Busy IT Professonial
Frank Munz
 

Recently uploaded (20)

PPTX
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
PPT
introductio to computers by arthur janry
RamananMuthukrishnan
 
PDF
The Internet - By the numbers, presented at npNOG 11
APNIC
 
PDF
BRKACI-1001 - Your First 7 Days of ACI.pdf
fcesargonca
 
DOCX
Custom vs. Off-the-Shelf Banking Software
KristenCarter35
 
PDF
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
Cerebraix Technologies
 
PDF
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
PPTX
internet básico presentacion es una red global
70965857
 
PDF
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
PDF
BRKACI-1003 ACI Brownfield Migration - Real World Experiences and Best Practi...
fcesargonca
 
PDF
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
PPT
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 
PPTX
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
PPTX
Softuni - Psychology of entrepreneurship
Kalin Karakehayov
 
PPT
introduction to networking with basics coverage
RamananMuthukrishnan
 
PDF
The-Hidden-Dangers-of-Skipping-Penetration-Testing.pdf.pdf
naksh4thra
 
PPTX
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 
PPTX
Orchestrating things in Angular application
Peter Abraham
 
PPTX
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
PPTX
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
introductio to computers by arthur janry
RamananMuthukrishnan
 
The Internet - By the numbers, presented at npNOG 11
APNIC
 
BRKACI-1001 - Your First 7 Days of ACI.pdf
fcesargonca
 
Custom vs. Off-the-Shelf Banking Software
KristenCarter35
 
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
Cerebraix Technologies
 
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
internet básico presentacion es una red global
70965857
 
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
BRKACI-1003 ACI Brownfield Migration - Real World Experiences and Best Practi...
fcesargonca
 
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
Softuni - Psychology of entrepreneurship
Kalin Karakehayov
 
introduction to networking with basics coverage
RamananMuthukrishnan
 
The-Hidden-Dangers-of-Skipping-Penetration-Testing.pdf.pdf
naksh4thra
 
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 
Orchestrating things in Angular application
Peter Abraham
 
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 

Serverless / FaaS / Lambda and how it relates to Microservices

  • 1. munz & more Serverless Architectures OTNLaTAM AUG 2017 Dr. Frank Munz
  • 2. 2 Frank Munz • Founded munz & more in 2007 • 17 years Oracle Middleware, Cloud, and Distributed Computing • Consulting and High-End Training • Wrote two Oracle WLS and one Cloud book
  • 4. AWS API: JSON Snippet munz & more #4
  • 5. AWS SDKs munz & more #5 AWS language bindings Oracle language bindings, e.g. Java: https://github.com/oracle/bmcs-java-sdk
  • 6. CLI munz & more #6 $ aws ec2 describe-regions --output table Oracle open sourced Bare Metal CLI https://blogs.oracle.com/de velopers/open-sourcing- bare-metal-cloud-services- cli
  • 11. munz & more #11 https://www.blog.google/topics/google-cloud/google-invests-indigo-undersea-cable-improve-cloud-infrastructure-southeast-asia/
  • 12. New Undersea Cable (Google) munz & more #12
  • 13. Pay Per Use • You own a massively parallel and distributed and highly available supercomputer with linear costs • 100h of 1 instance = 1h of 100 instances • Your IT resources are not fixed anymore
  • 14. Cloud Computing API Elasticity Pay per use Fully Programmable Data Center
  • 18. Serverless vs. FaaS munz & more #18 • AWS announced Lambda in 2014 as serverless. • Lambda is Function as a Service (FaaS) • PaaS is ”serverless” (in a broader sense) • FaaS is the cool thing – not “serverless” https://dzone.com/articles/serverless-architecture-1
  • 19. Serverless Example: S3 munz & more #19 Replicated to 3 availability zones (=DC) Availability 99.99% Durability 99.999999999% (eleven 9s) 14 worldwide regions region -> API parameter Blob storage with RESTful Interface: PUT (key, value)
  • 20. S3 munz & more #20 GET http://fmtestweb.s3-website.eu-central-1.amazonaws.com/
  • 21. Serverless Example: S3 munz & more #21 • Never provision storage • Off instance service = NO server -> “serverless” • NO web server • $0,02 per GB + requests Werner Vogel’s blog is on S3: http://www.allthingsdistributed.com/
  • 22. S3 is to data as FaaS is to code munz & more #22
  • 23. FaaS
  • 24. Edit Code Inline / Upload munz & more #24 npm node-lambda package for locally running and remotely deploying your node.js event: event passed to function context: runtime context callback: optional return (or null)
  • 25. Definition: Function as a Service • Automated elasticity • True pay per invokation • Stateless • Event based munz & more #25 Definition • Choose memory -> compute power, I/O • Using container tech Characteristics
  • 26. FaaS Implementations Amazon Google Microsoft Oracle Name Lambda Cloud Functions Azure Functions tbd Year 2014 2016 2016 2016 Status prod alpha beta announced Language Support NodeJS 4.3.2, Java 8, Python 2.7, .Net 1.0.1 C#, native Linux NodeJS JS, PHP, C#, F#, Python, bash, PowerShell ? Remarks Deploy from github or BitBucket, CLI Bundle functions, OneDrive and Bot Service integration Linked to Event Hub CS? Link https://aws.amazon.com/la mbda/ https://azure.microsoft.com/e n-us/services/functions/ https://azure.microsoft.com/en- us/services/functions/ https://cloud.oracle.com /home
  • 27. Lambda Tech Details • Retries + dead letter Q • Metering in 100 ms (compute x time) • You can use environment variables, threads and start processes • Invocation times may differ • No scaling parameter munz & more #27
  • 28. Lambda: Limits per Function munz & more #28
  • 29. 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 to $ 370 munz & more #29 https://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
  • 30. Events to Trigger Functions munz & more #30 Events from Cloud Service - API-Gateway - S3 - SNS - Kinesis - Cognito - Cloud Formation - Cloud Watch log / events / scheduled - Code Commit - Apps using AWS SDK λVendor lock-in? also multiple sources
  • 31. Create Lambda munz & more #31 S3
  • 32. Example 1: Simple Scenario munz & more #32
  • 33. Test Code munz & more #33 1 2 34
  • 34. API-Gateway Design and expose API to consumer, can trigger Lambda and brings more features: • Authentication • Traffic management • Import Swagger definitions • Create JavaScript, Android, iOS SDKs • XML to REST conversion • Uses Cloud Front (CDN) internally Pricing: #calls + outbound traffic (+cache) munz & more #34
  • 35. Example 2: Image Recognition 35 https://github.com/awslabs/lambda-refarch-imagerecognition
  • 36. Image Recognition munz & more #36 Extract meta data AI based ecognition Create thumbnail
  • 38. Pay Per Use Every started request is charged: • First 1 million req/month are free + 400,000 GB seconds of compute time • $0.20 per 1 million req + $0.00001667 per GB second Lambda: free tier is forever. munz & more #38
  • 40. “Try to attack something that only lives for few milli-seconds” (AWS)
  • 41. Gone in 60ms munz & more #41 https://www.youtube.com/watch?v=YZ058hmLuv0
  • 42. Security • Not discussed here: Are Clouds Safe? • Small attack surface: – Container lifetime -> request = milli-seconds – No open ports – Not listening to an IP – You cannot call Lambdas directly: triggered by events “Exploit video” by CCC: “Gone in 60ms” munz & more #42
  • 44. 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
  • 47. Frank Munz / OTN Latam 2016 #47 Service owns its data Less enterprise, more application centric Continuous Unlocking
  • 48. munz & more #48 Is 𝛌 the new μ ?
  • 49. FaaS vs. K8s Microservices FaaS fulfills M. Fowler’s microservices definition munz & more #49 AWS Lambda (compared to Docker with Kubernetes) ✅ Benefits of FaaS - “serverless” - zero config auto scaling - true pay per use -> higher abstraction Limits of FaaS - language/framework choice - resource limits - execution time / size limit - vendor lock-in -> reduced flexibility
  • 50. A. Cockroft Ten years ago, a monolithic application was the best way to deliver business logic, … five years ago the best option shifted to microservices Today, another shift is taking place, to event driven functions (FaaS) munz & more #50 https://read.acloud.guru/evolution-of-business-logic-from-monoliths-through-microservices-to-functions-ff464b95a44d
  • 52. Serverless Framework Why a framework if your code runs in a “frame”? • Repeating patterns: IAM, API-GW, S3 bucket etc • NodeJS, Python, Java • AWS and Azure • Generates, deploys, runs Lambda in 3 LOC based on generated YAML + .py file munz & more #52https://serverless.com/
  • 55. - 100 TB Storage, 256 bit TPM - 3x 10 GB/s NICs - Cluster up to 5, 99.999% data durability - iSCSI, Ethernet, SIM Card - Lambda in Python: Greengrass - S3 PUT -> Lambda - Lambda functions -> public API, e.g. AWS - E-Ink Shipping label that updates - $ 300 / 10 days AWS Snowball Edge (FaaS in a Box):
  • 56. AWS Greengrass Lambda in embedded devices • Linux 4.4+ • Locally execute Lambda triggered by local event • Greengrass Core + IoT SDK munz & more #56
  • 57. TL;DR #serverless / #FaaS ”Serverless” ∋ FaaS / all major clouds / event driven / stateless / true pay per use / automatic scalability / integrates with other CS / vendor lock in? / -> cross-cloud frameworks emerge / 𝛌 could be the new µ! @frankmunz