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
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