New series: what assistive tech really hears on your checkout page. Start with part one →
Shipwright
Home
Databases Sep 15, 2026 1 min read 3.7k views

Entity Diagrams from Five Schema Redesigns

Priya Raman

Priya Raman

Database and performance engineer. Priya reads…

Share
Cover illustration for the article Entity Diagrams from Five Schema Redesigns

How one product schema changed over four years, one diagram at a time. Databases are usually the last place teams look when an application slows down, and the first place the problem turns out to be. This post is a practical walk through how we find and fix those problems.

Version 1: one table for everything
Version 1: one table for everything
Version 2: orders split from customers
Version 2: orders split from customers
Version 3: the audit log arrives
Version 3: the audit log arrives
Version 4: multi-tenant schema
Version 4: multi-tenant schema
Version 5: read models for reporting
Version 5: read models for reporting
The whiteboard original
The whiteboard original

How the schema evolved

Every slow query investigation starts with EXPLAIN ANALYZE. It shows what the planner expected, what actually happened, and where the two diverged, which is almost always where the fix is.

What we would change next time

If you try this on your own project, start with one page or one service rather than the whole codebase. A small experiment gives you real numbers to argue with, and it is easy to roll back if the idea does not fit.

  • Read the query plan before adding an index.
  • Backfill in batches, never in one transaction.
  • Drop indexes nobody uses.
  • Test migrations against a copy of production data.
Priya Raman

Priya Raman

Author

Database and performance engineer. Priya reads query plans for fun and believes every slow page has a story worth measuring.

Related Posts

Comments 7

Ben Carter

Would love a follow-up on how you test this in CI.

Priya Raman Author

Agreed. Start simple and only reach for this when you feel the pain.

Amara Nwosu

Would this still apply on shared hosting without shell access?

Mara Okafor Member

Clear, practical, no fluff. More of this, please.

Tomás Herrera Member

Tried it on a side project over the weekend and it worked first time, which never happens.

Yuki Tanaka

This finally clicked for me after reading the docs three times.

Diego Alvarez

We run this in production at a fairly large scale and can confirm the caveats are real.

Leave a comment

Your email will not be published. Sign in for a faster experience.

Supports **bold**, *italic*, and `code`.