0
votes

Background

I have a sensor "A" which connects to my mobile app over Bluetooth. This sensor generates 512 data points per seconds.

What I need

I need to send send this data to Google BigTable via Cloud pub/sub. I have already created a topic and I can push message to the topic.

What is the problem

  1. This answer says that I need to create an app engine and connect my app to that app engine. The app engine will receive the data and send it to Bigtable via pub/sub and dataflow.I get this, but now I have two sub problem here -

    a. How can stream the data from my mobile app to app engine? Websocket? Because I think I can't do simple post request to post the data to a route (/publishdata), Am I correct?

    b. I am authenticating my user on mobile app via firebasea authentication. Can I validate my user on app engine via firebase-admin sdk? I can do that by passing the tokenId but is it the correct method? or can I use firebase to authenticate my users on app engine?

  2. I have seen projects where people are suggesting to create a service account and add it into the app. The problem is I don't want to expose my credentials to client. Another talk

Can anyone suggest me tackle this problem?

Thoughts that I have

I can send data to firebase realtime database and then thinking of moving that data to Bigtable via pubsub or cloud function. I couldn't find any example of an app engine connecting to a firebase and reading data from realtime database. I thought in this example this guys sending data to Realtime database and then using pubsub to move data into Bigtable. If this is possible then can I authenticate my user on the app engine via firebase-admin sdk?

1

1 Answers

0
votes

Firstly, you should take a look for this Build an Android App Using Firebase and the App Engine Flexible Environment article, which demonstrates how to write a mobile app with backend data storage, real-time synchronization, and user-event logging using Firebase.

Regarding to your first question about sending data to App Engine, you can send it as an HTTP POST. Please, take a look to following questions on Stackoverflow: 1, 2.

With reference to create a service account and add it into the app, it's not secure option. In this case, you can use Callable Cloud Functions. Refer to this Stackoverflow thread.

You can get data out of the Firebase Realtime Database via backup service which allows for exporting data to GCS Bucket. Then, you can move it to Bigtable, by using open-source Dataflow templates, for instance Cloud Storage Avro to Bigtable. Please, refer to official documentation, to find more about exporting data to Bigtable.

I hope it helps.