r/SQL • • 4d ago

Discussion [ Removed by moderator ]

/r/SQL/comments/1y4ow3l/removed_by_moderator/

[removed] — view removed post

0 Upvotes

5 comments sorted by

View all comments

1

u/mirinai_ai 4d ago

One thing that makes this harder than it needs to be: relational and non-relational design start from opposite ends. Relational design starts from the data. You work out what things exist, how they relate, and normalize so each fact is stored once, and the queries come later. Document and key-value design starts from the queries. You list every way the app will read the data first, then shape the records so each read hits one place, duplicating data on purpose. Studying both at the same time gets confusing if you don't keep that difference in mind.

Some resources that are each strong on one side:

- Database Design for Mere Mortals (Michael Hernandez): slow and thorough on the relational basics, entities, keys, relationships and normalization, without assuming much background.

- SQL Antipatterns (Bill Karwin): common relational design mistakes and why they hurt later. Best once the basics click, since seeing what breaks teaches a lot.

- The DynamoDB Book (Alex DeBrie): even if you never use DynamoDB, its access-pattern-first way of thinking carries over to most NoSQL design.

- Designing Data-Intensive Applications (Martin Kleppmann), chapter 2: compares the relational, document and graph models and when each one fits.

An exercise that ties them together: take one small app and design it both ways. Write the tables first, then list the five most common screens and design documents that serve each screen in one read. Seeing where the document version has to duplicate data and where the relational version needs joins shows the trade-off faster than reading about it.