Use firebase to access google cloud datastores data - firebase

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.

Related

Do I have to enable Firebase if I want to connect to my Cloud Firestore database from outside of Google cloud products?

Till now I was using service account to connect to my Firestore database (Firebase is not enabled) from within Google products like Cloud Functions or Colab.
Now I need to connect to Firestore from html page opened in my browser. Is it possible without enabling Firebase?
Yes, the Google Cloud Firestore NodeJS SDK is meant to be used on server side only. You can use Firebase Web SDK along with Firebase Authentication and Firebase Security Rules to support serverless app architectures where clients connect directly to your Firestore database.
You don't necessarily have to use Firebase Auth. However, it might be a good idea to restrict access and allow only public content to be accessible without authentication.
You can follow the quickstart in the documentation to setup the client SDK.

Could I use GCP infrastructure as a code to setup Firebase Auth, Firestore, RDB, Cloud Functions?

I know that I could setup Cloud Firestore and GCP Cloud Functions with infrastructure as a code, but I'm interested that it will be shown at the Firebase Console. I also can't find any way to deploy Firebase Auth and Realtime database with IaaC.
Any Cloud Functions deployed by either the Firebase CLI or gcloud will appear in both the Firebase console and the Cloud console.
Any data populated in Firestore will also appear in both consoles.
The Cloud console has no view into Firebase Auth or Realtime Database, as those services are unique to Firebase. You will have to use the Firebase console and its tools and SDKs to work with those products.
In fact, a Firebase project is just a Cloud project with extra APIs and services enabled on top. You might be helped by reading this blog series on the relationship between Firebase and Google Cloud.
https://medium.com/google-developers/whats-the-relationship-between-firebase-and-google-cloud-57e268a7ff6f
https://medium.com/google-developers/firebase-google-cloud-whats-different-with-cloud-functions-612d9e1e89cb
https://medium.com/google-developers/firebase-google-cloud-whats-different-with-cloud-firestore-40f1fc3e6d1e
https://medium.com/google-developers/firebase-google-cloud-whats-different-with-cloud-storage-a33fad7c2b80

Connect to Firebase buckets

I have a backend in golang and was wondering how I can connect to Firebase storage to create/delete buckets and add/delete files. Can I use the Admin sdk. I found the client storage lib in golang for google cloud storage. Can I use that? And whats the difference between firebase storage and google cloud storage?
The app I'm working on connects to Firebase Storage Buckets via the Admin SDK, but we're using Firebase Functions in Node.js. However, it looks like the Admin SDK in Go offers the same Storage access, and it's documented (with example code in Go) here:
https://firebase.google.com/docs/storage/admin/start
I like using Admin in Firebase, because you don't have to worry about project configuration and authentication to the various services. Firebase storage is google cloud storage, but with a nice wrapper and well-integrated into other aspects of your Firebase project. You get some limitations as a trade-off for all of that convenience, but unless you run into a feature of Google Cloud that you absolutely need and doesn't exist in Firebase, I'd stick with the Firebase (and Admin) version.

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!

Firebase Cloud Function trigger

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/

Resources