[Fundamental] System Design Flashcards
1
Q
Main strategy
A
Requirement clarification
Main API
- Single server
- Add DB
- Add multiple servers, add Load Balancer
- Additional strategies: based on use case find bottleneck and appropriate solution
2
Q
Database Performance Improvement
A
- Replication
- Writer instance
- Reader instance
- Partiotioning: Divide columns
- Sharding: Divide Rows
- Indexing
- Materialized View: Pre-compute long-running query, ideally low writes
- Denormalization
3
Q
Caching
A
Redis (WIP)
4
Q
CDN
A
5
Q
Async Pattern
A
Message broker for long running tasks
6
Q
Real time use cases
A
- WebSockets: Ideal for low-latency, bidirectional communication but requires managing persistent connections.
- SSE (Server-Sent Events): Good for unidirectional, real-time updates but has scalability limits.
- HLS/DASH: Best for live video streaming with adaptive bitrate but has higher latency.
- MQTT: Efficient for lightweight messaging in IoT but needs a broker.
- Kafka Streams: Powerful for real-time data processing but more complex.
- UDP: Low latency for gaming but requires handling packet loss.
7
Q
A