Non-Fiction, Self-Help, Database

Chunking Database Schemas

Recall table structures by grouping related entiti

by Sapp Annalisa

  • English
  • 146 pages
  • 2026
  • SamEnrico

Recall table structures by grouping related entities.

Formats

About this book

Recall table structures by grouping related entities.

Free sample

Chapter 1: The 3AM Join...--–- The pager woke Sarah at 2:47 AM. Not with the urgent shriek of a server-down alert, but with the dull, persistent buzz of a query timeout. She was the senior database engineer on call for a fast-growing fintech startup, and she had seen this before. The report was simple on its face: “Show me customer 422’s last three completed orders, including line items, shipping status, and any applied discounts.” In English, four nouns. In SQL, a monster.She pulled up the query from the logs.

Forty-seven lines. Fourteen tables. Eight LEFT OUTER joins. Three subqueries. Two Common Table Expressions that existed only to work around the fact that the schema had been patched nine times in four years without a single refactoring.

She ran the query on a replica. Ninety-one seconds. The application timed out at thirty. The customer had clicked “refresh” three times, which meant the system had actually run the query six times, each retry piling onto the database connection pool until everything slowed to a crawl.Sarah understood the schema perfectly. She had been at the company for two years.

She knew that customer lived in one schema, address in another, address_status in a third, subscription in a fourth, subscription_plan in a fifth, order_header in a sixth, order_line in a seventh, order_line_item in an eighth, product in a ninth, discount in a tenth, discount_application in an eleventh, shipment in a twelfth, shipment_status in a thirteenth, and payment in a fourteenth. She knew this because she had drawn the ER diagram on her office wall with sticky notes. It took up an entire whiteboard, eight feet wide. Her new manager had asked if it was a modern art project.The problem was not that the database was wrong. It was perfectly normalized.

Every table was in Third Normal Form (3NF). Every foreign key was enforced. Every column had the correct data type. By the textbooks of the 1970s and 1980s, this was a masterpiece. By the standards of a human brain at 3:00 AM, it…

This is the end of the free sample. Get the eBook to keep going. Buy now

Read a sample →

Contents

  1. Chapter 1
  2. Chapter 2
  3. Chapter 3
  4. Chapter 4
  5. Chapter 5
  6. Chapter 6
  7. Chapter 7
  8. Chapter 8
  9. Chapter 9
  10. Chapter 10
  11. Chapter 11
  12. Chapter 12

Details

Author
Sapp Annalisa
Publisher
SamEnrico
Language
English
Genre
Non-Fiction, Self-Help, Database
Released
2026-06-09
Pages (approx.)
146
Available as
eBook, Audiobook

Read better in the ZLOADR app

Your eBooks on your phone or tablet. Sign in with your SamEnrico account and start reading.

More by Sapp Annalisa

See all

You may also like

See all