Postmortem: a 30s host stall made my fastest chi candidate a wrong answer.
5s eval timeout. It passed seed 11, timed out on seed 27, stored as incorrect.
Two identical resubmits: cache hits by hash, never re-checked. Champion: the 18.1 ms baseline. Without the stall: 0.057 ms.
A login code and a billing export should never wait in the same line.
A clinic platform I built solo in 2019 runs both through Celery. The OTP SMS is the only thing between a user and logging in. A bulk Excel export of a clinic's billing history can take a while, and nobody is watching it. On one shared worker pool, a fat export can sit at the head of the queue while the login feels broken.
So the workers are split by queue instead of scaled as one pool: five queues, each in its own container (send_text_messages, reminders_cron, export, import, wallet), routed from a single task_routes dict. The scheduled reminder jobs fan out through their own queue too. A stuck export cannot delay an OTP because the two never share a worker.
It cost almost nothing to set up on a small cluster. Before adding Celery workers, sort tasks by how long a user can wait for each one, and give the impatient ones their own queue.
Mac mini, 10 plain chi runs. All 20 candidates are 4.4% slower than baseline (40 interleaved pairs).
2 of 10 runs crowned a slower one anyway, claiming up to 2.1%. On a 4 vCPU cloud box: 9 of 10, up to 17.2%.
chi run keeps the lowest score and never re-measures it.
An investor-matching platform I worked on reindexed a contact in Elasticsearch every time anything related to it changed. Match scores are derived data, so a Django signal fired on each change and wrote to the index right away. At scale that was potentially thousands of index writes a minute, most of them redundant.
The fix was to stop writing from signals. A change now records the contact's id in a pending-sync table with get_or_create, so repeated edits to one contact leave one row. A cron'd command drains that table in batches of 500 every 15 minutes. Per the project's docs, Elasticsearch load went from thousands of operations a minute to four batch operations an hour.
The real decision was admitting the index never had to be current to the second. Nobody could tell the difference in search freshness. If a search index is fed by model signals, check how many of its writes are the same document rewritten.
A Postgres enum is easy to grow and hard to shrink. You can add a value or rename one, but you cannot remove a value without dropping and re-creating the type. The down migration for "add a status" has nothing clean to run.
Adding the value inside a transaction has a second catch: the new value can't be used until that transaction commits, so a migration that adds a value and backfills rows with it in one step fails.
On an AI voice-agent platform carrying hundreds of migrations, I kept enumerated columns as plain text and validated them with a TypeScript union in the app. Adding a value became a reviewed code change with no DDL to roll back.
On a slow-moving schema I'd pick the database enum. The deciding questions are how often the list changes and whether every migration needs a clean rollback.
When a noise guard confirms a win, keep the number it measured, not the lucky one.
Replay of chi's director: baseline 636, one lucky 480, guard median 560, confirmed. The baseline becomes 480 anyway.
Next 8 rounds bring a real 530. All 8 labeled stuck. The champion stays 480.
Postgres row-level security can be fully configured and still enforce nothing for the database role your app connects as.
Table owners bypass row security by default unless the table also has FORCE ROW LEVEL SECURITY, and most Django apps connect as the table owner.
That is why enable_rls() in django-rls always applies FORCE, and why it ships an audit_rls command for CI that checks RLS and FORCE are both active on every protected table.
RLS that fails open is invisible. Every query still succeeds; it just returns every tenant's rows. If tenant isolation is a promise you make to customers, test the flag as well as the policy.