10 articles
Notes from the workbench
Guides, patterns and lessons learned building full-stack products and AI features.
· 16 min read
Stop Flattening Your PDFs: Document Intelligence and Structural Chunking for RAG and Agents
Many RAG failures that look like model problems are ingestion problems. If a parser flattens a PDF into a stream of characters and a splitter cuts that stream every 1,000 characters, the best embedding model and the best LLM are working with debris.
- rag
- llm
- python

· 24 min read
The Index Is There and the Plan Still Reads 1,000 Pages
How Postgres indexes work inside, why column order matters, and how the query planner makes its choices. Tested on Postgres 19 and compared with MongoDB's ESR rule.
- postgresql
- databases
- performance

· 13 min read
LSM-Trees Explained: The Storage Engine Behind Millions of Writes per Second
MemTables, write-ahead logs, SSTables, Bloom filters, and compaction, from the first write to the last merge
- databases
- storage-engines
- distributed-systems

· 11 min read
PostgreSQL Locks and Deadlocks: How They Work and How to Fix Them
Table, row, and advisory locks, safe migrations, deadlock detection, and the queries to run when production is stuck
- postgresql
- databases
- sql

· 9 min read
How Databases Scale to Millions of Reads and Writes per Second
Replicas, caches, sharding, LSM-trees, and the consistency trade-offs that come with each
- databases
- system-design
- backend

· 19 min read
Beyond Microservices: Surviving the Storm with Cell-Based Architecture
Containing failures before they become outages, with lessons from Slack, DoorDash, and AWS
- architecture
- distributed-systems
- system-design
