Field notes — essays & research notes

Things I've written down.

Ruby, Rails, performance, security and applied machine learning. Updated when something feels finished.

51 posts · page 1 of 6
LLM & AGENTS 08 / 15 / 26

pgvector or a dedicated vector database?

For most applications the answer is the database you already run, and the threshold where that stops being true is higher than the marketing suggests.

3 min
RUBY & RAILS 08 / 13 / 26

The callback that fires in a test you didn't write

Active Record callbacks are convenient until a fixture, a seed script or a bulk import triggers side effects nobody expected.

3 min
RUBY & RAILS 08 / 11 / 26

Indexes that earn their keep

Adding an index is the reflex fix for a slow query. Column order, cardinality and write cost decide whether it does anything at all.

3 min
SECURITY 08 / 08 / 26

A CSP that actually stops XSS

Most content security policies are decorative. The directive that matters is script-src, and 'unsafe-inline' undoes the whole thing.

3 min
RUBY & RAILS 08 / 06 / 26

Fat models, skinny controllers, and the third option

Both halves of the old advice produce the same result at scale: one enormous class. Naming the operation is what actually helps.

2 min
RUBY & RAILS 08 / 04 / 26

Three threads, not five: what the GVL actually costs you

Rails ships a default most people never revisit. Here's how CRuby's global lock decides your thread count for you, and the arithmetic for picking workers.

5 min
SECURITY 08 / 01 / 26

Authenticated is not authorised

The most common real-world web vulnerability isn't injection. It's an endpoint that checks who you are and forgets to check what you may touch.

3 min
RUBY & RAILS 07 / 31 / 26

SQLite in production, honestly

It is a real option for real applications now — with one constraint that decides your entire deployment shape.

2 min
RUBY & RAILS 07 / 29 / 26

Four caches, and knowing which one you need

HTTP, fragment, low-level and query caching solve different problems. Reaching for the wrong one hides the bug instead of fixing it.

3 min