Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.
Cheat sheet · Web DevelopmentFree

Sefism Choosing the Right Database Cheat Sheet

A reference in 10 chapters and 78 concepts for picking the right database for each job: a decision chart from data and access patterns to a database type, then relational, document, key-value and cache, search, vector, columnar and warehouse, graph, time series and object storage, with one at-a-glance card per type and tables of matching managed services on AWS, Azure and Google Cloud. It follows the Sefism Choosing the right database roadmap. Use it whenever you start a project or someone suggests adding a database.

Chapters

10

Sefism · Oct 2026

Concepts

78

Sefism · Oct 2026

Rules of thumb

10

Sefism · Oct 2026

Glossary terms

63

Sefism · Oct 2026

Database types covered

10

Sefism · Oct 2026

Format

Cheat sheet

Topic

Web Development

Provider

Sefism

Time needed

Reference

Level

Beginner

Access

Free

What this cheat sheet is

The Sefism Choosing the right database cheat sheet is a reference for picking a database for each job in an app: relational, document, key-value, cache, search, vector, warehouse, graph, time series and object storage. It is written for students and developers building apps, and it follows the Choosing the right database roadmap chapter by chapter.

It has 10 chapters and 78 concepts. Each concept is a short card: what it is, why it matters, and for many the mistake people make with it. Three things make it quick to use: a decision chart that turns your data and access patterns into a database type, one at-a-glance card per type, and cloud tables that list the matching managed service on AWS, Azure and Google Cloud. A glossary of 63 terms covers the smaller words.

Chapter by chapter

1. Start from the data

Seven concepts: the decision chart, structured, semi-structured and unstructured data, access patterns, the read-write mix and data size, consistency needs, ACID transactions and the questions to ask before choosing. Everything else in the sheet depends on these answers.

2. Relational databases

Seven concepts: what a relational database is, PostgreSQL as the default, where MySQL, SQLite and SQL Server fit, JSON columns, constraints, migrations, drivers and ORMs, and why one Postgres is often enough.

3. Document databases

Seven concepts: the document model, embed or reference, MongoDB, Cloud Firestore, Firebase Security Rules, schema validation for documents and when a document database fits.

4. Key-value stores and caching

Eight concepts: key-value stores, Redis, Valkey and Memcached, cache-aside, TTL and eviction, cache invalidation, cache or primary store, and Amazon DynamoDB.

5. Search

Seven concepts: the inverted index, relevance ranking and BM25, PostgreSQL full-text search, Elasticsearch and OpenSearch, Meilisearch and Typesense, facets, and keeping a search index in sync.

6. Vector search for AI

Eight concepts: embeddings, similarity and distance metrics, approximate nearest neighbour indexes, pgvector, dedicated vector databases, metadata filtering, hybrid search and when pgvector is enough.

7. Columnar databases and warehouses

Eight concepts: OLTP versus OLAP, columnar storage, the data warehouse, BigQuery, Snowflake and Redshift, ClickHouse, DuckDB and what drives warehouse query cost.

8. Graph, time series and object storage

Seven concepts: graph databases, Cypher and GQL, time-series data, TimescaleDB and InfluxDB, retention and roll-ups, object storage and presigned URLs.

9. Choosing, combining and running it

Ten concepts: managed versus self-hosted, polyglot persistence, free tiers to learn on, what drives database cost, Firebase versus Supabase, a decision checklist, backups, restores and exports, and three tables of cloud equivalents for app databases, for search, vectors and warehouses, and for graph, time series and files.

10. Each type at a glance

Nine cards, one per type (relational, document, key-value and cache, search, vector, columnar and warehouse, graph, time series, object storage), each with when to use it, when to avoid it, example products and managed options. Read them with the decision chart in chapter 1.

Rules of thumb

The sheet closes with ten tips, among them: describe the data and its top five access patterns before you name a product; when unsure, start with PostgreSQL and add a second database only for a measured limit; files go in object storage and the database keeps only the key; a cache must always be rebuildable; try Postgres full-text search and pgvector before running a separate engine; test options with your own data, never someone else's benchmark; a backup counts only after you have restored it once; and write your choice down with one rejected alternative.

How to use it with the roadmap

  • After each stage, read the matching chapter and its at-a-glance card in chapter 10, and check you can say when to use the type and when to avoid it.
  • When you start a new project, go through chapter 1's decision chart with your own data brief before you install anything.
  • When someone suggests adding a database, check the "avoid it when" line on its card and the cost chapter before you agree.
  • When you move to a cloud, use the cloud equivalents tables in chapter 9 to find the managed service with the same job.

How it works on Sefism

Everything on Sefism is free to learn from. The public cheat sheet page shows every chapter title, with the first chapters open to read. Keeping the sheet uses credits and opens every chapter in your member area; if you add the Choosing the right database roadmap to your dashboard, its cheat sheet comes with it, and the first roadmap you add is free. New members get starting credits, and if you have a question the sheet does not answer, you can send it to Tauseef.

Related on Sefism

FAQ

Is this a substitute for the roadmap? No. The roadmap is the plan, with a hands-on task for every type; the sheet is what you check when you make a real choice.

What is an access pattern? A question your app asks of its data, such as "the last 20 orders for this customer" or "all products under 5,000 rupees in this category". Writing the top five down is the first step in chapter 1.

What is the difference between OLTP and OLAP? OLTP is many small reads and writes by the app, which row-based databases such as PostgreSQL handle well. OLAP is large reports over many rows, which columnar warehouses and DuckDB handle much faster.

Does the sheet recommend specific cloud products? It lists the matching managed service on AWS, Azure and Google Cloud for each type, so you can find the right one on the cloud you already use, without favouring a provider.

databasesqlbackendcloud

Ready to start?

Opens on Sefism in a new tab.

Open the cheat sheet
Link broken or out of date?

Report a problem

With "Sefism Choosing the Right Database Cheat Sheet". Only Tauseef reads this.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.