Writing

What I learned building and running production software.

All posts: date, title, topic and reading time.
DateTitleTopicRead
Jul 2026Eliminating Cross-User Data Leakage in Multi-Tenant RAG Pipelines

Why most multi-tenant RAG implementations leak data, and how enforcing per-user isolation at the SQL query layer — before vector similarity searches — closes the gap completely. Deep dive into pgvector + PostgreSQL RLS with code samples from a production FastAPI backend.

AI / RAG12 min
Jun 2026NVIDIA NIM in Production: Latency, Cost, and Hallucination Trade-offs

Benchmarks from running nv-embed-v1 and llama-3.1-70b-instruct behind a FastAPI token-streaming layer. What worked, what didn't, and the gotchas that only show up at scale.

AI / RAG11 min
May 2026Refactoring a Monolith into Microservices Without a Big-Bang Rewrite

The phased migration playbook I used to cut P99 latency by 33% while keeping the legacy API live. Feature-flagged parallel runs, contract testing, and the rollback gateway that saved us twice.

Backend8 min
May 2026PostgreSQL RLS + AsyncLocalStorage: Defense-in-Depth for SaaS

Tenant context belongs in more than one place. Here's the pattern I use to propagate it through NestJS request scope and into PostgreSQL Row-Level Security policies — so even a missed WHERE clause can't leak data.

Backend10 min
Apr 2026Next.js 16 at 10K DAU: The Dashboard Optimization That Cut Loads by 33%

Composite indexes, N+1 batching, and React.memo against the right boundary. A practical story about identifying the one table that was killing dashboard load times.

Frontend7 min