← all notes
Guide5 min

Choosing a database — SQL vs NoSQL

the question isn't 'best database'. it's 'what queries will you run?'.

People ask 'PostgreSQL or MongoDB?' like there's one right answer. There isn't. The right question is: what queries will you run, and how do they relate to each other?

Relational wins when your data has relationships you'll always query together — orders and customers, roles and permissions, transactions and balances. Fixed schemas, migrations and ACID are worth the ceremony when the business counts beans.

Document stores shine when your reads are a known shape, writes arrive in bigger chunks, and the schema shifts every week. I've shipped both — the rule I apply: if the business calls it a 'record', go relational. If it calls it a 'document', go documents.what queries will you run

the point is simple — the details are not.