A quick map of the main kinds of databases and what each one is good at.
A database is a program that stores data safely and lets you ask for it later. There is not just one kind. Each kind is built for a different job.
Think of a database as a specialised filing system. All of them save and fetch data, but each one organises the data in a different shape. The shape decides what is easy and what is painful.
| Type | Data shape | Best at | Example products |
|---|---|---|---|
| Relational | Tables of rows and columns, linked by keys | Joins, transactions, reports | PostgreSQL, MySQL |
| Document | JSON-like documents | Flexible shapes, one record read in one go | MongoDB, Firestore |
| Key-value | Key points to a value | Very fast lookups, caches, sessions | Redis, DynamoDB |
| Wide column | Rows with many flexible columns, grouped by a partition key | Huge write volume over many machines | Cassandra, Bigtable |
| Graph | Nodes (things) and edges (links) | Walking many links quickly | Neo4j, Amazon Neptune |
| Time series | Points stamped with time | Metrics, sensors, rolling windows | InfluxDB, TimescaleDB |
| Search engine | Inverted index of words | Full-text search and ranking | Elasticsearch, OpenSearch |
| Vector | Lists of numbers (embeddings) | Nearest neighbour: similar meaning | Pinecone, pgvector |
Money must never be lost or double counted, and reports join many tables.
The fit numbers are a simple rule of thumb to build intuition, not a benchmark. Real products overlap a lot (for example, PostgreSQL can store JSON and, with extensions, vectors), so always test with your own data.
| Term | Meaning in easy words |
|---|---|
| Database | A program that stores data safely and lets you query it |
| Schema | The agreed shape of the data: names, types and rules |
| Query | A question you ask the database |
| Access pattern | How your app reads and writes: by id, by range, by words and so on |
| Join | Combining rows from two tables using a shared key |
| Index | A shortcut structure that avoids reading everything |
| Transaction | A group of changes that succeed or fail together |
| Embedding / vector | A list of numbers that captures the meaning of text, an image or a song |
| Polyglot persistence | Using several kinds of database in one system |
| Source of truth | The one place whose data is considered correct |
| Choice | We gain | We lose |
|---|---|---|
| One general database | Simple to run, one place for data | May be slow or costly for extreme patterns |
| Many specialist databases | Best speed per job | More systems, more sync problems |
| Strong consistency | Correct answers always | Harder to spread over regions |
| Flexible schema | Fast changes, easy start | Mess can grow, fewer checks by the database |
| Managed cloud database | Less operations work | Cost and vendor lock-in |