Relational & Transactions
Reason concretely about what ACID protects, pick the isolation level or explicit lock that kills a specific concurrency bug, and design concurrency control for hot, high-contention rows.
The Relational Model & ACID
Name what each ACID guarantee protects against: atomic debit+credit, fsync'd WAL durability, and consistency as your constraint-enforced invariant.
Isolation Levels & Read Anomalies
Diagnose the exact anomaly (dirty read, lost update, write skew) and fix it surgically; snapshot isolation still allows write skew, which only Serializable or a lock prevents.
Concurrency Control: MVCC, Locking, OCC
MVCC versions rows so readers and writers never block each other (at vacuum/bloat cost); go optimistic under low contention, pessimistic under high, and shard hot counters.
Storage Engines & Indexing
Say whether a workload wants a B-tree or an LSM-tree and why, design composite indexes that fully serve filter-plus-sort queries, and trace the pages/buffer-pool/WAL sequence that makes a committed row fast and durable.
B-Tree vs LSM-Tree
B-trees update pages in place for fast reads and range scans; LSM-trees append and compact for write throughput, paying read amplification and compaction stalls.
Indexing: Types, Structure & Cost
Order composite indexes equality-then-sort per the leftmost-prefix rule, make hot queries covering, and remember every index taxes every write.
Physical Storage: Pages, Buffer Pool & WAL
Writes land in dirty buffer-pool pages flushed lazily at checkpoints; the fsync'd sequential WAL is the durability point and the crash-recovery source.
NoSQL Families
Pick the right non-relational store and defend it: key-value for O(1) lookups, document for read-together trees, wide-column for write-heavy feeds, graph for deep traversals, time-series for metrics, and vector for semantic search.
Key-Value Stores
Encode everything you query on into a namespaced key, guard against hot keys, TTL cache data, and never treat a non-persistent cache as a source of truth.
Document Databases
Embed bounded read-together data, reference large or unbounded entities, respect the 16MB cap, and treat per-document atomicity as a design constraint.
Wide-Column / Column-Family Stores
Model one denormalized table per query: a partition key that spreads load and co-locates the read, clustering for the sort, time-bucketed bounded partitions, tunable quorum.
Graph Databases
Index-free adjacency keeps deep traversals local while recursive SQL joins explode; a 1-2 hop adjacency table in SQL is often the simpler right choice.
Time-Series Databases
Exploit append-only time-ordered data with columnar compression, time-partitioning, and downsampling tiers, and design against cardinality explosion from unbounded tags.
Vector Databases & Embeddings
ANN search trades recall for latency and memory: HNSW for recall in RAM, IVF-PQ at billion scale, plus filtered ANN, hybrid BM25 fusion, and re-embedding plans.
Data Modeling
Turn a feature spec into a schema that survives real traffic: normalize for write integrity, denormalize for named hot reads, model NoSQL backward from access patterns, and pick ID/key strategies that avoid hotspots.
Normalization vs Denormalization
Normalize by default for write integrity; denormalize only a named hot read path with a real read/write ratio, and use materialized views as the managed middle ground.
Query-First Data Modeling
Enumerate access patterns first, then design composite keys so each pattern is a single-partition lookup, with write sharding for hot partitions and GSIs added per named pattern.
Keys, IDs & Constraints
Avoid monotonic-key hotspots and UUIDv4 fragmentation with ULID/UUIDv7, use surrogate keys with unique natural attributes, and let DB constraints and types carry correctness.
Blob Storage & Choosing a Store
Design the storage and delivery path for large binary files with object storage, presigned URLs, and a CDN, then defend any datastore choice from decision drivers, including when NewSQL beats app-level sharding.
Blob / Object Storage
Bytes go to object storage with only the key and metadata in the DB, moved via presigned URLs and multipart upload, with lifecycle tiering and a CDN for cost and latency.
Choosing a Database & Polyglot Persistence
Reason from decision drivers to a storage family, default to boring relational, adopt NewSQL only past one node when SQL+ACID still matter, and justify every polyglot store.