I have an app with tens of thousands of users where every second we are capturing data (location data). For analysis we are trying to allow this data to be queryable to generate reports for the user.
The idea is to pass the data in the Realtime database to Spanner so that I can query the data in SQL format and generate reports based on that. I want to be able to do this from my trigger everytime that I update the realtime database. So data follows this flow:
iOS / Android location data -> writes Firebase Realtime DB -> Function trigger based on write event -> Add to Spanner
Is this possible and if so how do you suggest it being done? I am already using firebase functions to trigger notifications and keep database consistency, but not sure how to connect to spanner. The documentation that I have found is all about Cloud functions and when I do
const Spanner = require('@google-cloud/spanner');
I get the "Error: Error parsing triggers: Cannot find module '@google-cloud/spanner'"
My first limitation is: Are firebase functions limited to firebase itself or can I integrate with other cloud tools such as spanner?
Thanks,
Ricardo