Things I've written down.
Ruby, Rails, performance, security and applied machine learning. Updated when something feels finished.
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.
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.
SQLite in production, honestly
It is a real option for real applications now — with one constraint that decides your entire deployment shape.
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.
Prompt injection isn't XSS, but it rhymes
Both come from mixing instructions with data. The difference is that there is no escaping function for English.
Where Rails memory actually goes
Your app is not leaking. Ruby freed the memory and the allocator kept it. Arenas, fragmentation, and the two environment variables that fix most of it.
What's actually in your session cookie
Rails signs the session cookie, so users can read it but not forge it. That distinction decides what may go in it.
Your connection pool is probably wrong in one of two directions
ActiveRecord::ConnectionTimeoutError and "too many connections" are the same mistake made in opposite directions. The arithmetic is simple.
What belongs in a job, and what belongs in the request
Moving work to a background job doesn't make it faster. It moves who waits, and sometimes that's the wrong trade.