Notes, Archivist: keeping the server bill low — DB write gremlins

This is probably old hat to most full-stack people… but writing for a person or an intended open-source project means you focus on cost control.

For some reason, AI coding agents I’ve been using keep sneaking in code that uses the DB as a mechanism for storing data that’s not persistent: heartbeats, temporary queues, and so on. Cloud DBs like Neon charge for sessions and throughput—using them for runtime state like this just eats bandwidth. This bit me in the butt overnight after a change yesterday: I woke up to a nice note from the folks at Neon saying I used my paid allocation and am in danger of cutoff.

What was the source? Claude helpfully implemented a move from polling in a process (in memory) to message passing (pub-sub) using the DB. Tsk tsk to me for not reviewing everything…