<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>database-optimization on Dhaval Shah</title><link>https://www.dhaval-shah.com/categories/database-optimization/</link><description>Recent content in database-optimization on Dhaval Shah</description><generator>Hugo -- gohugo.io</generator><lastBuildDate>Mon, 29 Jun 2026 01:00:50 +0000</lastBuildDate><atom:link href="https://www.dhaval-shah.com/categories/database-optimization/index.xml" rel="self" type="application/rss+xml"/><item><title>Billion User Trap - The Pagination Mistake That Can Take Down Your Database</title><link>https://www.dhaval-shah.com/billion-user-pagination-db-design/</link><pubDate>Mon, 29 Jun 2026 01:00:50 +0000</pubDate><guid>https://www.dhaval-shah.com/billion-user-pagination-db-design/</guid><description>Background In Part 1, we established that access patterns &amp;amp; not entities should drive your design. In Part 2, we fixed the database by replacing brittle three-table JOINs with a covering index, reducing P99 on the listing query. The schema was right. The index was right. The listing API itself was fast. And then it quietly started taking the database down - not because of a bad query, but because of how that fast query was being paginated.</description></item><item><title>Billion User Trap - The Database Design That Looked Perfect on Day One</title><link>https://www.dhaval-shah.com/billion-user-trap-db-design/</link><pubDate>Tue, 16 Jun 2026 02:00:50 +0000</pubDate><guid>https://www.dhaval-shah.com/billion-user-trap-db-design/</guid><description>Background In the first part we established the foundational principle that separates systems which survive scale from systems that collapse under it - design for access patterns, not for entities.
In this second part we double click on the database design of the User Profile system and try to understand its impact from performance engineering and scalability standpoint. Specifically - why the schema that adheres to proper normalization, proper foreign keys, and proper indexes, becomes a latency problem.</description></item></channel></rss>