Loading
Loading
Data
SQL versus NoSQL is the wrong question. Access pattern versus data model is the right one.
By the end of this chapter
"SQL or NoSQL" sorts databases by their query language, which is close to the least interesting thing about them. The useful questions are about what you will do with the data.
Concept
Start with a relational database. It gives transactions, constraints, joins, a mature query planner and a decade of operational knowledge. Move off it for a specific property it does not provide — not for a feeling about scale.
The properties a relational store provides are not conveniences; they are things you will otherwise implement yourself, less well.
| Property | If you leave, you now own |
|---|---|
| Transactions | Reasoning about partial writes by hand |
| Foreign keys | Orphaned records and the cleanup jobs to find them |
| Joins | Fan-out queries in application code, and their N+1s |
| Schema | Every historical shape of every record, forever |
| Query planner | Hand-tuned access paths that rot as data grows |
Specialised stores earn their place when an access pattern is badly served by the primary one — full-text relevance ranking, very high write-rate time series, large binary objects, graph traversals many hops deep.
Sign in to keep a note here. It is free, and nobody else can see it.
Sign inWhat this chapter was for: