0

We are hosting a platform that uses firebase and app engine in combination. The app engine node JS server listens for changes in firebase locations and does some processing of the data. However, because of scaling we suddenly had 2 instances instead of 1 and ended up with duplicate processing of the data. I have seen some suggestions for manual scaling with one instance, but that is not really scalable right?

Are there alternative solutions using the flexible solution? I have already read a bit about Firebase-queues and https://cloud.google.com/solutions/mobile/mobile-firebase-app-engine-flexible . Does anyone have any experience with these and how do they compare to just using REST for updates that need to be processed by the server?

4

1 回答 1

0

I suggest that instead of listening and handling changes on the handler, queue a change request (using queues or pubsub).
This will guarantee that every change will be handled only by a single instance at a time and it will scale to allow many instances to handle many change notifications.

Queues will also guarantee that incase of an error you will have a server side retires.

于 2016-10-24T16:00:07.480 回答