Transactionally Staged Job Drain Queues

Written — Updated
  • Author: Brandur Leach
  • Source:
  • For transactions that need to enqueue background jobs it's useful to not talk directly to the job queue, but to add your jobs to a table and have another process that periodically sweeps that table and enqueues the jobs in it.
  • This way you can do more work in SQL transactions, and the the job queueing can just be another part of the transaction.