Before you start. This lesson is part of a series that builds a small copy of a job scheduler: a program that runs other programs at the exact right time, the way a nightly backup needs to happen without a person watching a clock. The last lesson gave the series exactly one decider: several copies of the scheduler compete for a time-limited claim called a lease, and only the current holder may decide what’s due right now. This lesson asks what that decider should do once it has decided something, and why the answer isn’t “run it yourself.”
Lesson 66 of 117 in From Scratch
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.
Or start free: a free account opens lessons 2 and 3 of every track.
In this lesson
2009: GitHub’s site got slow, and it wasn’t traffic
The fix: a queue for the decision, workers for the work
Midnight: nothing happens, then everything does
The concurrency limit: the dial that isn’t how many workers you hired
Retrying without everyone retrying together
The dead-letter queue: giving up, on purpose
At-least-once: delivered twice, completed once
Terms it explains: what, when, queue, workers, not, concurrency limit, jitter, dead-letter queue, at-least-once, oldest-waiting-job age, in-flight against the cap, depth, pinned at the cap, below, from each other, 1000, 1000, 1000, 1000, 116, 68, 39, 21, transient, deterministic, window, before, confirmation was lost, Delete the jitter, Set `MaxAttempts` to 100, On a real queue, Sidekiq: Error Handling, SQS, visibility timeout, dead-letter queues.