PitchRoots

Canadian soccer, one feed. Every story links to its source.

How PitchRoots is built

PitchRoots looks like a simple news feed, and to read it, it is. Underneath, it's a small but complete example of something called durable execution — and since the whole thing is public and easy to follow, it doubles as a working demonstration of durable execution.

Two loops, one database

There are two independent halves that never talk to each other directly. A write loop runs once an hour in the background, gathering and summarizing the news. A read loop serves the website. They meet only at a shared database.

  WRITE LOOP  (durable, hourly)              READ LOOP  (every visit)
  ─────────────────────────────              ────────────────────────
  pg_cron ── every hour                      you → pitchroots.ca
       │                                          │
       ▼                                     served from the CDN
  poll()  ── a durable workflow                   ▲
       │                                          │  (re-rendered from the
       ├─ fetch each feed                         │   database on a timer, or
       ├─ verify every link                       │   right after new items
       ├─ classify + summarize (AI)               │   are published)
       └─ save new items                          │
       ▼                                          │
  ┌──────────────────────────────────────────────────────────────────┐
  │  one Postgres database                                            │
  │    · the articles        · the durable-execution engine itself    │
  └──────────────────────────────────────────────────────────────────┘

Because all the expensive work happens ahead of time in the write loop, the website itself never calls an AI model or fetches a feed while you're looking at it. It just hands you a page that was already built. That's why it's fast, and why it costs almost nothing to run.

The hourly job, step by step

Every hour, one durable workflow runs, once per news source, and does this:

  1. Fetch the source's feed.
  2. Skip anything already seen or already rejected — before spending anything on it.
  3. Verify the link actually resolves, following redirects and dropping dead ones, so the feed never points at a 404.
  4. Classify and summarize what's left with a language model — deciding whether it's Canadian soccer, which topics it touches, and writing a one- or two-sentence summary in original words.
  5. Save the relevant items, and record the dead links and rejected articles so future runs skip them without asking the AI again.

What “durable” means here

Each of those steps is checkpointed to the database the moment it finishes.If the job is interrupted partway — a timeout, a crash, a redeploy — it doesn't start over. It resumes from the last completed step. A feed already fetched isn't fetched again; an article already summarized isn't sent to the AI a second time. The work-in-progress lives in the database, not in the memory of a program that might disappear.

The precise guarantee is exactly-once checkpointing with at-least-once side effects — a step can run again, but it can never leave a duplicate behind, because every save is written to be safely repeatable.

The unusual part: no separate server

Normally, durable execution needs its own workflow server running somewhere. PitchRoots doesn't have one. The entire engine — resonate-pg — is a single SQL file that runs inside the same Postgres database that stores the articles. Postgres itself keeps time and triggers the hourly run. So the whole system is really just a static website and a database — with the reliability of a workflow engine folded into the database itself.

This is all built on Resonate durable execution. If you're curious about the machinery, the source is public.

← Back to the feed