MiniCTRMSearch

MiniCTRM - Build Tutorial 622: Running jobs in parallel: the end of day in ten minutes, not twenty

→ to begin · N for the speaker notes

On a phone: Next or a swipe left to begin, Notes for the words.

What you'll learn

A job set as a graph of steps with dependencies, a worker pool sized to the machine with a scheduler that starts every ready step, two ten-minute reports done in ten with a wall-clock test to prove it, a log per step, one retry-safe door for every background write with the SQLite-against-PostgreSQL rule written down, every step safe to run twice with Retry from this step and Cancel, and the End of Day set rewired.

  • A job set as a graph – Each step names what it waits for; the steps that wait for the same thing can run together.
  • A worker pool, and the proof – Cores, threads and a scheduler that starts every ready step; then two ten-second reports done in ten, on the clock.
  • The database's rules – Many readers and one writer on SQLite, one retry-safe door for every background write, and when PostgreSQL is the answer.
  • Safe to run twice – Idempotent steps, Retry from this step, and Cancel between steps.
  • The end of day rewired, then ship – The End of Day set's dependencies declared, the saving on the History screen, a rule in CLAUDE.md, and /ship.
  • How MiniCTRM did it – Groups in order and no graph, on purpose, and the two pieces your parallel runner grew from.

Before you start

The lessons this one builds on: 621 End of day: close the market, run the valuation, automate the night.

Copyright 2026-2027 Brian Shydlo. MiniCTRM is source-available under the PolyForm Strict License 1.0.0 (https://polyformproject.org/licenses/strict/1.0.0): free for learning and other noncommercial use; no changes and no redistribution; commercial use needs permission.

Welcome

The night is twice as long as it needs to be

1 / 17
The night is twice as long as it needs to be
A job set as a graph

Parallel, and what a step waits for

2 / 17
Parallel, and what a step waits for
A job set as a graph

An end of day, step by step

3 / 17
An end of day, step by step
A job set as a graph

Each step names what it waits for

4 / 17
Each step names what it waits for
A worker pool, and the proof

Workers, cores and a scheduler

5 / 17
Workers, cores and a scheduler
A worker pool, and the proof

The worker pool

6 / 17
The worker pool
A worker pool, and the proof

Two reports in ten, on the clock

7 / 17
Two reports in ten, on the clock
The database's rules

Many readers, one writer

8 / 17
Many readers, one writer
The database's rules

SQLite against PostgreSQL for a parallel night

9 / 17
SQLite against PostgreSQL for a parallel night
The database's rules

One retry-safe door for every background write

10 / 17
One retry-safe door for every background write
Safe to run twice

Safe to run twice

11 / 17
Safe to run twice
Safe to run twice

Idempotent steps, Retry from this step, Cancel

12 / 17
Idempotent steps, Retry from this step, Cancel
The end of day rewired, then ship

The End of Day set, rewired

13 / 17
The End of Day set, rewired
The end of day rewired, then ship

Ship it

14 / 17
Ship it
How MiniCTRM did it

Job Automation: groups in order, no graph

15 / 17
Job Automation: groups in order, no graph
How MiniCTRM did it

Run Scripts: the worker, the log and the door

16 / 17
Run Scripts: the worker, the log and the door
What you have now

What you have now

17 / 17
What you have now

You have finished lesson 622, Running jobs in parallel: the end of day in ten minutes, not twenty.

Where next?

← → move · N notes · Home / End