Menu

1 / 2

182.5 CU-Hours to Poll, Zero for the Timer: A 10-Second Undo Window That Lets the Database Sleep

DEV Community: postgres·Michael Kaminski·about 6 hours ago
#AfFMoGmO
#devtopostgresql#devto#dev#timer#window
Long article (1954 words) — no AI summary yet.
Reading 0:00
15s threshold

Originally published on michael-kaminski.io .

In 30 seconds

What: svelte-accounting-agent holds every approval for 10 seconds so the reviewer can undo it before the ledger is written.

The math: waiting with a 1-second poll costs 730 h × 0.25 CU = 182.5 CU-hours a month on a database that allows 100. Waiting with a timer costs nothing.

How: one timer per company, armed at write time for the earliest deadline. The deadline lives in the row, so a lost timer is a late commit, never a lost one.

The cost: the timer path has no test of its own, a deploy can stretch the window to about 40 seconds, and the cold-start number is still unmeasured.

A bookkeeping agent I pushed to GitHub on 2026-11-21 gives the reviewer ten seconds to undo any approval before it writes the ledger. The obvious way to build that is a loop that asks the database every second whether anything is due. On Neon's Free plan that loop costs 182.5 CU-hours a month against a 100 CU-hour allowance.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.