Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
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
Ser...
event driven all the way
Trigger Events Firebase CF GCF
Cloud Storage Events ✔ ✔
PubSub Topics ✔ ✔
HTTP Endpoint ✔ ✔
Auth ...
no function provider is a clear winner
Features Firebase CF GCF
Stackdriver Error Reports ✔ ✔
Cloud Logging ✔ ✔
Environmen...
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 r...
the uglier: gcf
■ Cannot pass configs to function
■ No failure retry semantics
■ All functions run as project Editor
■ Com...
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 ...
embrace serverless
■ to focus on shipping code
■ to harness NodeJS microservices
■ to power low latency experiences
■ to p...
cloud functions resources
■ FB CF Examples Repo: github.com/firebase/functions-samples
■ GCF Examples: github.com/GoogleCl...
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, ba...
Firebase Cloud Functions: a quick overview
Firebase Cloud Functions: a quick overview
Upcoming SlideShare
Loading in …5
×

Firebase Cloud Functions: a quick overview

29,421 views

Published on

Embrace Serverless computing with Firebase and Google Cloud Functions. Focus on code, not servers and scaling.

Published in: Technology
  • Dating direct: ♥♥♥ http://bit.ly/39mQKz3 ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Follow the link, new dating source: ❤❤❤ http://bit.ly/39mQKz3 ❤❤❤
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Firebase Cloud Functions: a quick overview

  1. 1. Firebase Cloud Functions the GA, the Beta, and the Ugly Joseph Lust mabl engineer @lustcoder
  2. 2. “The secret of change is to focus all of your energy, not on fighting the old, but on building the new.” –Socrates
  3. 3. startups must push or perish 4
  4. 4. serverless just works ■ No Provisioning ■ Transparent Scaling ■ Event Driven ■ Pay only for Use 5
  5. 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
  6. 6. 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
  7. 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
  8. 8. function clarity through dashboards 9
  9. 9. live function health tracking 10
  10. 10. but, there are some speed bumps... 12
  11. 11. 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
  12. 12. 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
  13. 13. functions are not designed for failure 15
  14. 14. functions require total trust 16
  15. 15. blazing fast function deployment 17
  16. 16. lossy pubsub deployments 18
  17. 17. work arounds to the rescue 19
  18. 18. 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
  19. 19. embrace serverless ■ to focus on shipping code ■ to harness NodeJS microservices ■ to power low latency experiences ■ to provision, deploy, and scale automatically 21
  20. 20. 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
  21. 21. Questions?
  22. 22. 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

×