SlideShare a Scribd company logo
1 of 24
Download to read offline
A Gentle Introduction to
Functions-as-a-Service
Valeri Karpov
@code_barbarian
github.com/vkarpov15
About Me
● Backend Lead @ Booster, Node.js OSS
● Core contributor for Mongoose, Mocha
● Blogger, thecodebarbarian.com
● Early employee at LevelUp, MongoDB, Booster
● Invented the MEAN stack
What’s This Talk About?
● The progression of dev-ops for startups
● Why FaaS is the next natural step for dev-ops
● Retaining state in “stateless” functions
● Trade-offs between different FaaS providers
2008: Physical Machine in Dorm Room
● EC2 was limited, other hosting services sucked
● LevelUp’s first release on an Ubuntu tower
○ Physical machines die or get shut down
○ Campus ISP is slow or changes the IP
○ Limited scale: shipping a new PC takes days
2012: Amazon EC2
● My next few startups all ran on 1-5 EC2 VMs
● Cloud VMs solve most physical machine issues
○ Power outages much less likely
○ Reliable internet maintained by Amazon
○ Spinning up a new VM takes minutes
2012: Amazon EC2
● Vanilla EC2 was great for single server apps
● But what about multiple app servers?
○ 2 services on the same VM in isolation
○ Continuous Deployment
○ Scaling horizontally with a click
2015: Containers and Orchestration
● Docker, Mesos, Kubernetes, etc.
● Compelling for CD and isolation
● Still Have Problems with Resource Usage
○ Memory limits per VM
○ Docker hogs disk space
Functions as a Service
● Instead of deploying an app, you deploy a
bunch of stateless functions
● No VMs, no OS updates
● Resource limits (RAM, CPU) per function call
● Functions run in response to triggers
API Gateways
● Cloud functions respond to triggers
● HTTP is a trigger, but what about:
○ API keys / auth
○ Rate limits
● FaaS providers have API Gateways for this
FaaS Providers
● Amazon AWS Lambda
● Microsoft Azure Functions
● Google Cloud Functions
● IBM Cloud Functions
● Oracle Cloud Fn
● LunchBadger, + many more
FaaS Open Source Libraries
● Kubeless
● OpenWhisk
● Fission
FaaS Advantages
● Easier to scale, no need to worry about too
much load on one service
● Cheaper for low-usage services
● Cheap and easy development environments
● Resource issues rare and easy to debug
FaaS Problems
● No strong best practices yet
● Completely different way of writing apps
● Limited language support
● Managing triggers and API Gateways
● Sometimes you want to retain state...
Why Retain State?
● Think about a persistent database connection
Stateless is a Big Performance Problem
● Connecting to a database on every function
call is slow
But You Can Retain Global State
● Put db handle in global scope
Common Trick Across FaaS Providers
● AWS Lambda: bit.ly/mongodb-lambda
● Azure Functions: bit.ly/mongodb-azure
○ Also With C#: bit.ly/csx-azure-state
● IBM Cloud: bit.ly/mongodb-ibm-cloud
Trade-offs Between Popular Providers
● AWS Lambda
● Azure Functions
● Google Cloud Functions
Size Restrictions
● Size limit per function (node_modules)
○ AWS Lambda: 50MB
○ Azure Functions: None (*)
○ Google Cloud: 100MB zipped, 500MB
unzipped
Primary Fee Structure
● AWS Lambda: $0.00001667 / GB-s, $0.20 / 1M
● Azure Functions: $0.000016 / GB-s, $0.20 / 1M
● Google Cloud: $0.0000025 / GB-s, $0.0000100
/ GHz-s
Hidden Fees: API Gateways
● AWS Lambda: $3.50 / 1M + data
● Azure Functions: no extra cost necessary
● Google Cloud Functions: no extra cost
necessary
Overall FaaS Recommendations
● Check out Azure Functions
● AWS Lambda and IBM Cloud are a mess
Further Reading
● My Blog:
○ bit.ly/mongodb-azure
○ bit.ly/mongodb-ibm-cloud
Thanks for Listening!

More Related Content

What's hot

Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack Discussion
Zaiyang Li
 
Moving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScaleMoving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScale
mmoline
 
Javascript Myths and its Evolution
Javascript Myths and its  EvolutionJavascript Myths and its  Evolution
Javascript Myths and its Evolution
Deepu S Nath
 
Beyond Apache: Faster Web Servers
Beyond Apache: Faster Web ServersBeyond Apache: Faster Web Servers
Beyond Apache: Faster Web Servers
webhostingguy
 
Building & Testing Scalable Rails Applications
Building & Testing Scalable Rails ApplicationsBuilding & Testing Scalable Rails Applications
Building & Testing Scalable Rails Applications
evilmike
 
Scaling a Web Service
Scaling a Web ServiceScaling a Web Service
Scaling a Web Service
Leon Ho
 
ASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG London
Phil Pursglove
 
Open source and cross platform .net
Open source and cross platform .netOpen source and cross platform .net
Open source and cross platform .net
Ibon Landa
 

What's hot (20)

ReactPHP + Symfony
ReactPHP + SymfonyReactPHP + Symfony
ReactPHP + Symfony
 
What's new in ASP.NET vNext
What's new in ASP.NET vNextWhat's new in ASP.NET vNext
What's new in ASP.NET vNext
 
Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack Discussion
 
Teaching Cloud to the Programmers of Tomorrow
Teaching Cloud to the Programmers of TomorrowTeaching Cloud to the Programmers of Tomorrow
Teaching Cloud to the Programmers of Tomorrow
 
Building real time app by using asp.Net Core
Building real time app by using asp.Net CoreBuilding real time app by using asp.Net Core
Building real time app by using asp.Net Core
 
Moving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScaleMoving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScale
 
Javascript Myths and its Evolution
Javascript Myths and its  EvolutionJavascript Myths and its  Evolution
Javascript Myths and its Evolution
 
Beyond Apache: Faster Web Servers
Beyond Apache: Faster Web ServersBeyond Apache: Faster Web Servers
Beyond Apache: Faster Web Servers
 
Rails on JRuby
Rails on JRubyRails on JRuby
Rails on JRuby
 
CDN implmentation consideration
CDN implmentation considerationCDN implmentation consideration
CDN implmentation consideration
 
Building & Testing Scalable Rails Applications
Building & Testing Scalable Rails ApplicationsBuilding & Testing Scalable Rails Applications
Building & Testing Scalable Rails Applications
 
Real-world Experiences in Scala
Real-world Experiences in ScalaReal-world Experiences in Scala
Real-world Experiences in Scala
 
Cassandra Summit 2014: Deploying Cassandra for Call of Duty
Cassandra Summit 2014: Deploying Cassandra for Call of DutyCassandra Summit 2014: Deploying Cassandra for Call of Duty
Cassandra Summit 2014: Deploying Cassandra for Call of Duty
 
Scaling a Web Service
Scaling a Web ServiceScaling a Web Service
Scaling a Web Service
 
Orchestrator for QlikView: add-on product description
Orchestrator for QlikView: add-on product descriptionOrchestrator for QlikView: add-on product description
Orchestrator for QlikView: add-on product description
 
ASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG London
 
Open source and cross platform .net
Open source and cross platform .netOpen source and cross platform .net
Open source and cross platform .net
 
GraphQL vs. (the) REST
GraphQL vs. (the) RESTGraphQL vs. (the) REST
GraphQL vs. (the) REST
 
FULL stack -> MEAN stack
FULL stack -> MEAN stackFULL stack -> MEAN stack
FULL stack -> MEAN stack
 
Nodeconf npm 2011
Nodeconf npm 2011Nodeconf npm 2011
Nodeconf npm 2011
 

Similar to A Gentle Introduction to Functions-as-a-Service

Overview of PaaS: Java experience
Overview of PaaS: Java experienceOverview of PaaS: Java experience
Overview of PaaS: Java experience
Igor Anishchenko
 
Introduction to amazon web services for developers
Introduction to amazon web services for developersIntroduction to amazon web services for developers
Introduction to amazon web services for developers
Ciklum Ukraine
 
Cloud Foundry at Rakuten
Cloud Foundry at RakutenCloud Foundry at Rakuten
Cloud Foundry at Rakuten
Platform CF
 
Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless world
Matthias Luebken
 

Similar to A Gentle Introduction to Functions-as-a-Service (20)

PaaS with Java
PaaS with JavaPaaS with Java
PaaS with Java
 
Serverless Compose vs hurtownia danych
Serverless Compose vs hurtownia danychServerless Compose vs hurtownia danych
Serverless Compose vs hurtownia danych
 
Glauber Costa on OSv as NoSQL platform
Glauber Costa on OSv as NoSQL platformGlauber Costa on OSv as NoSQL platform
Glauber Costa on OSv as NoSQL platform
 
Overview of PaaS: Java experience
Overview of PaaS: Java experienceOverview of PaaS: Java experience
Overview of PaaS: Java experience
 
Overview of PaaS: Java experience
Overview of PaaS: Java experienceOverview of PaaS: Java experience
Overview of PaaS: Java experience
 
Introduction to amazon web services for developers
Introduction to amazon web services for developersIntroduction to amazon web services for developers
Introduction to amazon web services for developers
 
Cloud Foundry at Rakuten
Cloud Foundry at RakutenCloud Foundry at Rakuten
Cloud Foundry at Rakuten
 
Spring in the Cloud
Spring in the CloudSpring in the Cloud
Spring in the Cloud
 
Building a PaaS with Docker and AWS
Building a PaaS with Docker and AWSBuilding a PaaS with Docker and AWS
Building a PaaS with Docker and AWS
 
Mad scalability: Scaling when you are not Google
Mad scalability: Scaling when you are not GoogleMad scalability: Scaling when you are not Google
Mad scalability: Scaling when you are not Google
 
Write less (code) and build more with serverless
Write less (code) and build more with serverlessWrite less (code) and build more with serverless
Write less (code) and build more with serverless
 
The Next Big Thing: Serverless
The Next Big Thing: ServerlessThe Next Big Thing: Serverless
The Next Big Thing: Serverless
 
Building a PaaS with Docker and AWS
Building a PaaS with Docker and AWSBuilding a PaaS with Docker and AWS
Building a PaaS with Docker and AWS
 
Building Cloud-agnostic Serverless APIs
Building Cloud-agnostic Serverless APIsBuilding Cloud-agnostic Serverless APIs
Building Cloud-agnostic Serverless APIs
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL
 
Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless world
 
PaaS options for .NET
PaaS options for .NETPaaS options for .NET
PaaS options for .NET
 
Containerizing GPU Applications with Docker for Scaling to the Cloud
Containerizing GPU Applications with Docker for Scaling to the CloudContainerizing GPU Applications with Docker for Scaling to the Cloud
Containerizing GPU Applications with Docker for Scaling to the Cloud
 
Presto@Uber
Presto@UberPresto@Uber
Presto@Uber
 
Writing and deploying serverless python applications
Writing and deploying serverless python applicationsWriting and deploying serverless python applications
Writing and deploying serverless python applications
 

More from Valeri Karpov

MEAN Stack NYC Meetup 20150717: TDD Your AngularJS + Ionic Directives With jQ...
MEAN Stack NYC Meetup 20150717: TDD Your AngularJS + Ionic Directives With jQ...MEAN Stack NYC Meetup 20150717: TDD Your AngularJS + Ionic Directives With jQ...
MEAN Stack NYC Meetup 20150717: TDD Your AngularJS + Ionic Directives With jQ...
Valeri Karpov
 
MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona Workshop
Valeri Karpov
 
JS-IL Keynote: MongoDB 2.6, Mongoose 4.0, and Beyond
JS-IL Keynote: MongoDB 2.6, Mongoose 4.0, and BeyondJS-IL Keynote: MongoDB 2.6, Mongoose 4.0, and Beyond
JS-IL Keynote: MongoDB 2.6, Mongoose 4.0, and Beyond
Valeri Karpov
 
MEAN Stack Workshop at Node Philly, 4/9/14
MEAN Stack Workshop at Node Philly, 4/9/14MEAN Stack Workshop at Node Philly, 4/9/14
MEAN Stack Workshop at Node Philly, 4/9/14
Valeri Karpov
 
MongoDB: Queries and Aggregation Framework with NBA Game Data
MongoDB: Queries and Aggregation Framework with NBA Game DataMongoDB: Queries and Aggregation Framework with NBA Game Data
MongoDB: Queries and Aggregation Framework with NBA Game Data
Valeri Karpov
 
Mongo db in 3 minutes BoilerMake
Mongo db in 3 minutes   BoilerMakeMongo db in 3 minutes   BoilerMake
Mongo db in 3 minutes BoilerMake
Valeri Karpov
 

More from Valeri Karpov (20)

A Practical Introduction to GeoJSON
A Practical Introduction to GeoJSONA Practical Introduction to GeoJSON
A Practical Introduction to GeoJSON
 
Introducing Async/Await
Introducing Async/AwaitIntroducing Async/Await
Introducing Async/Await
 
TAO and the Essence of Modern JavaScript
TAO and the Essence of Modern JavaScriptTAO and the Essence of Modern JavaScript
TAO and the Essence of Modern JavaScript
 
Mastering Async/Await in JavaScript
Mastering Async/Await in JavaScriptMastering Async/Await in JavaScript
Mastering Async/Await in JavaScript
 
React, Redux, and Archetype
React, Redux, and ArchetypeReact, Redux, and Archetype
React, Redux, and Archetype
 
TDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDBTDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDB
 
Conquering AngularJS Limitations
Conquering AngularJS LimitationsConquering AngularJS Limitations
Conquering AngularJS Limitations
 
MongoDB MEAN Stack Webinar October 7, 2015
MongoDB MEAN Stack Webinar October 7, 2015MongoDB MEAN Stack Webinar October 7, 2015
MongoDB MEAN Stack Webinar October 7, 2015
 
MEAN Stack NYC Meetup 20150717: TDD Your AngularJS + Ionic Directives With jQ...
MEAN Stack NYC Meetup 20150717: TDD Your AngularJS + Ionic Directives With jQ...MEAN Stack NYC Meetup 20150717: TDD Your AngularJS + Ionic Directives With jQ...
MEAN Stack NYC Meetup 20150717: TDD Your AngularJS + Ionic Directives With jQ...
 
Lessons in Open Source from the MongooseJS ODM
Lessons in Open Source from the MongooseJS ODMLessons in Open Source from the MongooseJS ODM
Lessons in Open Source from the MongooseJS ODM
 
Nimrod: MongoDB Shell in NodeJS (JSConfUY 2015)
Nimrod: MongoDB Shell in NodeJS (JSConfUY 2015)Nimrod: MongoDB Shell in NodeJS (JSConfUY 2015)
Nimrod: MongoDB Shell in NodeJS (JSConfUY 2015)
 
MongoDB Miami Meetup 1/26/15: Introduction to WiredTiger
MongoDB Miami Meetup 1/26/15: Introduction to WiredTigerMongoDB Miami Meetup 1/26/15: Introduction to WiredTiger
MongoDB Miami Meetup 1/26/15: Introduction to WiredTiger
 
MongoDB API Talk @ HackPrinceton
MongoDB API Talk @ HackPrincetonMongoDB API Talk @ HackPrinceton
MongoDB API Talk @ HackPrinceton
 
MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona Workshop
 
MongoDB Israel June Meetup
MongoDB Israel June MeetupMongoDB Israel June Meetup
MongoDB Israel June Meetup
 
JS-IL: Getting MEAN in 1 Hour
JS-IL: Getting MEAN in 1 HourJS-IL: Getting MEAN in 1 Hour
JS-IL: Getting MEAN in 1 Hour
 
JS-IL Keynote: MongoDB 2.6, Mongoose 4.0, and Beyond
JS-IL Keynote: MongoDB 2.6, Mongoose 4.0, and BeyondJS-IL Keynote: MongoDB 2.6, Mongoose 4.0, and Beyond
JS-IL Keynote: MongoDB 2.6, Mongoose 4.0, and Beyond
 
MEAN Stack Workshop at Node Philly, 4/9/14
MEAN Stack Workshop at Node Philly, 4/9/14MEAN Stack Workshop at Node Philly, 4/9/14
MEAN Stack Workshop at Node Philly, 4/9/14
 
MongoDB: Queries and Aggregation Framework with NBA Game Data
MongoDB: Queries and Aggregation Framework with NBA Game DataMongoDB: Queries and Aggregation Framework with NBA Game Data
MongoDB: Queries and Aggregation Framework with NBA Game Data
 
Mongo db in 3 minutes BoilerMake
Mongo db in 3 minutes   BoilerMakeMongo db in 3 minutes   BoilerMake
Mongo db in 3 minutes BoilerMake
 

Recently uploaded

Recently uploaded (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 

A Gentle Introduction to Functions-as-a-Service

  • 1. A Gentle Introduction to Functions-as-a-Service Valeri Karpov @code_barbarian github.com/vkarpov15
  • 2. About Me ● Backend Lead @ Booster, Node.js OSS ● Core contributor for Mongoose, Mocha ● Blogger, thecodebarbarian.com ● Early employee at LevelUp, MongoDB, Booster ● Invented the MEAN stack
  • 3. What’s This Talk About? ● The progression of dev-ops for startups ● Why FaaS is the next natural step for dev-ops ● Retaining state in “stateless” functions ● Trade-offs between different FaaS providers
  • 4. 2008: Physical Machine in Dorm Room ● EC2 was limited, other hosting services sucked ● LevelUp’s first release on an Ubuntu tower ○ Physical machines die or get shut down ○ Campus ISP is slow or changes the IP ○ Limited scale: shipping a new PC takes days
  • 5. 2012: Amazon EC2 ● My next few startups all ran on 1-5 EC2 VMs ● Cloud VMs solve most physical machine issues ○ Power outages much less likely ○ Reliable internet maintained by Amazon ○ Spinning up a new VM takes minutes
  • 6. 2012: Amazon EC2 ● Vanilla EC2 was great for single server apps ● But what about multiple app servers? ○ 2 services on the same VM in isolation ○ Continuous Deployment ○ Scaling horizontally with a click
  • 7. 2015: Containers and Orchestration ● Docker, Mesos, Kubernetes, etc. ● Compelling for CD and isolation ● Still Have Problems with Resource Usage ○ Memory limits per VM ○ Docker hogs disk space
  • 8. Functions as a Service ● Instead of deploying an app, you deploy a bunch of stateless functions ● No VMs, no OS updates ● Resource limits (RAM, CPU) per function call ● Functions run in response to triggers
  • 9. API Gateways ● Cloud functions respond to triggers ● HTTP is a trigger, but what about: ○ API keys / auth ○ Rate limits ● FaaS providers have API Gateways for this
  • 10. FaaS Providers ● Amazon AWS Lambda ● Microsoft Azure Functions ● Google Cloud Functions ● IBM Cloud Functions ● Oracle Cloud Fn ● LunchBadger, + many more
  • 11. FaaS Open Source Libraries ● Kubeless ● OpenWhisk ● Fission
  • 12. FaaS Advantages ● Easier to scale, no need to worry about too much load on one service ● Cheaper for low-usage services ● Cheap and easy development environments ● Resource issues rare and easy to debug
  • 13. FaaS Problems ● No strong best practices yet ● Completely different way of writing apps ● Limited language support ● Managing triggers and API Gateways ● Sometimes you want to retain state...
  • 14. Why Retain State? ● Think about a persistent database connection
  • 15. Stateless is a Big Performance Problem ● Connecting to a database on every function call is slow
  • 16. But You Can Retain Global State ● Put db handle in global scope
  • 17. Common Trick Across FaaS Providers ● AWS Lambda: bit.ly/mongodb-lambda ● Azure Functions: bit.ly/mongodb-azure ○ Also With C#: bit.ly/csx-azure-state ● IBM Cloud: bit.ly/mongodb-ibm-cloud
  • 18. Trade-offs Between Popular Providers ● AWS Lambda ● Azure Functions ● Google Cloud Functions
  • 19. Size Restrictions ● Size limit per function (node_modules) ○ AWS Lambda: 50MB ○ Azure Functions: None (*) ○ Google Cloud: 100MB zipped, 500MB unzipped
  • 20. Primary Fee Structure ● AWS Lambda: $0.00001667 / GB-s, $0.20 / 1M ● Azure Functions: $0.000016 / GB-s, $0.20 / 1M ● Google Cloud: $0.0000025 / GB-s, $0.0000100 / GHz-s
  • 21. Hidden Fees: API Gateways ● AWS Lambda: $3.50 / 1M + data ● Azure Functions: no extra cost necessary ● Google Cloud Functions: no extra cost necessary
  • 22. Overall FaaS Recommendations ● Check out Azure Functions ● AWS Lambda and IBM Cloud are a mess
  • 23. Further Reading ● My Blog: ○ bit.ly/mongodb-azure ○ bit.ly/mongodb-ibm-cloud