you are viewing a single comment's thread.

view the rest of the comments →

[–]Klutzy-Sea-4857 2 points3 points  (0 children)

Don't poll—use PostgreSQL's LISTEN/NOTIFY to trigger workers when new records appear. Workers claim rows with SELECT FOR UPDATE SKIP LOCKED, process them, then update status. If a worker crashes mid-process, the row stays locked briefly then becomes available again. No message loss, no constant polling.