pg-boss or redis for 20 jobs a minute on one $12 box Queue Choice
One $12 VPS, Postgres on the same box, a Node app. About 20 jobs a minute: thumbnails, transactional email, a nightly export. No spikes worth the name.
Everything I read says use Redis. Redis means another process to keep alive, another thing to decide whether to back up, and another failure mode at 3am on a machine with 2 GB of RAM.
Is there a real reason not to just use the database that is already there?
@spreadsheet_tabs · 8mo ago · 3 replies
No, and the performance argument everyone reaches for is the wrong argument anyway.
FOR UPDATE SKIP LOCKEDis what every Postgres queue is built on and it will do thousands of jobs a second on hardware considerably worse than yours. You do 0.33 a second.The real reason to prefer it at your size: you can enqueue the job in the same transaction as the row that caused it. Order rolls back, receipt job never existed. With a separate queue you get the classic pair of bugs - charged but no receipt, or receipt sent for an order that rolled back - and the standard fix for those is an outbox table, which is a Postgres queue with extra steps.
Reply
Report
@kombucha_kai · 8mo ago
This is the part that gets skipped in every "which queue" thread. "Redis is faster" is true and irrelevant at 20 a minute. "Redis is not in your transaction" is the thing that costs you a weekend and a customer apology.
Reply
Report
@finops_reyna · 8mo ago
Also one fewer thing in the restore story. Restoring a database backup and having your pending job state come back consistent with it is quietly wonderful the one time you need it.
Reply
Report