Ghostwriter service

Ghostwriter service

ผู้เยี่ยมชม

poljoey55@gmail.com

  PostgreSQL (11 อ่าน)

16 ต.ค. 2569 22:32

<p data-pm-slice="1 1 []">I&rsquo;ve been working on understanding how background jobs are handled in web applications, and I&rsquo;m curious about using PostgreSQL as a job queue instead of introducing a separate tool like Redis. For a small or medium-sized application, how well does this approach work in practice? I&rsquo;m particularly interested in how you handle jobs that need to be retried after a failure, prevent multiple workers from processing the same task, and deal with jobs that take a long time to complete. I&rsquo;ve seen people mention techniques like <code dir="ltr">FOR UPDATE SKIP LOCKED</code>, but I&rsquo;m not entirely sure how to use them correctly when several workers are running at the same time. How do you usually organize job statuses, retry delays, and failed-job handling without making the database schema unnecessarily complicated? I&rsquo;m also wondering at what point PostgreSQL starts struggling with this workload, especially when the application processes thousands of tasks per hour. Would you stick with PostgreSQL for as long as possible, or are there specific signs that it&rsquo;s time to move to a dedicated job queue system? I&rsquo;d be interested to hear about the trade-offs and lessons developers have learned from using this approach in real projects.

178.158.221.211

Ghostwriter service

Ghostwriter service

ผู้เยี่ยมชม

poljoey55@gmail.com

Dermand Brands

Dermand Brands

ผู้เยี่ยมชม

ramayananarju@gmail.com

19 ต.ค. 2569 19:51 #1

When building a backend with PostgreSQL, I think it is worth considering whether a separate message broker is actually necessary for background jobs. For smaller applications, keeping job state in the existing database can simplify the architecture, provided workers handle retries, failures, and concurrent processing carefully. It is important to make jobs idempotent where possible and monitor tasks that repeatedly fail. Scheduled jobs and workflow dependencies may also need special handling as the application grows. One example in this area is Spooled, a PostgreSQL-backed background job queue with retries, job statuses, scheduling, and workflows. Its workers run on the application's own servers.

178.158.192.148

Dermand Brands

Dermand Brands

ผู้เยี่ยมชม

ramayananarju@gmail.com

ตอบกระทู้
Powered by MakeWebEasy.com
เว็บไซต์นี้มีการใช้งานคุกกี้ เพื่อเพิ่มประสิทธิภาพและประสบการณ์ที่ดีในการใช้งานเว็บไซต์ของท่าน ท่านสามารถอ่านรายละเอียดเพิ่มเติมได้ที่ นโยบายความเป็นส่วนตัว  และ  นโยบายคุกกี้