If i want to use Firebase on the server side, in place of REST routes using express and node.js, how would I go about dealing with 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 up contain these listeners and react to them? Is there a scale-able solution to using Firebase on the server-side with elastic load balancing in mind?
I think your question is too broad in its current form, but will give you at least a few (equally broad) options.
There are probably dozens of solutions possible, but most of them will be variations on these two broad scenarios: centralized vs decentralized.
You can use a centralized authority, which assigns each task to one of the worker nodes. This is normally what a load balancer does, so you might want to search for load balancing algorithms.
Alternatively you can have each node simply try to claim the work. The nodes should then use a transaction
to update the "work queue", so that only one node ends up doing the work.