สรุป Topics ของบทที่ 16-28 สำหรับการเตรียมตัวสัมภาษณ์ System Design
16. Proximity Service
ค้นหาสถานที่ใกล้เคียง - Geohash, Quadtree, Google S2, Location-based Search
17. Nearby Friends
Real-time Location Sharing - WebSocket, Redis Pub/Sub, Geohash
18. Google Maps
Map Rendering, Navigation, Routing Tiles, ETA, Shortest Path
19. Message Queue
Kafka, Producer/Consumer, Replication, Delivery Semantics
20. Monitoring
Time-series DB, Push/Pull Model, Alerting, Visualization
21. Ad Click Aggregation
Stream Processing, MapReduce, Deduplication, Lambda Architecture
22. Hotel Reservation
Concurrency, Optimistic/Pessimistic Locking, Overbooking
23. Email Service
SMTP, IMAP, Metadata DB, Search, Deliverability
24. S3-like Storage
Object Storage, Data Nodes, Durability, Replication
25. Gaming Leaderboard
Redis Sorted Set, Skip List, Sharding, Caching
26. Payment System
Pay-in/Pay-out, PSP Integration, Reconciliation, Idempotency
27. Digital Wallet
Event Sourcing, Saga Pattern, TC/C, CQRS
28. Stock Exchange
Matching Engine, Order Book, Sequencer, High Availability
Key Concepts Summary
Distributed Systems
- Consistency Models: Strong, Eventual, Causal
- Replication Strategies: Synchronous, Asynchronous, Quorum-based
- Partitioning: Hash-based, Range-based, Consistent Hashing
Data Storage
- Time-series Data: Metrics, Monitoring, Analytics
- Object Storage: Files, Media, Backups
- Key-Value Store: Caching, Session, Config
- Document Store: Flexible Schema, Search
Patterns
- Event Sourcing: Store state changes as events
- Saga Pattern: Distributed transactions with compensation
- CQRS: Separate read/write models
- Fan-out: Push updates to multiple subscribers
Interview Tips
- Clarify Requirements: ถามคำถามเพื่อทำความเข้าใจ Scope
- Scale Estimation: ประมาณ QPS, Storage, Traffic
- High-Level Design: เสนอ API และ Data Model
- Deep Dive: เลือก Components ที่สำคัญและอธิบาย Trade-offs
- Wrap Up: สรุปและพูดถึง Bottlenecks
เนื้อหานี้อ้างอิงจาก ByteByteGo - System Design Interview - An Insider's Guide