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

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

3acd4fb373289e71fd7ebfb287a75a3b?s=128

Doug Stevenson

February 14, 2019
Tweet

Transcript

  1. 1.

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

    Stevenson @CodingDoug Codelab: bit.ly/cf3-codelab
  2. 6.

    @CodingDoug What is “serverless”? • Servers (!!) • No maintenance

    • Automatic scaling up and down • Pay only for what you use • Event-driven
  3. 7.

    @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. 8.

    @CodingDoug Cloud Functions scales up and down with load Cloud

    Functions function (event) { doStuff(event) }
  5. 9.

    @CodingDoug Cloud Firestore Firebase Crashlytics Firebase Authentication Firebase Realtime Database

    HTTPS endpoints Cloud Pub/Sub Cloud Storage Google Analytics for Firebase Event providers
  6. 10.

    @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. 11.

    @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. 12.

    @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