System Design Interview
If it's worker, we might want to consider:
- Fanout Pattern
- Retry-mechanism
- Dead letter queue
- Queue monitoring to see if we need more workers.
- Delivery model
- Retry-mechanism
- Design Consistent Hashing
- Save states and data of worker
- Exception handling
- Circuit breaker to switch active-passive resource
- assume that one day = 100000 seconds
- If the process is too complicated, consider using Alexu System Design Interview/14. Design youtube/DAG Scheduler Pattern instead of Alexu System Design Interview/1. Scale from zero to millions of users/Message queue
- Database/Database scaling
- Terms/Request Coalescing
- If need both read-heavy and write heavy scaling, consider using a Write-ahead log (WAL (Write A-head Logging)) instead of database
- Plain text files where new entries append at the end
- Used in Zookeeper and SQL
- For a Read-Heavy System - Consider using a Cache.
- For a Write-Heavy System - Use Message Queues for async processing
- For a Low Latency Requirement - Consider using a Cache and CDN.
- Need 𝐀tomicity, 𝐂onsistency, 𝐈solation, 𝐃urability Compliant DB - Go for RDBMS/SQL Database.
- Have unstructured data - Go for NoSQL Database.
- Have Complex Data (Videos, Images, Files) - Go for Blob/Object storage.
- Complex Pre-computation - Use Message Queue & Cache.
- High-Volume Data Search - Consider search index, tries or search engine.
- Scaling SQL Database - Implement Database Sharding.
- High Availability, Performance, & Throughput - Use a Load Balancer.
- Global Data Delivery - Consider using a CDN.
- Graph Data (data with nodes, edges, and relationships) - Utilize Graph Database.
- Scaling Various Components - Implement Horizontal Scaling.
- High-Performing Database Queries - Use Database Indexes.
- Bulk Job Processing - Consider Batch Processing & Message Queues.
- Server Load Management & Preventing DOS Attacks- Use a Rate Limiter.
- Microservices Architecture - Use an API Gateway.
- For Single Point of Failure - Implement Redundancy.
- For Fault-Tolerance and Durability - Implement Data Replication.
- For User-to-User fast communication - Use Websockets.
- Failure Detection in Distributed Systems - Implement a Heartbeat.
- Data Integrity - Use Checksum Algorithm.
- Efficient Server Scaling - Implement Consistent Hashing.
- Decentralized Data Transfer - Consider Gossip Protocol.
- Location-Based Functionality - Use Quadtree, Geohash, etc.
- Avoid Specific Technology Names - Use generic terms.
- High Availability and Consistency Trade-Off - Eventual Consistency.
- For IP resolution & Domain Name Query - Mention DNS (Domain Name System).
- Handling Large Data in Network Requests - Implement Pagination.
- Cache Eviction Policy - Preferred is LRU (Least Recently Used) Cache.