What is Cloud Firestore?
Google Firestore is a NoSQL, report-orientated database. Unlike a SQL database, there are no tables or rows. Instead, you save data in files, that are organized into collections. Each report consists of a set of key-value pairs. Google-Cloud-Firestore is optimized for storing huge collections of small files. All files should be saved in collections. Documents can incorporate subcollections and nested objects, each of that may consist of primitive fields like strings or complicated objects like lists. Collections and files are created implicitly in Firestore API. Simply assign records to a report inside a collection. If either the collection or report does not exist, Firestore creates it.
Reporting can be simple with Google Cloud Firestore, and need not be super complicated. In a few minutes, This article shows you how to get your Firebase data onto google data studio.
Without writing a single line of code you can automatically pull the latest data from Firebase Cloud Firestore to Google Data Studio report. All this without sacrificing data security, with our encrypted Google setup and data stored in your private Google Data Studio report, you can be confident that you are safe.
Let’s get started, first we are going to create a new google service account and give it access to your Firebase Cloud Firestore database. We then add the service account into Two Minute Reports. This allows you to set clear permissions and have full control over the access to your Firebase Firestore.
Step 1: Create a service account
- Go to Google Cloud Console’s Service Account section inside IAM & Admin
- Select the project on which you have created the Firebase Firestore database
- Click “+ Create Service Account”
- Under the “Grant this service account access to project”, make sure to select “Cloud Datastore Viewer” permission and then click continue.
- Your Service Account account is now created
- Now select your newly created service account, create JSON keys and download them
- Keep the .json file safe, we will need it in the next step
You can adjust the permissions in the IAM section to give more fine-grained access to your new service account if desired.
Step 2: Add a new Data Source
You can add your MySQL data source by clicking second authorise button, a window will open and fill in your database details. Press “Test connection” once you are ready, your credentials will be validated and saved for future use.
After adding your Firestore Data Source, you can add an unlimited number of query configs using the same Data Source. Your credentials are securely encrypted and stored within your Google Account. This makes sure your data does not leave the Google Servers and is not readable by anyone except you. Even when you share your Google Data Studio Report with others, they cannot read your credentials.
Step 3 : Fetch Firestore Data onto Google Data Studio
Once you have connected your Firestore account, you can access it from any new or old Data Sources in Data Studio within your Google Account. This makes it easy for you to connect to your Firestore database and create query configs from different data sources without having to re-enter all the credentials.
After adding your first Data Source, you will be automatically moved to the Query Configs Section. Start by selecting your newly added Data Source, you can use a custom query by entering your query in the dark SQL editor or you can use tables to get all the data in the selected table.
Note that for security reasons we only allow “select” based custom SQL queries to be executed in your MySQL database. After completing press “Save”, your Query Config will be saved.
After saving Query Config you can close the window, your newly created Query Config will be listed, select a Query Config to use and press “Connect”. Now your data fields will be listed, press “Create Report” to create a new Data Studio Report.
Now you can select the data your need from the right sidebar and create reports to your liking.
Try Two Minute Reports Firebase Connector for free and start pulling data from MySQL to your Google Data Studio. Cheers!
Want some Clarity on how to get data from