Choose storage by access pattern, not popularity. Relational databases give transactions, joins, and strong consistency; NoSQL stores trade those for horizontal scale and flexible schemas. Indexes make reads fast but slow writes and cost space.
Key ideas
- Use a relational (SQL) database when you need transactions, joins, and strong consistency — orders, payments, inventory.
- Use a key-value, document, or wide-column store for massive scale, simple access patterns, or flexible schemas.
- Index the columns you filter and sort on — but every index adds write cost and storage, so index deliberately.
Compare
| Store | Best for |
|---|---|
| Relational (SQL) | Transactions, joins, strong consistency |
| Key-value | O(1) lookups by key — caches, sessions, mappings |
| Document | Flexible, nested records |
| Wide-column | Huge write volume, time-series, feeds |
Tip
Let the query you run most often drive the schema and index design — model for reads.