Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in GCP by (19.7k points)

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. In the Cloud Functions:

exports.helloHttp = function helloHttp (req, res) {

  res.send(`Hello ${req.body.name || 'World'}!`);

};


 

And in the Firebase Functions:

exports.helloWorld = functions.https.onRequest((request, response) => {response.send("Hello from Firebase!");

});

What is the difference between these?

 

closed

1 Answer

+1 vote
by (62.9k points)
selected by
 
Best answer

There is no product called Firebase Functions. Here is an explanation of Google Cloud Functions and Firebase Admin SDK:

Google Cloud Functions permits small code sections to carry out definite, limited tasks, that are basically related to triggering responses to software-driven events. When an event sets off an associated function, the function is loaded into a managed google cloud environment and executed. All infrastructure resources are supported and recovered automatically by Google Cloud Platform (GCP).

The Firebase Admin SDK is a set of software tools that are used for interacting with Firebase products, including Realtime Database, Authentication, and Cloud Messaging. It is also used with Cloud Functions to implement backend logic.

One is the infrastructure that you deploy your application software to, the other is a software tool that you use to build your own application software.

Cloud Functions for Firebase, which triggers Google Cloud Functions based on events in Firebase (such as database or file writes, user creation, etc)

Browse Categories

...