Database là trái tim của mọi hệ thống. Khóa học này phủ toàn bộ chiều rộng — từ thiết kế schema, viết SQL chuẩn, hiểu Index/Transaction/MVCC, đến NoSQL, Replication, Sharding, Caching, Search, OLTP vs OLAP, và Online Migration ở quy mô production. Mỗi chương đều có ví dụ thực tế (PostgreSQL/MySQL/MongoDB/Redis), bài tập, và quiz.
Học theo thứ tự để xây nền vững. Mỗi chương dày ~600–900 dòng nội dung chi tiết, gồm lý thuyết, ví dụ code, ASCII diagram, bài tập, và quiz cuối chương.
Lịch sử DB, mô hình quan hệ của Codd, schema/table/row/column, các loại key (PK/FK/UNIQUE), constraint.
5 nhóm câu lệnh SQL. CREATE/ALTER/DROP, INSERT/UPDATE/DELETE, SELECT cơ bản, GRANT/REVOKE, BEGIN/COMMIT/ROLLBACK.
INNER/LEFT/RIGHT/FULL/CROSS JOIN, EXISTS vs IN, CTE đệ quy (WITH RECURSIVE), Window Functions (ROW_NUMBER, RANK, LAG/LEAD).
1NF/2NF/3NF/BCNF với ví dụ thật, khi nào denormalize, anti-pattern thường gặp, ERD, naming conventions.
Cấu trúc B-tree, Hash, Bitmap, GIN/GiST. Composite index, Covering index, Index selectivity, khi nào index không được dùng.
ACID là gì, 4 isolation level (Read Uncommitted → Serializable), Dirty/Non-repeatable/Phantom read, ví dụ minh họa từng anomaly.
2PL, Optimistic vs Pessimistic locking, MVCC trong Postgres, Lock escalation, Deadlock detection, SELECT FOR UPDATE.
EXPLAIN ANALYZE đọc thế nào, Logical vs Physical plan, Cost-based optimizer, Statistics, khi nào hint DB.
4 họ NoSQL: Redis (KV), MongoDB (Document), Cassandra (Wide-column), Neo4j (Graph). CAP theorem, BASE, Eventual consistency.
Master-Slave/Multi-Master, Sync/Async/Semi-sync, Read replicas, Range/Hash/Directory sharding, Resharding, Consistent hashing.
Redis caching pattern (cache-aside, write-through, write-behind), Elasticsearch inverted index, Data warehouse, Star schema, ETL/ELT.
Logical vs Physical backup, PITR, WAL, Online schema migration (gh-ost, pt-online-schema-change), Connection pooling, N+1, anti-pattern.