Skip to content
Ameen Abozaid
Planned lessonMID-032-L01

When only one instance may act

  • Lesson 1 of 5
  • Mid-level
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 LOCKED queues.
  • 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

JobNeeds one runner?Alternative
Nightly reconciliationyeslock
Outbox relaynoSKIP LOCKED
Email digestyeslock 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.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.