Choosing a Database
| Need | Typical choice | Why |
|---|---|---|
| Transactions, relations, flexible queries | PostgreSQL / MySQL (+ read replicas) | ACID, joins, mature; scales further than most people think |
| Huge-scale key-value, predictable latency | DynamoDB / Cassandra / ScyllaDB | partitioned and horizontally scalable; model tables around queries |
| Cache, counters, leaderboards, rate limits | Redis | in-memory data structures (sorted sets, hashes, streams) |
| Full-text and faceted search | Elasticsearch / OpenSearch | inverted index, relevance ranking |
| Analytics over billions of rows | ClickHouse / BigQuery / Snowflake / Druid / Pinot | columnar storage, fast aggregations |
| Metrics and time series | Prometheus / InfluxDB / TimescaleDB | compression, downsampling, time-range queries |
| Files, images, video, backups | S3 / GCS object storage + CDN | cheap, durable, effectively unlimited |
| Highly connected data, multi-hop queries | Neo4j (or relational tables with care) | graph traversals |
| Global strong consistency | Spanner / CockroachDB | distributed SQL on consensus replication |
| Embeddings / semantic search | pgvector, Elasticsearch kNN, Milvus, Pinecone | ANN indexes (HNSW, IVF-PQ) |
Justify the choice by access pattern, consistency needs and scale — not by brand.