ALL
POSTS
59 posts so far.
April 11, 2026Python7 min read
FastAPI Depends() — the pattern I learned 7 weeks too late
Tutorials show you Depends() in week 1. Nobody shows you composition until your auth is already a mess. The 4-day refactor I could have skipped.
March 15, 2026Python10 min read
How SQLAlchemy's Identity Map Served Stale Data to 23,000 API Requests
We managed SQLAlchemy sessions manually in Flask, skipping Flask-SQLAlchemy. Forgetting one line — Session.remove() — turned the ORM's per-thread identity map into a stale-data cache that silently returned outdated records for six hours.
March 11, 2026Python9 min read
The Shared State Trap: How a FastAPI 'Optimisation' Leaked User Data
We replaced Flask's request-scoped g with a plain dict during migration. Under async concurrency, that dict silently served one tenant's data to a completely different user.