Cloud-based features for Firebase make firebase queue obsolete?

I wrote some server-side code to use firebase-queue] ( https://github.com/firebase/firebase-queue ) for scalability, however, with the release of cloud functions for Firebase (and the promise of auto-scalability), I wonder is there a need for a queue ... Has anyone there combined these two technologies for a larger purpose? In particular, for Firebase developers like @Frank van Puffelen, will functions replace the firebase queue?

+7
firebase google-cloud-functions firebase-queue
source share
3 answers

firebaser here

I am not sure if the firebase queue has not expired. Time will have to say.

But we definitely now use the Cloud functions for Firebase in a variety of scenarios in which we used the firebase-queue and node workflow before. You no longer need to bring our own Node.js process, which increases development speed. Automatic scaling of cloud features has proven invaluable already.

Combining cloud functions with a firebase queue seems illogical. If you simply add nodes to the database and consume them in your function, you should have the same behavior without requiring an additional library.

Update : one of our database engineers just gave a script in which functions cannot replace a queue. When creating backups, workers need to mount and disconnect remote drives. This task can be implemented in a cloud function, it is much easier to do in stand-alone, stand-alone mode node.

+10
source share

I don’t think that Firebase cloud functions should make an obsolete firebase queue obsolete, and I don’t think it’s at all illogical to want to combine a firebase queue with cloud functions, as @@ Frank van Puffelen said.

Firebase-queue provides much more than a way to complete tasks for firebase and startup tasks. It provides a protocol for communication between parties assigning and responding to task requests, coordinates repeated attempts of unsuccessful tasks, and reports on progress, status, and additional metadata. One of the things this allows is task chains.

I think it would be helpful if Firebase or a third-party developer developed a firebase-functions-queue package that extends the firebase functions and allows you to write a firebase cloud function with the same signature as the firebase queue. Something like that:

const functions = require('firebase-functions'); const functions-queue = require('firebase-functions-queue'); //extends firebase-functions with onQueue function admin.initializeApp(functions.config().firebase); functions.database.ref('/queue').onQueue(options,function(data,progress,resolve,reject){ ... }) 

This new package will work the same as firebase-queue and use the same metadata and parameters, except that it will not need to manage multiple workflows, since cloud functions already do this automatically and smoothly.

This will have the following advantages:

  • Allows firebase developers to use the standard way to schedule tasks, monitor progress, failure, etc.
  • An application can schedule a queue job and does not care if it is being processed by a cloud function or other environment.
  • A developer could take an existing queue and transfer it from the node server to the cloud functions without changing the client application.
  • It may even allow a task chain when one task can be handled by a cloud function and the other by another server as part of the same job.
+6
source share

I don’t think it is as simple as saying that it replaces the firebase queue. Ideally, you should use functions for most common use cases for the firebase queue.

However, there are probably some legitimate reasons to use the firebase queue anyway.

  • This is a fairly reliable queuing system that allows you to use multi-position tasks and allows you to set the number of workers.
  • It runs in the environment that you specify instead of App Engine (you can install binaries on your server that are not available in GAE).
  • May be cheaper depending on the specifics of bandwidth versus calls.
  • It can access third-party endpoints for free, while features require a paid account.
  • Functions are still in beta and do not offer SLAs, they also have some launch delays that will not occur in the firebase queue (this point should become invalid during the GA release time).
+5
source share

All Articles