What is the difference between Cloud Functions and Firebase Functions?

后端 未结 3 769
感动是毒
感动是毒 2020-11-27 11:33

Cloud Functions and Firebase Functions (or \"Cloud Functions for Firebase\") both look the same. Please describe the use case of each.

Both use HTTP functions.

3条回答
  •  暖寄归人
    2020-11-27 12:16

    There is no product called Firebase Functions.

    There are three separate things:

    1. Google Cloud Functions, which allow you to run snippets of code in Google's infrastructure in response to events.
    2. Cloud Functions for Firebase, which triggers Google Cloud Functions based on events in Firebase (such as database or file writes, user creation, etc)
    3. Firebase SDK for Cloud Functions, which includes a library (confusingly called firebase-functions) that you use in your Functions code to access Firebase data (such as the snapshot of the data that was written to the database)

    So Firebase provides a (relatively thin) wrapper around Google Cloud Functions, to make the latter product easier to use and integrate it with Firebase. In that senses it is similar to how Firebase integrates Google Cloud Storage into "Cloud Storage for Firebase" (formerly known as Firebase Storage).

    If you're using Google Cloud Platform without Firebase, then you should use plain Google Cloud Functions. If you're on Firebase or if you're a mobile developer interested in Cloud Functions, you should use Cloud Functions for Firebase.

提交回复
热议问题