System Design Cheat Sheet
System Design Cheat Sheet I. Scaling
Horizontal Scaling : Add more machines to handle increased load Vertical Scaling : Increase power of existing machines (e.g., add more CPU, RAM)
II. Load Balancing
Round-Robin : Distribute incoming traffic across multiple servers Least Connection : Route traffic to server with fewest active connections IP Hash : Direct traffic to server based on client's IP address system design cheat sheet
III. Caching
Cache Aside : Application checks cache, then database for data Read Through : Application checks cache, then database, and caches result Write Through : Application writes to cache and database simultaneously
IV. Database
Relational Databases : MySQL, PostgreSQL (use for transactional data) NoSQL Databases : MongoDB, Cassandra (use for large-scale, unstructured data) Database Sharding : Split large database into smaller, independent pieces
V. Microservices
Service-Oriented Architecture (SOA) : Break down monolithic app into smaller services API Gateway : Single entry point for clients to access multiple services Service Discovery : Mechanism for services to register and discover each other System Design Cheat Sheet I
VI. Communication
RESTful APIs : Use HTTP verbs (GET, POST, PUT, DELETE) to interact with resources gRPC : High-performance RPC framework for microservices communication Message Queue : Asynchronous communication between services (e.g., RabbitMQ, Apache Kafka)
