Another potential benefit to use a RDBMS system as a queue is that it can make
it much simpler to express priorities in cases where it's not a simple FIFO,
i.e., if the next job a consumer should take depends on more than just the time
the job was added to the queue.
One place this has come up for me is when the next job that's picked depends on
currently running jobs, e.g., each job is associated with a user, and if a
single user already has N tasks running you may want to prioritize another
user's tasks for the N+1 slot.
One place this has come up for me is when the next job that's picked depends on currently running jobs, e.g., each job is associated with a user, and if a single user already has N tasks running you may want to prioritize another user's tasks for the N+1 slot.