John Karanja

The field guide · rule 12 of 16

Let only one worker move the money

When several copies of a program run at once, decide which jobs may run in one place only.

What it means

To serve more people, you run several copies of a program. But if every copy also runs the same background job, that job is done several times. Keep the parts that serve pages easy to copy, and let only one place run the jobs that move money. When two try at once, let the database decide who wins.

What goes wrong without it

Two copies of the payment checker see the same deposit, and both credit it.

How I build it

From systems I build and run.

Ask your team

  1. If you started a second server, would any job run twice?
  2. Could two staff approve the same payout at the same moment?
  3. Which part breaks first if your number of users doubles?

A "no" or "not sure" is worth a closer look.

How a review checks this

A review lists the jobs that must never run twice, and checks what stops them when the system grows.

Request a reviewThe offer: Architecture review or handover checkCheck your system in one minute

Related rules