✅ Background jobs, choosing the right library
Hello,
I need to implement a scheduled job that will be periodically executed.
Why are there so many libraries: Hangfire, Quartz, Coravel? Even .NET offeres the
BackgroundService
out of the box.
How do I choose the right library? Literally every one of them gets the job done...10 Replies
They all have their own tradeoffs. Is it a one off, or do you have multiple jobs? What about multiple worker instances?
I would have multiple jobs, not just one. But each one would query the DB
Okay. What about an admin panel to run jobs manually etc? Is that something you need, or not relevant
And the amount of running instances question is still important
Ie, if you have three running instances, would it be a problem if all three ran the job?
I was thinking of usign distributed locking mechanism, so the task wouldn't be executed by multiple instances
That works. Otherwise, hangfire and quartz have that built in if wanted
I'd probably recommend go with coravel if you don't need manual triggering
Sorry, I forgot to mention that part, no GUI is needed, everything should be executed programmatically
Thank you
There is an important caveat thou, coravel defaults to UTC
If you want to specify scheduled times in local TZ, don't forget to apply that modifier
I'm using Utc both in DB, and application
Ok, np then
Thanks again