🗄️ Database Knowledge Base
A structured guide covering everything you need to know about databases — from foundational SQL concepts to distributed NoSQL systems — with interview questions for each topic.
Topics Covered
| # | Topic | Description |
|---|---|---|
| 1 | Relational Fundamentals | SQL, joins, keys, constraints |
| 2 | Database Design & Normalization | ERD, 1NF–BCNF, schema patterns |
| 3 | Advanced SQL | Window functions, CTEs, recursive queries |
| 4 | Schema Migrations | Flyway, Liquibase, zero-downtime |
| 5 | Indexing & Query Optimization | B-Tree, covering indexes, EXPLAIN |
| 6 | Query Planner & Optimizer | CBO, statistics, join algorithms |
| 7 | Transactions & Concurrency | ACID, isolation levels, MVCC, deadlocks |
| 8 | Storage Engines & Data Structures | InnoDB, LSM trees, WAL, buffer pool |
| 9 | Replication & Partitioning | Leader-follower, sharding, CAP |
| 10 | NoSQL & Distributed Databases | Document, key-value, wide-column, graph |
| 11 | Caching Strategies | Redis, eviction, cache patterns, pitfalls |
| 12 | Performance & Monitoring | Slow queries, profiling, connection pooling |
| 13 | Full-Text Search | Inverted index, tsvector, Elasticsearch |
| 14 | Data Warehousing & OLAP | Star schema, ETL/ELT, materialized views |
| 15 | Database Patterns for Microservices | Outbox, Saga, CQRS, Event Sourcing |
| 16 | Time-Series Databases | TimescaleDB, InfluxDB, Prometheus |
| 17 | Backup & Recovery | RPO/RTO, PITR, DR checklist |
| 18 | Database Security | SQL injection, encryption, auditing |
Java / Spring Tip
Throughout this guide, Java and Spring Data / JPA notes are included where relevant to bridge theory and real-world usage.
Advanced Editorial Pass: Database Decision-Making Under Real Constraints
Senior Engineering Focus
- Choose patterns by access shape, consistency needs, and scaling envelope.
- Treat schema, indexing, and query behavior as a single design unit.
- Plan operability early: migration, observability, backup, and recovery.
Failure Modes to Anticipate
- Tool-first choices that ignore data-model and workload realities.
- Performance optimization without plan-level evidence.
- Operational blind spots in replication, failover, and restore flows.
Practical Heuristics
- Document data contracts and change strategy before shipping.
- Validate assumptions with production-like cardinality and skew.
- Define ownership for schema evolution and incident response.