Pillar #6 — Final 8 chương Interview-critical Synthesis

System Design

Trụ cột tổng hợp cuối — vận dụng Networking + Database + OOP để thiết kế hệ thống quy mô lớn. Từ scalability cơ bản đến case study Twitter / Uber / Netflix. Đây là phần phỏng vấn senior tốn nhiều thời gian nhất — và cũng là nơi tư duy kỹ sư được test thực sự.

Lộ trình 8 chương

Học theo thứ tự để xây dần từ nguyên lý → component lẻ → tổng hợp case study. Mỗi chương ~600–900 dòng với architecture diagram, trade-off analysis, ví dụ thật, và quiz.

CHƯƠNG 01

Scalability Fundamentals

Vertical vs horizontal scaling, latency vs throughput, capacity planning, back-of-envelope math, bottleneck analysis, các metric cốt lõi (P50/P95/P99).

Scale up/out P99 latency QPS Capacity
CHƯƠNG 02

Load Balancer & Reverse Proxy

L4 vs L7, các thuật toán (round-robin, least connections, IP hash, weighted), health check, sticky session. nginx, HAProxy, AWS ALB/NLB, Envoy.

L4/L7 Round-robin nginx Health check
CHƯƠNG 03

Caching Strategies

Multi-tier caching (browser → CDN → reverse proxy → app → DB), patterns (cache-aside, write-through, write-behind), eviction (LRU/LFU/ARC), TTL, invalidation, stampede protection.

Multi-tier LRU Stampede Redis
CHƯƠNG 04

Database Scaling & Data Patterns

Read replica routing, sharding strategies (range/hash/directory), hot partition, denormalization for scale, polyglot persistence, CDC, CQRS, Event Sourcing.

Sharding CDC CQRS Hot shard
CHƯƠNG 05

Message Queue & Async Communication

Kafka, RabbitMQ, SQS/SNS. Pub-sub vs queue, event-driven, eventual consistency, sagas, idempotency, exactly-once vs at-least-once delivery, dead letter queue.

Kafka Pub/Sub Saga Idempotent
CHƯƠNG 06

Microservices vs Monolith

Khi nào split, decomposition strategy (BC), service mesh (Istio/Linkerd), distributed tracing, sync vs async, circuit breaker, bulkhead, retry/backoff/timeout.

Microservice Service Mesh Circuit breaker Tracing
CHƯƠNG 07

CDN, Rate Limiting, API Gateway, Security

CDN edge, rate limiting algorithms (token bucket, leaky bucket, sliding window), API Gateway (Kong, AWS API GW), DDoS protection, edge auth, observability.

CDN Token bucket DDoS Observability
CHƯƠNG 08

Design Case Studies

5 case study kinh điển: URL shortener (Bit.ly), Twitter timeline (fan-out), Uber (geospatial), Netflix (CDN + microservice), Notification service. Khung tư duy interview.

Bit.ly Twitter Uber Interview

Cách tiếp cận hiệu quả

  1. Đọc giáo trình tổng quan trước để có bản đồ tư duy: scalability principles → component → integration → case study.
  2. Học theo thứ tự 1→8. Case study (Ch8) yêu cầu nắm vững 7 chương trước.
  3. Làm case study như interview thật — viết requirement, tính capacity, vẽ architecture, identify trade-off.
  4. Đọc engineering blog của Stripe, Uber, Discord, Netflix, Cloudflare — đây là tài liệu System Design chất lượng nhất.
  5. Tránh "buzzword bingo" — đừng nói "microservice + Kubernetes + Kafka" nếu không hiểu trade-off cụ thể.
"System design không có câu trả lời đúng — chỉ có trade-off có ý thức. Senior phỏng vấn đo bạn ở khả năng nhận ra trade-off và giải thích lựa chọn, không ở việc nhớ tên công nghệ."