Firebase Cloud Function trigger - firebase

As I know currently Cloud Functions doesn't support triggering functions from Firebase.
For now I'm planing to use an basic Engine instance to trigger the functions based on the queue.
Is this the right way to go? or should I trigger the cloud function directly from the clients device after the data is inserted in the db?
thank you

Cloud Functions for Firebase was just launched today! You can use the SDK to trigger cloud functions from your Firebase database, storage bucket, authentication, and analytics events. https://firebase.google.com/docs/functions/

Related

Can I create triggers with Admin SDK in my own backend?

I am new to Firebase and learning it. With Cloud Functions you can create trigger listeners to events that happen in Firestore (firestore events) or Authentication (auth events). Can I create listeners similarly with the Admin SDK of Firestore or Authentication in my own nodejs environment?
No, Cloud Functions triggers only work on the Cloud Functions backend, as they depend heavily on Google Cloud infrastructure to work efficiently. There is no exact equivalent for other environments. You can certainly use the provided nodejs Firestore SDK to set up a document or query listener, just like web and mobile clients, but it won't behave like a Cloud Functions trigger.

Firebase cloud functions on an offline device

I use Firebase Cloud Functions in a Flutter app. How does cloud functions behave when a device is offline in these cases? Is there any situation I can't reliably use cloud functions when the device is offline?
Trigger functions (onUpdate(), onDelete() etc)
Function invocations using function name
If an app is offline, there is nothing it can do to trigger any function. Without network connectivity, the app has no ability to invoke a function directly, no make any changes to a cloud-hosted product that would fire a trigger on the backend.

What is the appropriate way to load data from Firestore into BigQuery?

I was looking at a few ways to export data out from Firestore without using export (expensive operation in the long term as it doesn't support incremental backups) to use in BigQuery and Data Studio.
1) Using Google Pub/Sub.
This will probably require function to both write to pub/sub and then another to trigger to BQ.
2) Using Cloud Functions to trigger from an onCreate event to write directly to a BigQuery dataset and table.
(This is using table.insert)
What would the advantage be to use Pub/Sub - other than it would appear that it will cost more in the long term?
Or is there another way I am unaware of to do this?
I'm new at this. Some advise and pro and cons of the above scenarios are much appreciated.
The official solution is here.
In case of using Cloud Functions to trigger from an onCreate event, what will you create? Create File on Cloud Storage or create Firestore Document?
I think that in case of using Cloud Functions you should use PubSub trigger.
I recommend asynchronous architecture like Pub/Sub. Because rerun is easy and the scope of influence is limited.
I developed sample is here. I'm using Cloud Scheduler not cron.yaml. The cost of Cloud Scheduler is here.
(If you want) Export Firebase Authentication users to Cloud Firestore Collection. Use Firestore, Cloud Functions(PubSub) and Cloud Scheduler.
Export All Cloud Firestore Collections and Specified collections to Cloud Storage. Use AppEngine and Cloud Scheduler.
Export Specified Cloud Firestore Collections to BigQuery( as Partitioned tables). Use AppEngine and Cloud Scheduler.

Use firebase to access google cloud datastores data

I want to connect my laravel app with google cloud datastore and want to use same data for android and ios application, for that i want to use firebase.
Can any one have idea that how can i access my google cloud datastore's data in firebase ?
You could try using Cloud Functions for Firebase to fetch/query data for you using the Node.js client libraries.
Documentation:
Google Cloud Node SDK for Cloud Datastore
Cloud Functions for Firebase
You could also try Cloud Functions for Firebase and/or Firestore DB instead of Google Cloud Datastore.
Firestore is the next evolution of Firebase (Realtime DB) with better support for scaling & data modeling + offline data management.

How do I use Cloud DataStore or Cloud SQL from Cloud Functions for Firebase?

I'm building a Firebase app, and plan to use the real-time database when I need real-time updates. However, most of the application data is more traditional.
Now that Functions is a thing, how do I also leverage either DataStore or CloudSQL? Can anyone point me to specific documentation or examples how to read/write with either of those services from a function?
Neither Cloud Datastore nor Cloud SQL support Cloud Functions yet, which means you aren't yet able to trigger Cloud Functions based on their events the way you can with the Firebase Realtime Database.
Fortunately, once a Cloud Function has been triggered (for example via HTTP), you can still read and write from Datastore and SQL as you would from any other Node.js code. Here is documentation for Cloud Datastore, and here it is for Cloud SQL.
Finally, if you're adventurous and might like to provide early feedback on upcoming integrations like Datastore, fill out this form!

Resources