Load Balanced Firebase Server Listeners

If I want to use Firebase on the server side, instead of REST routes with express and node.js, how would I go about scaling and load balancing? So, for example, if I have an express app that uses Firebase on the server side, will every single server that spins contain these listeners and respond to them? Is there a scalable solution for using Firebase on the server side with elastic load balancing?

+3


source to share


1 answer


I think your question is too broad in its current form, but will give you at least a few (equally broad) options.

There may be many solutions, but most of them will be variations in these two broad scenarios: centralized and decentralized.

You can use a centralized authority that assigns each task to one of the worker nodes. This is usually what a load balancer does, so you might want to look for load balancing algorithms.



Alternatively you can use every node, just try to request a job . The nodes then have to use transaction

to update the "work queue" so that only one node exits.

Related: https://github.com/firebase/firebase-work-queue

+4


source







All Articles