Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Enhance your app's backend with Cloud Functions...

Enhance your app's backend with Cloud Functions for Firebase (ServerlessDays Hamburg 2019)

Doug Stevenson

February 14, 2019
Tweet

More Decks by Doug Stevenson

Other Decks in Technology

Transcript

  1. Enhance your app's backend with Cloud Functions for Firebase Doug

    Stevenson @CodingDoug Codelab: bit.ly/cf3-codelab
  2. @CodingDoug What is “serverless”? • Servers (!!) • No maintenance

    • Automatic scaling up and down • Pay only for what you use • Event-driven
  3. @CodingDoug Cloud Functions is event-driven Cloud Functions event providers Cloud

    Storage Firebase Auth Crashlytics Cloud Firestore function (event) { doStuff(event) } trigger emit events
  4. @CodingDoug Cloud Functions scales up and down with load Cloud

    Functions function (event) { doStuff(event) }
  5. @CodingDoug Cloud Firestore Firebase Crashlytics Firebase Authentication Firebase Realtime Database

    HTTPS endpoints Cloud Pub/Sub Cloud Storage Google Analytics for Firebase Event providers
  6. @CodingDoug Why use Cloud Functions? • Don’t repeat yourself. ◦

    Share common app logic between app platforms. • Be fast and reliable. ◦ Offload work to be done in the background. • Don’t trust the user’s device. ◦ Secure your sensitive code.
  7. @CodingDoug When NOT to use Cloud Functions? • Your app

    can’t tolerate “cold start” times. ◦ Instead, maintain your own servers 24/7. • You have heavyweight work to do ( > 9 min, > 2GB mem/disk ) ◦ Delegate work to App Engine or Compute Engine • You need to keep a socket open or do streaming ◦ No easy alternative
  8. @CodingDoug Resources What is Firebase? bit.ly/what-is-firebase Cloud Functions docs bit.ly/cf3-docs

    Video tutorials bit.ly/cf3-videos Sample code bit.ly/cf3-samples Codelab bit.ly/cf3-codelab My samples gist.github.com/CodingDoug