SlideShare a Scribd company logo
Firebase Cloud Functions
the GA, the Beta, and the Ugly
Joseph Lust mabl engineer @lustcoder
“The secret of change is to focus all of your
energy, not on fighting the old, but on building
the new.”
–Socrates
startups must push or perish
4
serverless just works
■ No Provisioning
■ Transparent Scaling
■ Event Driven
■ Pay only for Use
5
how developers deploy code
2014
2007 2013
VPS
Machine
Image
Docker
Containers
war File
AWS
Lambda
6
2000
Container Era
Serverless Era
Firebase
CF
Serverless functions
GCF
2016 2017
event driven all the way
Trigger Events Firebase CF GCF
Cloud Storage Events ✔ ✔
PubSub Topics ✔ ✔
HTTP Endpoint ✔ ✔
Auth Events ✔ ✘
Database Events ✔ ✘
Google Analytics Events ✔ ✘
7
no function provider is a clear winner
Features Firebase CF GCF
Stackdriver Error Reports ✔ ✔
Cloud Logging ✔ ✔
Environment Configs ✔ ✘
Code Based Wireup ✔ ✘
Rich Function Dashboard ✘ ✔
Deployment Wireup ✘ ✔
SCM Base Deploy ✘ ✔
8
function clarity through dashboards
9
live function health tracking
10
but, there are some speed bumps...
12
the ugly: firebase cloud functions
■ All functions run as FB project Editor
■ No failure retry semantics
■ Cannot access resources cross project
■ CLI deploy requires rigid project layout
■ Automatic undeploy of all functions for non-standard layouts
■ Slow deployment ~ 5min
13
the uglier: gcf
■ Cannot pass configs to function
■ No failure retry semantics
■ All functions run as project Editor
■ Complex multi-module deploy
▲ Impossible from SCM deploy
■ Slow deployment ~ 2min
■ Non-Deterministic Deployment Failures
■ Single Supported Region (Iowa US-Centra1)
14
functions are not designed for failure
15
functions require total trust
16
blazing fast function deployment
17
lossy pubsub deployments
18
work arounds to the rescue
19
work around the warts
■ Load ServiceAccount key from KMS encrypted CS file
■ Cache resources between function calls
■ Use Firebase Admin lib from GCF
▲ Best of most worlds
■ Use the lowest sensible memory and timeout limits
■ Use --local-path and --include-ignored-files for multi-module deploy
20
embrace serverless
■ to focus on shipping code
■ to harness NodeJS microservices
■ to power low latency experiences
■ to provision, deploy, and scale automatically
21
cloud functions resources
■ FB CF Examples Repo: github.com/firebase/functions-samples
■ GCF Examples: github.com/GoogleCloudPlatform/nodejs-docs-samples
■ I/O 2017 CF Presentations
▲ Building the Fire!sale demo app: youtu.be/G-MBeEW92v4
▲ FB and ML with CF: youtu.be/RdqV_N0sCpM
▲ FB CF and Testability: youtu.be/SnWwkURpwxs
▲ Data Pipelines with CF: youtu.be/guo-4IOqx2M
22
Questions?
gcf is cheaper by half
■ FB CF 125K req/mo FREE, 2.5M/ $1
■ GCF 2M req/mo FREE, 5M/ $1 after
* Also see execution time, bandwidth, and memory costs
Source GCP Pricing, FB Pricing
24

More Related Content

What's hot

Serverless with Google Cloud Functions
Serverless with Google Cloud FunctionsServerless with Google Cloud Functions
Serverless with Google Cloud Functions
Jerry Jalava
 
Serverless Big Data Architecture on Google Cloud Platform at Credit OK
Serverless Big Data Architecture on Google Cloud Platform at Credit OKServerless Big Data Architecture on Google Cloud Platform at Credit OK
Serverless Big Data Architecture on Google Cloud Platform at Credit OK
Kriangkrai Chaonithi
 
Introduction to Serverless and Google Cloud Functions
Introduction to Serverless and Google Cloud FunctionsIntroduction to Serverless and Google Cloud Functions
Introduction to Serverless and Google Cloud Functions
Malepati Bala Siva Sai Akhil
 
AWS ElasticBeanstalk and Docker
AWS ElasticBeanstalk and Docker AWS ElasticBeanstalk and Docker
AWS ElasticBeanstalk and Docker
kloia
 
Kubeflow on google kubernetes engine
Kubeflow on google kubernetes engineKubeflow on google kubernetes engine
Kubeflow on google kubernetes engine
Bear Su
 
Going Microserverless on Google Cloud
Going Microserverless on Google CloudGoing Microserverless on Google Cloud
Going Microserverless on Google Cloud
Joseph Lust
 
Going Microserverless on Google Cloud @ mabl
Going Microserverless on Google Cloud @ mablGoing Microserverless on Google Cloud @ mabl
Going Microserverless on Google Cloud @ mabl
Joseph Lust
 
Serverless Apps on Google Cloud: more dev, less ops
Serverless Apps on Google Cloud:  more dev, less opsServerless Apps on Google Cloud:  more dev, less ops
Serverless Apps on Google Cloud: more dev, less ops
Joseph Lust
 
GCPUG.TW - GCP學習資源分享
GCPUG.TW - GCP學習資源分享GCPUG.TW - GCP學習資源分享
GCPUG.TW - GCP學習資源分享
Simon Su
 
Life of a startup - Sjoerd Mulder - Codemotion Amsterdam 2017
Life of a startup - Sjoerd Mulder - Codemotion Amsterdam 2017Life of a startup - Sjoerd Mulder - Codemotion Amsterdam 2017
Life of a startup - Sjoerd Mulder - Codemotion Amsterdam 2017
Codemotion
 
Cloud-Native Drupal: a survival guide
Cloud-Native Drupal: a survival guideCloud-Native Drupal: a survival guide
Cloud-Native Drupal: a survival guide
sparkfabrik
 
Experiences sharing about Lambda, Kinesis, and Postgresql
Experiences sharing about Lambda, Kinesis, and PostgresqlExperiences sharing about Lambda, Kinesis, and Postgresql
Experiences sharing about Lambda, Kinesis, and Postgresql
Okis Chuang
 
Introduction to Modern DevOps Technologies
Introduction to  Modern DevOps TechnologiesIntroduction to  Modern DevOps Technologies
Introduction to Modern DevOps Technologies
Kriangkrai Chaonithi
 
CloudDesignPatterns
CloudDesignPatternsCloudDesignPatterns
CloudDesignPatterns
Oliver Fierro
 
From training to explainability via git ops
From training to explainability via git opsFrom training to explainability via git ops
From training to explainability via git ops
Ryan Dawson
 
Performance Tales of Serverless - CloudNative London 2018
Performance Tales of Serverless - CloudNative London 2018Performance Tales of Serverless - CloudNative London 2018
Performance Tales of Serverless - CloudNative London 2018
☁️ Mikhail Shilkov
 

What's hot (16)

Serverless with Google Cloud Functions
Serverless with Google Cloud FunctionsServerless with Google Cloud Functions
Serverless with Google Cloud Functions
 
Serverless Big Data Architecture on Google Cloud Platform at Credit OK
Serverless Big Data Architecture on Google Cloud Platform at Credit OKServerless Big Data Architecture on Google Cloud Platform at Credit OK
Serverless Big Data Architecture on Google Cloud Platform at Credit OK
 
Introduction to Serverless and Google Cloud Functions
Introduction to Serverless and Google Cloud FunctionsIntroduction to Serverless and Google Cloud Functions
Introduction to Serverless and Google Cloud Functions
 
AWS ElasticBeanstalk and Docker
AWS ElasticBeanstalk and Docker AWS ElasticBeanstalk and Docker
AWS ElasticBeanstalk and Docker
 
Kubeflow on google kubernetes engine
Kubeflow on google kubernetes engineKubeflow on google kubernetes engine
Kubeflow on google kubernetes engine
 
Going Microserverless on Google Cloud
Going Microserverless on Google CloudGoing Microserverless on Google Cloud
Going Microserverless on Google Cloud
 
Going Microserverless on Google Cloud @ mabl
Going Microserverless on Google Cloud @ mablGoing Microserverless on Google Cloud @ mabl
Going Microserverless on Google Cloud @ mabl
 
Serverless Apps on Google Cloud: more dev, less ops
Serverless Apps on Google Cloud:  more dev, less opsServerless Apps on Google Cloud:  more dev, less ops
Serverless Apps on Google Cloud: more dev, less ops
 
GCPUG.TW - GCP學習資源分享
GCPUG.TW - GCP學習資源分享GCPUG.TW - GCP學習資源分享
GCPUG.TW - GCP學習資源分享
 
Life of a startup - Sjoerd Mulder - Codemotion Amsterdam 2017
Life of a startup - Sjoerd Mulder - Codemotion Amsterdam 2017Life of a startup - Sjoerd Mulder - Codemotion Amsterdam 2017
Life of a startup - Sjoerd Mulder - Codemotion Amsterdam 2017
 
Cloud-Native Drupal: a survival guide
Cloud-Native Drupal: a survival guideCloud-Native Drupal: a survival guide
Cloud-Native Drupal: a survival guide
 
Experiences sharing about Lambda, Kinesis, and Postgresql
Experiences sharing about Lambda, Kinesis, and PostgresqlExperiences sharing about Lambda, Kinesis, and Postgresql
Experiences sharing about Lambda, Kinesis, and Postgresql
 
Introduction to Modern DevOps Technologies
Introduction to  Modern DevOps TechnologiesIntroduction to  Modern DevOps Technologies
Introduction to Modern DevOps Technologies
 
CloudDesignPatterns
CloudDesignPatternsCloudDesignPatterns
CloudDesignPatterns
 
From training to explainability via git ops
From training to explainability via git opsFrom training to explainability via git ops
From training to explainability via git ops
 
Performance Tales of Serverless - CloudNative London 2018
Performance Tales of Serverless - CloudNative London 2018Performance Tales of Serverless - CloudNative London 2018
Performance Tales of Serverless - CloudNative London 2018
 

Similar to Firebase Cloud Functions: a quick overview

Embracing Serverless with Google
Embracing Serverless with GoogleEmbracing Serverless with Google
Embracing Serverless with Google
mabl
 
Serverless Apps on Google Cloud: more dev, less ops
Serverless Apps on Google Cloud: more dev, less opsServerless Apps on Google Cloud: more dev, less ops
Serverless Apps on Google Cloud: more dev, less ops
mabl
 
Going Microserverless on Google Cloud @ mabl
Going Microserverless on Google Cloud @ mablGoing Microserverless on Google Cloud @ mabl
Going Microserverless on Google Cloud @ mabl
mabl
 
Up and Running with firebase
Up and Running with firebaseUp and Running with firebase
Up and Running with firebase
Md. Sadhan Sarker
 
IDEALIZE 2023 - NodeJS & Firebase Session
IDEALIZE 2023 - NodeJS & Firebase SessionIDEALIZE 2023 - NodeJS & Firebase Session
IDEALIZE 2023 - NodeJS & Firebase Session
Brion Mario
 
Automation of Hadoop cluster operations in Arm Treasure Data
Automation of Hadoop cluster operations in Arm Treasure DataAutomation of Hadoop cluster operations in Arm Treasure Data
Automation of Hadoop cluster operations in Arm Treasure Data
Yan Wang
 
Spring Boot & Spring Cloud on k8s and PCF
Spring Boot & Spring Cloud on k8s and PCFSpring Boot & Spring Cloud on k8s and PCF
Spring Boot & Spring Cloud on k8s and PCF
Lars Rosenquist
 
Serverless preview environments to the rescue
Serverless preview environments to the rescueServerless preview environments to the rescue
Serverless preview environments to the rescue
Joseph Lust
 
Best practices for developing your Magento Commerce on Cloud
Best practices for developing your Magento Commerce on CloudBest practices for developing your Magento Commerce on Cloud
Best practices for developing your Magento Commerce on Cloud
Oleg Posyniak
 
Advanced Code Flow, Notes From the Field
Advanced Code Flow, Notes From the FieldAdvanced Code Flow, Notes From the Field
Advanced Code Flow, Notes From the Field
Ariel Moskovich
 
Cloud Native Java Development Patterns
Cloud Native Java Development PatternsCloud Native Java Development Patterns
Cloud Native Java Development Patterns
Bilgin Ibryam
 
Serverless Architecture GCP In Production
Serverless Architecture GCP In ProductionServerless Architecture GCP In Production
Serverless Architecture GCP In Production
Oliver Fierro
 
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
NETWAYS
 
LINE's Private Cloud - Meet Cloud Native World
LINE's Private Cloud - Meet Cloud Native WorldLINE's Private Cloud - Meet Cloud Native World
LINE's Private Cloud - Meet Cloud Native World
LINE Corporation
 
Serverless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOpsServerless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOps
Joseph Lust
 
State of serverless
State of serverlessState of serverless
State of serverless
Anurag Saran
 
The FN Project by Maximilian Jerg
The FN Project by Maximilian JergThe FN Project by Maximilian Jerg
The FN Project by Maximilian Jerg
Harald Schmaldienst
 
From airflow to google cloud composer
From airflow to google cloud composerFrom airflow to google cloud composer
From airflow to google cloud composer
Bruce Kuo
 
Sprint 17
Sprint 17Sprint 17
Sprint 17
ManageIQ
 
Cloud-native Java EE-volution
Cloud-native Java EE-volutionCloud-native Java EE-volution
Cloud-native Java EE-volution
QAware GmbH
 

Similar to Firebase Cloud Functions: a quick overview (20)

Embracing Serverless with Google
Embracing Serverless with GoogleEmbracing Serverless with Google
Embracing Serverless with Google
 
Serverless Apps on Google Cloud: more dev, less ops
Serverless Apps on Google Cloud: more dev, less opsServerless Apps on Google Cloud: more dev, less ops
Serverless Apps on Google Cloud: more dev, less ops
 
Going Microserverless on Google Cloud @ mabl
Going Microserverless on Google Cloud @ mablGoing Microserverless on Google Cloud @ mabl
Going Microserverless on Google Cloud @ mabl
 
Up and Running with firebase
Up and Running with firebaseUp and Running with firebase
Up and Running with firebase
 
IDEALIZE 2023 - NodeJS & Firebase Session
IDEALIZE 2023 - NodeJS & Firebase SessionIDEALIZE 2023 - NodeJS & Firebase Session
IDEALIZE 2023 - NodeJS & Firebase Session
 
Automation of Hadoop cluster operations in Arm Treasure Data
Automation of Hadoop cluster operations in Arm Treasure DataAutomation of Hadoop cluster operations in Arm Treasure Data
Automation of Hadoop cluster operations in Arm Treasure Data
 
Spring Boot & Spring Cloud on k8s and PCF
Spring Boot & Spring Cloud on k8s and PCFSpring Boot & Spring Cloud on k8s and PCF
Spring Boot & Spring Cloud on k8s and PCF
 
Serverless preview environments to the rescue
Serverless preview environments to the rescueServerless preview environments to the rescue
Serverless preview environments to the rescue
 
Best practices for developing your Magento Commerce on Cloud
Best practices for developing your Magento Commerce on CloudBest practices for developing your Magento Commerce on Cloud
Best practices for developing your Magento Commerce on Cloud
 
Advanced Code Flow, Notes From the Field
Advanced Code Flow, Notes From the FieldAdvanced Code Flow, Notes From the Field
Advanced Code Flow, Notes From the Field
 
Cloud Native Java Development Patterns
Cloud Native Java Development PatternsCloud Native Java Development Patterns
Cloud Native Java Development Patterns
 
Serverless Architecture GCP In Production
Serverless Architecture GCP In ProductionServerless Architecture GCP In Production
Serverless Architecture GCP In Production
 
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
 
LINE's Private Cloud - Meet Cloud Native World
LINE's Private Cloud - Meet Cloud Native WorldLINE's Private Cloud - Meet Cloud Native World
LINE's Private Cloud - Meet Cloud Native World
 
Serverless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOpsServerless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOps
 
State of serverless
State of serverlessState of serverless
State of serverless
 
The FN Project by Maximilian Jerg
The FN Project by Maximilian JergThe FN Project by Maximilian Jerg
The FN Project by Maximilian Jerg
 
From airflow to google cloud composer
From airflow to google cloud composerFrom airflow to google cloud composer
From airflow to google cloud composer
 
Sprint 17
Sprint 17Sprint 17
Sprint 17
 
Cloud-native Java EE-volution
Cloud-native Java EE-volutionCloud-native Java EE-volution
Cloud-native Java EE-volution
 

Recently uploaded

Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 

Recently uploaded (20)

Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 

Firebase Cloud Functions: a quick overview

  • 1. Firebase Cloud Functions the GA, the Beta, and the Ugly Joseph Lust mabl engineer @lustcoder
  • 2.
  • 3. “The secret of change is to focus all of your energy, not on fighting the old, but on building the new.” –Socrates
  • 4. startups must push or perish 4
  • 5. serverless just works ■ No Provisioning ■ Transparent Scaling ■ Event Driven ■ Pay only for Use 5
  • 6. how developers deploy code 2014 2007 2013 VPS Machine Image Docker Containers war File AWS Lambda 6 2000 Container Era Serverless Era Firebase CF Serverless functions GCF 2016 2017
  • 7. event driven all the way Trigger Events Firebase CF GCF Cloud Storage Events ✔ ✔ PubSub Topics ✔ ✔ HTTP Endpoint ✔ ✔ Auth Events ✔ ✘ Database Events ✔ ✘ Google Analytics Events ✔ ✘ 7
  • 8. no function provider is a clear winner Features Firebase CF GCF Stackdriver Error Reports ✔ ✔ Cloud Logging ✔ ✔ Environment Configs ✔ ✘ Code Based Wireup ✔ ✘ Rich Function Dashboard ✘ ✔ Deployment Wireup ✘ ✔ SCM Base Deploy ✘ ✔ 8
  • 10. live function health tracking 10
  • 11.
  • 12. but, there are some speed bumps... 12
  • 13. the ugly: firebase cloud functions ■ All functions run as FB project Editor ■ No failure retry semantics ■ Cannot access resources cross project ■ CLI deploy requires rigid project layout ■ Automatic undeploy of all functions for non-standard layouts ■ Slow deployment ~ 5min 13
  • 14. the uglier: gcf ■ Cannot pass configs to function ■ No failure retry semantics ■ All functions run as project Editor ■ Complex multi-module deploy ▲ Impossible from SCM deploy ■ Slow deployment ~ 2min ■ Non-Deterministic Deployment Failures ■ Single Supported Region (Iowa US-Centra1) 14
  • 15. functions are not designed for failure 15
  • 17. blazing fast function deployment 17
  • 19. work arounds to the rescue 19
  • 20. work around the warts ■ Load ServiceAccount key from KMS encrypted CS file ■ Cache resources between function calls ■ Use Firebase Admin lib from GCF ▲ Best of most worlds ■ Use the lowest sensible memory and timeout limits ■ Use --local-path and --include-ignored-files for multi-module deploy 20
  • 21. embrace serverless ■ to focus on shipping code ■ to harness NodeJS microservices ■ to power low latency experiences ■ to provision, deploy, and scale automatically 21
  • 22. cloud functions resources ■ FB CF Examples Repo: github.com/firebase/functions-samples ■ GCF Examples: github.com/GoogleCloudPlatform/nodejs-docs-samples ■ I/O 2017 CF Presentations ▲ Building the Fire!sale demo app: youtu.be/G-MBeEW92v4 ▲ FB and ML with CF: youtu.be/RdqV_N0sCpM ▲ FB CF and Testability: youtu.be/SnWwkURpwxs ▲ Data Pipelines with CF: youtu.be/guo-4IOqx2M 22
  • 24. gcf is cheaper by half ■ FB CF 125K req/mo FREE, 2.5M/ $1 ■ GCF 2M req/mo FREE, 5M/ $1 after * Also see execution time, bandwidth, and memory costs Source GCP Pricing, FB Pricing 24