Mr. Lehenbauer, of course, is the master of all Firebase stuff, so listen to him .;) However, this particular topic is something that I have been working on for a couple of weeks.
Here are a few of my thoughts to improve the responses to “Launch a separate server” and “Client request”:
ElasticSearch (a node.js script)
When using the node.js script on the server, you can integrate ElasticSearch and provide a solid data search within an hour. Here's a blog post and lib that makes it even easier: https://www.firebase.com/blog/2014-01-02-queries-part-two.html
cached / general requests
They can be processed by the server / cron process, which reads the table and duplicates the data. For example, suppose I want to show "unavailable / available" for a user login during registration, but store user records by a different unique identifier for some complicated reason.
My cron / server can read all the records from the user table and then insert them into another table, which is stored by email address, with the value of the user record identifier (or any other data that I might want to know).
This duplicate data approach is a manual caching method and is a common practice in non-SQL environments; We trade storage space (which is considered cheap and affordable) to expedite and simplify processes.
customized queries (using the queue)
User requests can be sent via XHR (ajax) directly to the server, which can do the hard work and return the best results. Alternatively, you can use Firebase to connect to the server server using the queue.
The client puts the request request as JSON in a special Firebase table called queue and waits for a response.
The server listens on queue.on('child_added', ...) and returns data back using `queue_record.child ('response', ... data here ...)
This has some nice advantages. For example, any number of servers can listen and serve responses, making load balancing a breeze. The code for this is very simplified to configure in another thread here in SO.
Hope this will be helpful!