What kind of application should go in which database, and why?
You will learn: how to place each kind of application data in the right store, with fourteen design docs for common applications and a short picker to start from.
When a team asks me which database to use, the answer is rarely one database. It is a placement: this data here, that data there, and the reason for each. These pages are written as design docs, one per kind of application. Each starts from the workload, because the workload decides the store, not the other way round.
Answer four questions about one kind of data. The picker suggests a store and the design docs to read next. It is a starting point for a design review, not a verdict.
Where should an online store keep its orders, carts and stock counts?
Read the design →Where should money movements live, and how do I make sure no cent appears or disappears?
Read the design →How do I stop two people from booking the same seat, room or time slot?
Read the design →Where should user accounts live, and where should sessions and tokens go?
Read the design →One database for all customers, one schema each, or one database each?
Read the design →Where should a catalog go when every product type has different attributes?
Read the design →How do I build a home timeline that shows posts from everyone I follow?
Read the design →Where should full-text search and vector search for AI features go?
Read the design →Where should chat messages go, when there are billions of them and every conversation is read newest first?
Read the design →Where should millions of sensor readings per minute go?
Read the design →Where should an append-only history of everything that happened go?
Read the design →For how each family of database behaves, see Database families.
The outline every design doc here follows, ready to copy.
Open →On-prem, managed cloud, EC2 or Kubernetes: who does what, and the full cost.
Open →Data size, working set, memory, disk and log volume, with every assumption stated.
Open →Fifteen habits that pass code review and fail under load.
Open →Add CDC, split a database, move MySQL to PostgreSQL, add a cache.
Open →In public as a GitHub issue, or in private.
Open →Oversold stock, a retried payment, an overlapping booking and a forgotten tenant filter, on real servers.
Open →Which database does my application need? What kind of application data goes in which database, and why, as design docs, plus the anti-patterns and the decisions behind them.