Geek read: System Design Interview 2 by Alex Xu & Sahn Lam
Intro
This is the review of the 2nd volume of System Design Interview by Alex Xu & Sahn Lam. Review of the 1st part you can find in the link below.
This book is a good continuation of a previous one. The authors are going through more interview scenarios and introducing new concepts using the same interview methodology. Again, this is an excellent source of knowledge. What are new concepts exactly? Check down below.
Structure
This time, we are getting 13 different interview scenarios vs. 16 scenarios before. It is important to note that we are getting way more pages — 415 in 2nd volume vs 270 pages in volume 1.
What does it mean? This time, we are getting into more details than in volume 1. More attention is being paid to sharding and going global than in the previous part.
What types of systems to design are covered?
- Proximity Service (service for finding nearby places)
- Nearby Friends (service for finding nearby people)
- Google Maps
- Distributed Message Queue
- Metrics Monitoring and Alerting System
- Ad Click Event Aggregation
- Hotel Reservation System
- Distributed Email Service
- S3-like Object Storage
- Real-time Gaming Leaderboard
- Payment System
- Digital Wallet
- Stock Exchange
What can I learn?
- What are techniques to store and query geo coordinates?
There is a deep dive into geohashing, quadtrees, and brief info about Google S2. - Consistent hashing technique
- Why CDN matters
- Websockets and SSE use cases
- Messaging models
- Data storage in Write-ahead log (WAL)
- How to handle rebalancing consumers across partitions
- How cluster replication works and consistency trade-offs
- How scaling of distributed systems work and how partitioning affects it
- Messages delivery semantics
- Picking data storage to the different system scenarios
- Windowing in data processing
- Processing data with Map Reduce
- Pessimistic and Optimistic locking
- Difference between block, file, and object storage
- What is erasure coding
- What are sorted sets in Redis
- Difference between replicated mode and cluster mode in Redis
- Synchronous vs Asynchronous communication
- Reties and dead letter queues
- Idempotency
- Distributed transactions with Two-phase commits, Try-Confirm/Cancel, and Saga
- Event Sourcing and CQRS
Summary
My opinion on volume 2 is very similar to the opinion on volume 1. This is a really great book for engineers on all levels to read.
Scenarios in Volume 2 are more complex than the ones in Volume 1, and there is much more focus on distributed systems concerns in the scenario explanations. Everything is kept in a manner of brief explanations and focusing on a practical aspect of solving the problem.
Some things are oversimplified, but you have to keep in mind that we are discussing designing something very complex during a single interview, so it’s understandable. Yet some things might get you into trouble, like the solution presented in the picture below.
Where can I get it?
You can read it online by buying access on the author’s website:
You can buy paper book on Amazon (my preference):