Request Coalescing: Stop Cache Stampedes with Singleflight
How request coalescing collapses concurrent cache misses into a single database query, protecting your backend from catastrophic cache stampedes.
Topic
A collection of essays to explore, one idea at a time.
How request coalescing collapses concurrent cache misses into a single database query, protecting your backend from catastrophic cache stampedes.
Execution time in PostgreSQL query plans can be deeply misleading. Here is why buffer metrics reveal the true I/O footprint of your queries.
Learn how request coalescing with Go's singleflight stops cache stampedes, plus practical fixes for context cancellation and pointer data races.
Learn how UUIDv7 solves B-tree index fragmentation and buffer pool churn caused by UUIDv4, delivering sequential write performance with distributed uniqueness.
Learn why oversized database connection pools ruin performance, and how to calculate the optimal pool size for high-throughput microservices.
Learn how to prevent cache stampedes and the thundering herd problem using mutex locks, stale-while-revalidate, and XFetch to safeguard your database.
Learn why OFFSET pagination causes slow database queries and data drift, and how to implement fast, scalable cursor-based pagination in your REST APIs.
Learn how N+1 queries ruin database performance and how to solve them effectively using JOINs, prefetching, and DataLoader in TypeScript and SQL.
UUIDv4 primary keys cause B-Tree index fragmentation and kill database write performance. Discover why time-sorted UUIDv7 and ULID are better solutions.