Re: PostgreSQL as advanced job queuing system - Mailing list pgsql-general

From Merlin Moncure
Subject Re: PostgreSQL as advanced job queuing system
Date
Msg-id CAHyXU0zhoJ4vOBRoj-=RHH1XH9trG+HJoK33+ciekNdn0L-ZRw@mail.gmail.com
Whole thread Raw
In response to PostgreSQL as advanced job queuing system  (ushi <ushi@mailbox.org>)
Responses Re: PostgreSQL as advanced job queuing system  (Dominique Devienne <ddevienne@gmail.com>)
List pgsql-general
On Fri, Mar 22, 2024 at 6:58 AM ushi <ushi@mailbox.org> wrote:
Hello List,

i am playing with the idea to implement a job queuing system using PostgreSQL. To meet requirements the system needs to offer some advanced
features compared to "classic" queuing systems:

- users can create new queues at any time
- queues have priorities
- priorities of queues can change at any time
- jobs in queues with the highest priority should be processed first

 You can definitely do this.  I wrote an enterprise scheduler, called pgtask, which ochestates a very large amount of work each night..   Here's a couple of screenshots.  It's running a distributed analytics enterprise analytics batch environment in the vein of airflow.  Here's a couple of screenshots.   It's a single threaded stored procedure architecture that uses dbink calls to distribute the work.



I'm running at a pretty high scale and it's reliable.  It's not really positioned as a proper queue, but more of a graph orchestration system, and it supports realtime and quasirealtime.  The main bottleneck is that dblink does not have epoll style 'wait for first to finish or fail' (it really needs to), forcing a loop in sql which bounds the active connections a bit.

Being able to manage the state explicitly in the database is wonderful, if you know what you're doing.

merlin

pgsql-general by date:

Previous
From: Shaheed Haque
Date:
Subject: Re: PostgreSQL as advanced job queuing system
Next
From: arun chirappurath
Date:
Subject: Seq scan vs index scan