FirebaseExtended / firebase-queue

MIT License
786 stars 108 forks source link

Question - Is it safe to use cluster, a.k.a parallelism, with Firebase queue #108

Closed ivawzh closed 7 years ago

ivawzh commented 7 years ago

From the doc, we learned that you can run multiple workers on the same thread in one CPU core. Will there be any reason stopping us from running Firebase Queue in NodeJs cluster, that is, multiple threads with multiple CPU cores; or running multiple Firebase Queues across multiple EC2 instances?

Thanks.

ORESoftware commented 7 years ago

As a user, my guess is that it's totally safe. As usual, the database handles locking, atomicity, etc. Firebase-queue is essentially parallel whether it's running in a single process, or multiple processes.

ivawzh commented 7 years ago

@ORESoftware I have the same assumption. Just want to get confirmation or future-proof guarantee from Firebase team in case breaking anything in production.

xzilja commented 7 years ago

Would be nice to see confirmation on this as well +1

cbraynor commented 7 years ago

I have not used cluster with this library before - I see no reason it shouldn't work but I can't make any guarantees.