SDE & MLE Prep

Choosing a Database

NeedTypical choiceWhy
Transactions, relations, flexible queriesPostgreSQL / MySQL (+ read replicas)ACID, joins, mature; scales further than most people think
Huge-scale key-value, predictable latencyDynamoDB / Cassandra / ScyllaDBpartitioned and horizontally scalable; model tables around queries
Cache, counters, leaderboards, rate limitsRedisin-memory data structures (sorted sets, hashes, streams)
Full-text and faceted searchElasticsearch / OpenSearchinverted index, relevance ranking
Analytics over billions of rowsClickHouse / BigQuery / Snowflake / Druid / Pinotcolumnar storage, fast aggregations
Metrics and time seriesPrometheus / InfluxDB / TimescaleDBcompression, downsampling, time-range queries
Files, images, video, backupsS3 / GCS object storage + CDNcheap, durable, effectively unlimited
Highly connected data, multi-hop queriesNeo4j (or relational tables with care)graph traversals
Global strong consistencySpanner / CockroachDBdistributed SQL on consensus replication
Embeddings / semantic searchpgvector, Elasticsearch kNN, Milvus, PineconeANN indexes (HNSW, IVF-PQ)

Justify the choice by access pattern, consistency needs and scale — not by brand.