SD - 系统设计查漏/速记/复习
info
本文档旨在快速复习系统设计各个题型的重难点和考点
02 Design Youtube
Step 1. Functional Requirements
- Users can upload videos. 用户可以上传视频。
- Users can watch (stream) videos. 用户可以观看(流式传输)视频。
- Users can view information about a video, such as view counts.
- Users can search for videos.
- Users can comment on videos.
- Users can see recommended videos.
- Users can subscribe to channels.
Step 2. Non-functional Requirements
- The system should be highly available (availability >> consistency). 系统应该具有高可用性(优先考虑可用性而不是一致性)。
- The system should support uploading and streaming large videos (10s of GBs). 该系统应支持上传和流式传输大型视频(数十 GB)。
- The system should allow for low latency streaming of videos, even in low bandwidth environments. 即使在低带宽环境下,该系统也 应允许低延迟的视频流传输。
- The system should scale to a high number of videos uploaded and watched per day (~1M videos uploaded per day, 100M videos watched per day). 该系统应可扩展到每天上传和观看的大量视频(每天上传约 100 万个视频,每天观看 1 亿个视频)。
- The system should support resumable uploads. 系统应支持断点续传。
- The system should protect against bad content in videos. 该系统应该防止视频中出现不良内容。
Step 3. Core Entities
- User
- Video
- Video Metadata
Step 4. APIs
- 用户上传视频
POST /upload {Video, Video Metadata}
- 用户播放视频
GET /videos/{videoId} -> Video & Video Metadata