When only one instance may act
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
recognize work that must have a single active runner.
Planned topics
- With replicas, every instance runs the same scheduled jobs and consumers unless you prevent it.
- Examples: nightly reconciliation, sending a daily report, an outbox relay without
SKIP LOCKED. - Prefer designs that need no coordination: idempotent work, partitioned work, or
SKIP LOCKEDqueues. - When one runner truly is required, you need a lock or a leader.
- Decide what happens if the runner dies: another must take over.
Draft outline details
Demonstration
| Job | Needs one runner? | Alternative |
|---|---|---|
| Nightly reconciliation | yes | lock |
| Outbox relay | no | SKIP LOCKED |
| Email digest | yes | lock or unique send record |
Check your understanding
Name a way to avoid needing a lock for a queue of tasks.
Show answer
Let workers claim rows with SKIP LOCKED.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.