Databases
Data persistence is at the heart of every backend system. This domain covers relational databases (SQL, indexes, transactions), NoSQL trade-offs, connection pooling (HikariCP), and schema migration tools (Flyway and Liquibase). Understanding how to write efficient queries and manage schema evolution safely is expected at every level.
What You'll Find Here
| Topic | Note | Description |
|---|---|---|
| SQL Fundamentals | sql-fundamentals.md | SELECT, JOIN types, GROUP BY, window functions, subqueries, CTEs. |
| Indexes & Query Performance | indexes-query-performance.md | B-tree indexes, composite indexes, covering indexes, EXPLAIN plans, pitfalls. |
| Transactions & ACID | transactions-acid.md | Atomicity, Consistency, Isolation levels, Durability, MVCC, deadlocks, @Transactional. |
| Connection Pooling | connection-pooling.md | HikariCP configuration (maximum-pool-size, connection-timeout), pool sizing, leak detection. |
| NoSQL Trade-offs | nosql-tradeoffs.md | CAP theorem, BASE; Redis, MongoDB, Cassandra, Elasticsearch — when to choose each. |
| Schema Migration | schema-migration.md | Flyway vs. Liquibase; versioned migrations; repeatable scripts; expand-contract pattern. |
| MySQL, PostgreSQL & H2 | mysql-postgresql-h2.md | Choosing between databases, UUID handling, H2 for development, migration path to production. |
Learning Path
- SQL Fundamentals —
JOINtypes andGROUP BYwith aggregation are the most common SQL interview questions. - Indexes — understand when an index helps and when it hurts (write amplification).
- Transactions & ACID — isolation levels (READ COMMITTED, REPEATABLE READ, SERIALIZABLE) and their phantom-read implications.
- Connection Pooling — HikariCP is Spring Boot's default; know the key pool size configuration settings.
- Schema Migration — Flyway is the simpler option; Liquibase supports rollbacks. Know the trade-offs.
- MySQL, PostgreSQL & H2 — understand which database to choose for new projects, why H2 is safe for development, and how UUIDs behave differently across engines.
Related Domains
- Spring Data — JPA and
@Transactionalare the Spring abstraction over the database layer. - System Design — database selection (relational vs. NoSQL) is a core system design skill.
- Docker — databases in local development environments are typically run with Docker Compose.