Choosing a Database
A decision guide.
We've met a lot of storage options. Now, how do you choose? Start from the data, and the questions you'll ask about it, not from the database that's fashionable this year.

- Many options
- Start from the data
- And your questions
A decision guide
Here's a simple guide. Structured data with relationships and transactions, use a relational database. Simple lookups by key, at huge scale, use a key value store. Flexible records, use a document store. Big files, use object storage. Full text search, use a search engine. And time stamped measurements, use a time series database.
| Data | Choose |
|---|---|
| Related, transactional | Relational (Postgres) |
| Lookup by key, huge scale | Key-value (DynamoDB) |
| Flexible records | Document (MongoDB) |
| Big files | Object storage (S3) |
| Full-text search | Search (Elasticsearch) |
| Metrics over time | Time-series |
Good habits
A few habits help. Default to a relational database, because it's flexible and well understood. Add a specialised store only when you have a clear need. Remember that every extra database is one more thing to run, back up, and monitor. And keep one source of truth for each piece of data.
| key | value |
|---|---|
| Default | relational |
| Specialise | for a clear need |
| Each store | costs operations |
| One truth | per piece of data |
Summary
Choose storage from the shape of your data and your queries. Default to relational, and add specialised stores when needed. Next, let's practise with Shoply.
Key takeaways- Data shape first
- Relational by default
- Specialise with reason