SlideShare a Scribd company logo
Serverless and you
Where do I run my stateless code?
@gabidavila
gabi.dev
Gabi D'Ávila Ferrara

Developer Advocate - Google Cloud
Serverless Definitions
Serverless:
• Focus on code
• Don't worry about infrastructure
• Auto-scaling (+ scaling to 0)
• Pay what you use
Stateless:
• Doesn't store data
• Doesn't store application state
• No persistent storage
2@gabidavila
Let's talk about servers
@gabidavila
Is serverless the new 

"Shared Hosting"?
🤔
"It works on my machine"
- Every technical practitioner ever
@gabidavila
The "good" old days
• Named servers:
• Zeus, Thor, Odin, you get the gist!
• Certificate/user management by a SysAdmin
• FTP or SCP:
• Try uploading Magento via FTP...
• SVN or CVS to deploy code (if even!)
• Almost zero automation
6@gabidavila
The "modern" approach
• Machines are a commodity
• CI/CD
• Automation: Chef, Terraform, Puppet...
• Easier to scale horizontally
• Don't forget the keywords of the moment:
• Containers, Kubernetes
7@gabidavila
Questions:
@gabidavila
Is Kubernetes serverless ?
@gabidavila
10
NO.
@gabidavila
Should I use serverless 

for Blockchain?
@gabidavila
12
NO
@gabidavila
Morecontext
Serverless on Google Cloud Platform
13
Cloud RunCloud Functions App Engine
@gabidavila
Cloud Functions
14
• Single-purpose
• Mapped to Events or Triggers
• NodeJS - 10 / 8 / 6 (deprecated), Python, Go
• Use cases:
• Microservices
• IoT
• Data Processing / ETL
• Lightweight APIsCloud Functions
@gabidavila
Accepted platforms
15
Cloud Functions
16
Cloud Functions
DEMO
fn.gabi.fyi?message=[status_id]
18
Cloud Functions
def classify(request):
request_json = request.get_json()
if request.args and 'message' in request.args:
tweet = get_tweet(request.args.get('message'))
elif request_json and 'message' in request_json:
tweet = get_tweet(request_json['message'])
else:
return u'Please inform a message'
sentiment = get_sentiment(tweet['text'])
return flask.jsonify(
text = tweet['text'],
screen_name = tweet['screen_name'],
sentiment = sentiment['sentiment'],
score = sentiment['score'],
magnitude = sentiment['magnitude']
)
App Engine Standard
19
• Deploy an App
• Choose between 6 popular platforms
• Scale from 0 to "planet scale"
• Fully managed
App Engine
@gabidavila
Services and Versions
• Create services inside of the same App Engine project
• Create different versions (and serve them!) through different services
• Use cases:
• Do A/B testing
• Create dev, test, staging and prod environments!
20
App Engine Standard
@gabidavila
21
App Engine Standard
Service - dev Service - prod
App Engine
Receives traffic
Version A
InactiveInactive
Version B
Inactive
Version A
Active
Version B
Active
Inactive
Version C
Active
@gabidavila
Runtimes
22
App Engine Standard
@gabidavila
DEMO
app.gabi.fyi/status/[status_id]
24
App Engine Standard
class App < Sinatra::Base
before do
content_type 'application/json'
end
get '/status/:id' do
twitter_client = Tweets.new
language_client = GLanguage.new
tweet_status = twitter_client.status(params[:id])
response = language_client.sentiments(tweet_status[:full_text])
response[:version] = 'v1.1'
response.to_json
end
end
25
Deploying a Ruby App
$ gcloud app create
$ gcloud app deploy
# app.yaml
runtime: ruby25
entrypoint: bundle exec rackup
service: default
App Engine Standard
26
Deploy Multiple Services
$ gcloud app deploy app.yaml dev.yaml
# app.yaml
runtime: ruby25
entrypoint: bundle exec rackup
service: default
App Engine Standard
# dev.yaml
runtime: ruby25
entrypoint: bundle exec rackup
service: dev
Cloud Run (beta)
27
• Fully Managed or on Anthos
• Container based
• Revision based
• Scale to zero or up and the amount of requests:
• requests = concurrency /instance * max instances
• Up to 2Gi of memory/revision
• Cloud Run on Anthos limits by your GKE cluster
Cloud Run
@gabidavila
Runtimes
28
Cloud Run
@gabidavila
29
Cloud Run
@gabidavila
DEMO
run.gabi.fyi/status/[status_id]
31
Deploying a Ruby App
Cloud Run
# Dockerfile
FROM ruby:2.5.0-stretch
EXPOSE 8080
RUN bundle config --global frozen 1
WORKDIR /usr/src/app
COPY src/Gemfile* ./
RUN bundle install
COPY src/ .
CMD ["rackup"]
32
Deploying a container
Cloud Run
$ gcloud builds submit --tag gcr.io/PROJECT_ID/APP_NAME
$ gcloud builds submit --tag gcr.io/automlgabi/sentiment-analyzer
Create your Cloud Run service:
$ gcloud beta run deploy --image 
--tag gcr.io/automlgabi/sentiment-analyzer 
--platform managed
@gabidavila
How to choose?
@gabidavila
34
How to choose?
35
How to choose? (cont.)
Compare
App Engine standard
environment
Cloud 

Functions
Cloud

Run (beta)1
Cloud Run for Anthos
(beta)1
Deployment artifact App Function Container Container
Scale to zero Pods2
Free tier
Websockets
Languages
Java, Node.js, Python,
Go, PHP, Ruby, .NET
Node.js, Python, Go Any Any
HTTP/2 and gRPC
Custom domain
Request timeout 1 minute3 9 minutes 15 minutes 15 minutes
GPUs and TPUs 36
Concurrency Requests
• 1 request/instance:
• Cloud Functions
• Multiple requests/instance
• App Engine standard
• Cloud Run
• Cloud Run for Anthos
37@gabidavila
Mix and Match
@gabidavila
DEMO
@gabidavila
40
Video Intelligence, GCS, Cloud Functions & App Engine
@gabidavila
41@gabidavila
Thank you.
• Twitter: @gabidavila
• Website: gabi.dev
42

More Related Content

What's hot (20)

PDF
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Bobby Curtis
 
PDF
Extreme Replication - RMOUG Presentation
Bobby Curtis
 
PDF
OOW09 Ebs Tuning Final
jucaab
 
PDF
Oracle RAC - New Generation
Anil Nair
 
PDF
Rac 12c rel2_operational_best_practices_sangam_2017_as_pdf
Anil Nair
 
PDF
Oracle Drivers configuration for High Availability
Ludovico Caldara
 
PDF
Troubleshooting Cassandra (J.B. Langston, DataStax) | C* Summit 2016
DataStax
 
PDF
OUG Ireland Meet-up - Updates from Oracle Open World 2016
Brendan Tierney
 
PDF
Oracle ZDM KamaleshRamasamy Sangam2020
Kamalesh Ramasamy
 
PPTX
Database As A Service: OEM + ODA (OOW 15 Presentation)
Bobby Curtis
 
PPTX
How many ways to monitor oracle golden gate-Collaborate 14
Bobby Curtis
 
PPTX
Extreme replication at IOUG Collaborate 15
Bobby Curtis
 
PPTX
Oem12c patching -OOW13
Bobby Curtis
 
PDF
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Nelson Calero
 
PDF
Zero Downtime Migration
Software Park Thailand
 
PPTX
Coherence RoadMap 2018
harvraja
 
PPTX
Open Policy Agent for governance as a code
Alexander Tokarev
 
PDF
OUG Ireland Meet-up 12th January
Brendan Tierney
 
PDF
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Sandesh Rao
 
PPTX
Spark Streaming & Kafka-The Future of Stream Processing
Jack Gudenkauf
 
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Bobby Curtis
 
Extreme Replication - RMOUG Presentation
Bobby Curtis
 
OOW09 Ebs Tuning Final
jucaab
 
Oracle RAC - New Generation
Anil Nair
 
Rac 12c rel2_operational_best_practices_sangam_2017_as_pdf
Anil Nair
 
Oracle Drivers configuration for High Availability
Ludovico Caldara
 
Troubleshooting Cassandra (J.B. Langston, DataStax) | C* Summit 2016
DataStax
 
OUG Ireland Meet-up - Updates from Oracle Open World 2016
Brendan Tierney
 
Oracle ZDM KamaleshRamasamy Sangam2020
Kamalesh Ramasamy
 
Database As A Service: OEM + ODA (OOW 15 Presentation)
Bobby Curtis
 
How many ways to monitor oracle golden gate-Collaborate 14
Bobby Curtis
 
Extreme replication at IOUG Collaborate 15
Bobby Curtis
 
Oem12c patching -OOW13
Bobby Curtis
 
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Nelson Calero
 
Zero Downtime Migration
Software Park Thailand
 
Coherence RoadMap 2018
harvraja
 
Open Policy Agent for governance as a code
Alexander Tokarev
 
OUG Ireland Meet-up 12th January
Brendan Tierney
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Sandesh Rao
 
Spark Streaming & Kafka-The Future of Stream Processing
Jack Gudenkauf
 

Similar to Serverless and you - where do i run my stateless code (20)

PDF
Serverless and you @ Women Who Code London 2020
Gabriela Ferrara
 
PDF
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
wesley chun
 
PDF
Serverless computing with Google Cloud
wesley chun
 
PDF
Serverless Computing with Google Cloud
wesley chun
 
PDF
Powerful Google developer tools for immediate impact! (2023-24 C)
wesley chun
 
PDF
Google's serverless journey: past to present
wesley chun
 
PDF
Introduction to serverless computing on Google Cloud
wesley chun
 
PDF
Run your code serverlessly on Google's open cloud
wesley chun
 
PDF
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
NETWAYS
 
PDF
Serverless vs Serverfull.pdf
Luillyfe Blanco
 
PDF
Free the Functions with Fn project!
J On The Beach
 
PDF
Serverless: A love hate relationship
Jürgen Brüder
 
PDF
Where should I run my code? Serverless, Containers, Virtual Machines and more
Bret McGowen - NYC Google Developer Advocate
 
PDF
«Что такое serverless-архитектура и как с ней жить?» Николай Марков, Aligned ...
it-people
 
PDF
Google Cloud Serverless - Cloud Run, arquitecturas y casos de uso
Nicolás Lopéz
 
PDF
Powerful Google Cloud tools for your hack
wesley chun
 
PDF
DCEU 18: Docker Containers in a Serverless World
Docker, Inc.
 
PDF
Serverless Computing with Python
wesley chun
 
PPTX
Going Serverless with Kubeless In Google Container Engine (GKE)
Bitnami
 
PDF
GCP Meetup #3 - Approaches to Cloud Native Architectures
nine
 
Serverless and you @ Women Who Code London 2020
Gabriela Ferrara
 
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
wesley chun
 
Serverless computing with Google Cloud
wesley chun
 
Serverless Computing with Google Cloud
wesley chun
 
Powerful Google developer tools for immediate impact! (2023-24 C)
wesley chun
 
Google's serverless journey: past to present
wesley chun
 
Introduction to serverless computing on Google Cloud
wesley chun
 
Run your code serverlessly on Google's open cloud
wesley chun
 
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
NETWAYS
 
Serverless vs Serverfull.pdf
Luillyfe Blanco
 
Free the Functions with Fn project!
J On The Beach
 
Serverless: A love hate relationship
Jürgen Brüder
 
Where should I run my code? Serverless, Containers, Virtual Machines and more
Bret McGowen - NYC Google Developer Advocate
 
«Что такое serverless-архитектура и как с ней жить?» Николай Марков, Aligned ...
it-people
 
Google Cloud Serverless - Cloud Run, arquitecturas y casos de uso
Nicolás Lopéz
 
Powerful Google Cloud tools for your hack
wesley chun
 
DCEU 18: Docker Containers in a Serverless World
Docker, Inc.
 
Serverless Computing with Python
wesley chun
 
Going Serverless with Kubeless In Google Container Engine (GKE)
Bitnami
 
GCP Meetup #3 - Approaches to Cloud Native Architectures
nine
 
Ad

More from Gabriela Ferrara (19)

PDF
PHPDay 2019 - MySQL 8, not only good, great!
Gabriela Ferrara
 
PDF
PyTexas - Machine learning APIs by Example
Gabriela Ferrara
 
PDF
MySQL 8.0: not only good, it’s GREAT! - PHP UK 2019
Gabriela Ferrara
 
PDF
Laracon EU 2018: OMG MySQL 8.0 is out! are we there yet?
Gabriela Ferrara
 
PDF
DPC18 - Making the most out of MySQL
Gabriela Ferrara
 
PDF
DPC18 - OMG MySQL 8.0 is out! are we there yet?
Gabriela Ferrara
 
PDF
php[tek] - Making the most out of MySQL
Gabriela Ferrara
 
PDF
Diving into MySQL 5.7: advanced features
Gabriela Ferrara
 
PDF
MySQL 8.0 Preview: What Is Coming?
Gabriela Ferrara
 
PDF
LaravelSP - MySQL 5.7: introdução ao JSON Data Type
Gabriela Ferrara
 
PDF
SunshinePHP 2017 - Making the most out of MySQL
Gabriela Ferrara
 
PDF
MySQL 5.7 - 
Tirando o Máximo Proveito
Gabriela Ferrara
 
PDF
Strip your TEXT fields - Exeter Web Feb/2016
Gabriela Ferrara
 
PDF
Strip your TEXT fields
Gabriela Ferrara
 
PDF
Coding like a girl - DjangoCon
Gabriela Ferrara
 
PDF
LAMP: Desenvolvendo além do trivial
Gabriela Ferrara
 
PDF
Database Wizardry for Legacy Applications
Gabriela Ferrara
 
PDF
Coding like a girl - Youtube presentation
Gabriela Ferrara
 
PDF
Coding like a Girl
Gabriela Ferrara
 
PHPDay 2019 - MySQL 8, not only good, great!
Gabriela Ferrara
 
PyTexas - Machine learning APIs by Example
Gabriela Ferrara
 
MySQL 8.0: not only good, it’s GREAT! - PHP UK 2019
Gabriela Ferrara
 
Laracon EU 2018: OMG MySQL 8.0 is out! are we there yet?
Gabriela Ferrara
 
DPC18 - Making the most out of MySQL
Gabriela Ferrara
 
DPC18 - OMG MySQL 8.0 is out! are we there yet?
Gabriela Ferrara
 
php[tek] - Making the most out of MySQL
Gabriela Ferrara
 
Diving into MySQL 5.7: advanced features
Gabriela Ferrara
 
MySQL 8.0 Preview: What Is Coming?
Gabriela Ferrara
 
LaravelSP - MySQL 5.7: introdução ao JSON Data Type
Gabriela Ferrara
 
SunshinePHP 2017 - Making the most out of MySQL
Gabriela Ferrara
 
MySQL 5.7 - 
Tirando o Máximo Proveito
Gabriela Ferrara
 
Strip your TEXT fields - Exeter Web Feb/2016
Gabriela Ferrara
 
Strip your TEXT fields
Gabriela Ferrara
 
Coding like a girl - DjangoCon
Gabriela Ferrara
 
LAMP: Desenvolvendo além do trivial
Gabriela Ferrara
 
Database Wizardry for Legacy Applications
Gabriela Ferrara
 
Coding like a girl - Youtube presentation
Gabriela Ferrara
 
Coding like a Girl
Gabriela Ferrara
 
Ad

Recently uploaded (20)

PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Python basic programing language for automation
DanialHabibi2
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 

Serverless and you - where do i run my stateless code