Skip to main content

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

TopicNoteDescription
SQL Fundamentalssql-fundamentals.mdSELECT, JOIN types, GROUP BY, window functions, subqueries, CTEs.
Indexes & Query Performanceindexes-query-performance.mdB-tree indexes, composite indexes, covering indexes, EXPLAIN plans, pitfalls.
Transactions & ACIDtransactions-acid.mdAtomicity, Consistency, Isolation levels, Durability, MVCC, deadlocks, @Transactional.
Connection Poolingconnection-pooling.mdHikariCP configuration (maximum-pool-size, connection-timeout), pool sizing, leak detection.
NoSQL Trade-offsnosql-tradeoffs.mdCAP theorem, BASE; Redis, MongoDB, Cassandra, Elasticsearch — when to choose each.
Schema Migrationschema-migration.mdFlyway vs. Liquibase; versioned migrations; repeatable scripts; expand-contract pattern.
MySQL, PostgreSQL & H2mysql-postgresql-h2.mdChoosing between databases, UUID handling, H2 for development, migration path to production.

Learning Path

  1. SQL FundamentalsJOIN types and GROUP BY with aggregation are the most common SQL interview questions.
  2. Indexes — understand when an index helps and when it hurts (write amplification).
  3. Transactions & ACID — isolation levels (READ COMMITTED, REPEATABLE READ, SERIALIZABLE) and their phantom-read implications.
  4. Connection Pooling — HikariCP is Spring Boot's default; know the key pool size configuration settings.
  5. Schema Migration — Flyway is the simpler option; Liquibase supports rollbacks. Know the trade-offs.
  6. MySQL, PostgreSQL & H2 — understand which database to choose for new projects, why H2 is safe for development, and how UUIDs behave differently across engines.
  • Spring Data — JPA and @Transactional are 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.