Step by Step
A/C: 看Doc 理解各个步骤的真正含义,summarize & 简短总结成关键词 so that可以在每个system里面套用
ETA 8号
TinyURL
A/C: TBD
ETA 10号
Pastebin
A/C: TBD
ETA 12号
System Design Interviews: A step by step guide
Step 1: Requirements clarifications
搞清楚:
包含哪些功能
包不包括video or photos
only focus on the back-end or both back-end and front-end?
Step 2: System interface definition
目的:
establish the exact contract expected from the system
确保requirements 理解正确
Step 3: Back-of-the-envelope estimation(粗略估计)
问问题 --> estimate ==> will help (later) scaling, LB and caching.
问题example:
- scale (如多少tweets posted, 多少tweets viewed, 多少timeline generation等)
- 多大storage
- network bandwidth --> decide how to manage traffic and balance load among servers
Step 4: Defining data model
identify various entities of the system
--> NoSQL or SQL
What kind of block storage should we use to store photos and videos?
Step 5: High-level design
画block diagram with 5~6 boxes 来表示system的components
Twitter example:
并且要:根据A需求,我们要用B来handle。
例子:根据有大量read tweets,我们要用separate servers来handle。
Step 6: Detailed design
选一两个dig deeper。根据interviewer 的feedback 详细解释哪一部分。
应该always提供不同的approches,并且比较他们的pros and cons,并说为什么最后选择这种。考虑tradeoff。
可能涉及:
- database partition
- handle hot user
- optimize (LB, cache, etc.)
Step 7: Identifying and resolving bottlenecks
讨论bottlenect,越多越好,并提供不同approches to mitigate them
- single point failure(single point failure impacts the whole system) (failover?)
- replica?
- monitoring & alerts for performance?