SlideShare a Scribd company logo
1 of 23
Download to read offline
Python in The
Serverless
Era
Photo by Zack Spear
Icon by Serverless
◉ Chief Architect @
◉ Ex- :
Cloud Architect @ AutoCAD
◉ Find me at @benikbauer
I am Benny Bauer
Hello!
What is Serverless
Dev SaaS BaaS 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
How it works
Deploy your
code
Define
triggers
Code
execution
EVENT-DRIVEN
AUTO SCALING
+
AVAILABILITY
◉ HTTP requests
◉ Storage (e.g. file upload)
◉ DB (e.g. row insert)
◉ Scheduled tasks
◉ Messaging
◉ Many many more...
Other
- Scheduled tasks
- Distributed compute
API
- Web backend
- Mobile backend
- Bot
Use cases
Data processing
- IoT
- Streams (analytics,
logging, etc)
- Files (images, text, etc.)
Operations
- CI
- Policy enforcement
- Provisioning
Other
- Scheduled tasks
- Distributed compute
API
- Web backend
- Mobile backend
- Bot
Use cases
Data processing
- IoT
- Streams (analytics,
logging, etc)
- Files (images, text, etc.)
Operations
- CI
- Policy enforcement
- Provisioning
Things to be aware of
Stateless
Instances are ephemeral.
Store state on client-side,
cache or db.
Cold start
Latency (< 2 sec)
when container is
cold (upon first run or
inactivity).
Vendor lock-in
Integrations with other
services are the real bait.
Granularity
Unit of deployment is
nanoservice/function.
Costs
Cost-effective up to a
certain point.
Limitations
Execution time is 5 min.
Payload & disk sizes are
limited.
Let’s get to business!
Python & FaaS
Cloud providers
Python 2.7 & 3.6 are supported by:
● AWS
● OpenWhisk
● Microsoft Azure - experimental, still not GA
Configuration
- Event binding
- Resources definition
- Security roles
definition
The need for frameworks
Deployment
- Package
- Upload
- Rollback
Frameworks
Chalice
Serverless Framework
Zappa
One function only. Serves as a WSGI server
WSGI
Unique features:
● Global deployment
● “Keep warm” functionality
● SSL certification
● Support for AWS Lambda compatible python
libraries (lambda-packages & Manylinux
wheels)
Zappa
● Python Serverless Microframework for AWS
● Each endpoint is a separate function
Chalice
Chalice
$ pip install chalice
$ chalice new-project helloworld && cd helloworld
$ cat app.py
from chalice import Chalice
app = Chalice(app_name="helloworld")
@app.route("/")
def index():
return {"hello": "world"}
$ chalice deploy
Unique features:
● Automatic IAM policy generation
Chalice
Pywren
import pywren
def scrape(url):
# scrape it...
return data
wrenexec = pywren.default_executor()
futures = wrenexec.map(scrape, [url,...])
results = pywren.get_all_results(futures)
Credit: Sean Smith (https://blog.seanssmith.com/posts/pywren-web-scraping.html)Credit: Sean Smith (https://blog.seanssmith.com/posts/pywren-web-scraping.html)
Summary
What was it all about?
Takeaways
◉ Serverless is a fast & cost-effective way to
deliver many use cases with Python
◉ New frontiers for Python (frameworks, tooling,
etc.)
Any questions?
Thanks!
Slides template by SlidesCarnival
Find me at @benikbauer
This work is licensed under a CC Attribution 4.0 International License.

More Related Content

What's hot

What's hot (20)

Structuring node.js projects - Seven Peaks Software (Node.JS Meetup 18 nov 2021)
Structuring node.js projects - Seven Peaks Software (Node.JS Meetup 18 nov 2021)Structuring node.js projects - Seven Peaks Software (Node.JS Meetup 18 nov 2021)
Structuring node.js projects - Seven Peaks Software (Node.JS Meetup 18 nov 2021)
 
DevOps for the Enterprise: Virtual Office Hours
DevOps for the Enterprise: Virtual Office HoursDevOps for the Enterprise: Virtual Office Hours
DevOps for the Enterprise: Virtual Office Hours
 
Serverless architecture with AWS Lambda (June 2016)
Serverless architecture with AWS Lambda (June 2016)Serverless architecture with AWS Lambda (June 2016)
Serverless architecture with AWS Lambda (June 2016)
 
Sundog Media Toolkit
Sundog Media Toolkit Sundog Media Toolkit
Sundog Media Toolkit
 
使用 AWS 無伺服器運算服務打造您的第一個語音助理
使用 AWS 無伺服器運算服務打造您的第一個語音助理使用 AWS 無伺服器運算服務打造您的第一個語音助理
使用 AWS 無伺服器運算服務打造您的第一個語音助理
 
Serverless Framework Intro
Serverless Framework IntroServerless Framework Intro
Serverless Framework Intro
 
Rein in Your Cloud Costs with Terraform and AWS Lambda
Rein in Your Cloud Costs with Terraform and AWS LambdaRein in Your Cloud Costs with Terraform and AWS Lambda
Rein in Your Cloud Costs with Terraform and AWS Lambda
 
Powering Remote Developers with Amazon Workspaces
Powering Remote Developers with Amazon WorkspacesPowering Remote Developers with Amazon Workspaces
Powering Remote Developers with Amazon Workspaces
 
Serverless Reality
Serverless RealityServerless Reality
Serverless Reality
 
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
 
Infrastructure as code
Infrastructure as codeInfrastructure as code
Infrastructure as code
 
Serverless
ServerlessServerless
Serverless
 
(SDD420) Amazon WorkSpaces: Advanced Topics and Deep Dive | AWS re:Invent 2014
(SDD420) Amazon WorkSpaces: Advanced Topics and Deep Dive | AWS re:Invent 2014(SDD420) Amazon WorkSpaces: Advanced Topics and Deep Dive | AWS re:Invent 2014
(SDD420) Amazon WorkSpaces: Advanced Topics and Deep Dive | AWS re:Invent 2014
 
Azure functions
Azure functionsAzure functions
Azure functions
 
ITV& Bashton
ITV& Bashton ITV& Bashton
ITV& Bashton
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
 
A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)
 
Matt Chung (Independent) - Serverless application with AWS Lambda
Matt Chung (Independent) - Serverless application with AWS Lambda Matt Chung (Independent) - Serverless application with AWS Lambda
Matt Chung (Independent) - Serverless application with AWS Lambda
 
Serverless Stream Processing with Bill Bejeck
Serverless Stream Processing with Bill BejeckServerless Stream Processing with Bill Bejeck
Serverless Stream Processing with Bill Bejeck
 
Building a data warehouse with Amazon Redshift … and a quick look at Amazon ...
Building a data warehouse  with Amazon Redshift … and a quick look at Amazon ...Building a data warehouse  with Amazon Redshift … and a quick look at Amazon ...
Building a data warehouse with Amazon Redshift … and a quick look at Amazon ...
 

Similar to Python in the serverless era (PyCon 2017)

Build A Cloud Day London - Introduction
Build A Cloud Day London - IntroductionBuild A Cloud Day London - Introduction
Build A Cloud Day London - Introduction
ShapeBlue
 

Similar to Python in the serverless era (PyCon 2017) (20)

Build A Cloud Day London - Introduction
Build A Cloud Day London - IntroductionBuild A Cloud Day London - Introduction
Build A Cloud Day London - Introduction
 
Cloud State of the Union for Java Developers
Cloud State of the Union for Java DevelopersCloud State of the Union for Java Developers
Cloud State of the Union for Java Developers
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
AWS as platform for scalable applications
AWS as platform for scalable applicationsAWS as platform for scalable applications
AWS as platform for scalable applications
 
Automate the operation of your Oracle Cloud infrastructure v2.0
Automate the operation of your Oracle Cloud infrastructure v2.0Automate the operation of your Oracle Cloud infrastructure v2.0
Automate the operation of your Oracle Cloud infrastructure v2.0
 
Continuous Deployment @ AWS Re:Invent
Continuous Deployment @ AWS Re:InventContinuous Deployment @ AWS Re:Invent
Continuous Deployment @ AWS Re:Invent
 
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
 
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
 
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
 
Serverless cat detector workshop - cloudyna 2017 (16.12.2017)
Serverless cat detector   workshop - cloudyna 2017 (16.12.2017)Serverless cat detector   workshop - cloudyna 2017 (16.12.2017)
Serverless cat detector workshop - cloudyna 2017 (16.12.2017)
 
Apache OpenWhisk
Apache OpenWhiskApache OpenWhisk
Apache OpenWhisk
 
Keepler | Full-Stack Serverless Applications on GCP
Keepler | Full-Stack Serverless Applications on GCPKeepler | Full-Stack Serverless Applications on GCP
Keepler | Full-Stack Serverless Applications on GCP
 
AWS Webcast - Build Agile Applications in AWS Cloud for Government
AWS Webcast - Build Agile Applications in AWS Cloud for GovernmentAWS Webcast - Build Agile Applications in AWS Cloud for Government
AWS Webcast - Build Agile Applications in AWS Cloud for Government
 
AWS Webcast - Build Agile Applications in AWS Cloud for Government
AWS Webcast - Build Agile Applications in AWS Cloud for GovernmentAWS Webcast - Build Agile Applications in AWS Cloud for Government
AWS Webcast - Build Agile Applications in AWS Cloud for Government
 
Serverless OCR for NASA EVA: AWS Meetup DC 2017-12-12
Serverless OCR for NASA EVA: AWS Meetup DC 2017-12-12Serverless OCR for NASA EVA: AWS Meetup DC 2017-12-12
Serverless OCR for NASA EVA: AWS Meetup DC 2017-12-12
 
Deploying Serverless Cloud Optical Character Recognition in Support of NASA A...
Deploying Serverless Cloud Optical Character Recognition in Support of NASA A...Deploying Serverless Cloud Optical Character Recognition in Support of NASA A...
Deploying Serverless Cloud Optical Character Recognition in Support of NASA A...
 
Serverless Optical Character Recognition in support of Astronaut Safety AWS M...
Serverless Optical Character Recognition in support of Astronaut Safety AWS M...Serverless Optical Character Recognition in support of Astronaut Safety AWS M...
Serverless Optical Character Recognition in support of Astronaut Safety AWS M...
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
HOW TO DRONE.IO IN CI/CD WORLD
HOW TO DRONE.IO IN CI/CD WORLDHOW TO DRONE.IO IN CI/CD WORLD
HOW TO DRONE.IO IN CI/CD WORLD
 
Concevoir une application scalable dans le Cloud
Concevoir une application scalable dans le CloudConcevoir une application scalable dans le Cloud
Concevoir une application scalable dans le Cloud
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Recently uploaded (20)

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

Python in the serverless era (PyCon 2017)

  • 1. Python in The Serverless Era Photo by Zack Spear Icon by Serverless
  • 2. ◉ Chief Architect @ ◉ Ex- : Cloud Architect @ AutoCAD ◉ Find me at @benikbauer I am Benny Bauer Hello!
  • 3. What is Serverless Dev SaaS BaaS FaaS
  • 4. 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
  • 5. How it works Deploy your code Define triggers Code execution EVENT-DRIVEN AUTO SCALING + AVAILABILITY ◉ HTTP requests ◉ Storage (e.g. file upload) ◉ DB (e.g. row insert) ◉ Scheduled tasks ◉ Messaging ◉ Many many more...
  • 6. Other - Scheduled tasks - Distributed compute API - Web backend - Mobile backend - Bot Use cases Data processing - IoT - Streams (analytics, logging, etc) - Files (images, text, etc.) Operations - CI - Policy enforcement - Provisioning
  • 7. Other - Scheduled tasks - Distributed compute API - Web backend - Mobile backend - Bot Use cases Data processing - IoT - Streams (analytics, logging, etc) - Files (images, text, etc.) Operations - CI - Policy enforcement - Provisioning
  • 8. Things to be aware of Stateless Instances are ephemeral. Store state on client-side, cache or db. Cold start Latency (< 2 sec) when container is cold (upon first run or inactivity). Vendor lock-in Integrations with other services are the real bait. Granularity Unit of deployment is nanoservice/function. Costs Cost-effective up to a certain point. Limitations Execution time is 5 min. Payload & disk sizes are limited.
  • 9. Let’s get to business! Python & FaaS
  • 10. Cloud providers Python 2.7 & 3.6 are supported by: ● AWS ● OpenWhisk ● Microsoft Azure - experimental, still not GA
  • 11. Configuration - Event binding - Resources definition - Security roles definition The need for frameworks Deployment - Package - Upload - Rollback
  • 14. Zappa One function only. Serves as a WSGI server WSGI
  • 15. Unique features: ● Global deployment ● “Keep warm” functionality ● SSL certification ● Support for AWS Lambda compatible python libraries (lambda-packages & Manylinux wheels) Zappa
  • 16. ● Python Serverless Microframework for AWS ● Each endpoint is a separate function Chalice
  • 17. Chalice $ pip install chalice $ chalice new-project helloworld && cd helloworld $ cat app.py from chalice import Chalice app = Chalice(app_name="helloworld") @app.route("/") def index(): return {"hello": "world"} $ chalice deploy
  • 18. Unique features: ● Automatic IAM policy generation Chalice
  • 20. import pywren def scrape(url): # scrape it... return data wrenexec = pywren.default_executor() futures = wrenexec.map(scrape, [url,...]) results = pywren.get_all_results(futures) Credit: Sean Smith (https://blog.seanssmith.com/posts/pywren-web-scraping.html)Credit: Sean Smith (https://blog.seanssmith.com/posts/pywren-web-scraping.html)
  • 21. Summary What was it all about?
  • 22. Takeaways ◉ Serverless is a fast & cost-effective way to deliver many use cases with Python ◉ New frontiers for Python (frameworks, tooling, etc.)
  • 23. Any questions? Thanks! Slides template by SlidesCarnival Find me at @benikbauer This work is licensed under a CC Attribution 4.0 International License.