0

We are using Firebase for an Mobile APP. We have thousands of users.

Expected to hit 100 thousand.

We are having a portal to configure data to be shown to the user.

Based on user input we need to manipulate lot of data.

Currently we are using a flag for each user for which we are having on() listener. So we are going to have thousands of listeners.

These listeners are handled from a Node JS server hosted on Heroku.

Earlier we used Parse and we had Parse cloud code to manipulate Parse Core DB on cloud code call.

But in Firebase we will eventually need to create a REST API which will do the job for us instead of having 100 thousands listeners for 100 thousand users.

But then we will need to have rewrite network code on the APP side for rest API call which is currently handled by Firebase library for which we had gone with Firebase in the fir

Anant Bhandarkar
  • 367
  • 2
  • 11

1 Answers1

0

Every Firebase listener is a separate websocket connection, and I'm not sure how easy it will be for you to create hundreds of thousands of connections on a single node.js Heroku dyno (although see here how something similar was apparently achieved on an appropriately configured 15GB rackspace cloud server).

If you plan to run your Firebase listeners on multiple Heroku dynos, you will need a way to distribute your listeners across the different dyno instances.

Yoni Rabinovitch
  • 5,171
  • 1
  • 23
  • 34
  • Thanks Yoni. Any Recommendation for running operations at the backend on Firebase DB other than the on() listeners Approach? We used Parse Cloud code earlier to achieve this and it was very easy. Looks like now we will need to create a REST API with Node Js which mobile user will call over change of Flag to trigger a listener. – Anant Bhandarkar Apr 07 '16 at 13:10
  • You can consider Firebase RESTful streaming (https://www.firebase.com/docs/rest/api/#section-streaming) instead of on() listeners.Depending on how your Firebase is structured, that may or may not be more effiicient. Note however that each EventSource is a separate connection - see http://stackoverflow.com/questions/30451991/firebase-rest-streaming-for-multiple-users. – Yoni Rabinovitch Apr 07 '16 at 14:50