You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System design refers to the process of defining the architecture, components, modules, interfaces, and data of a system to satisfy specified requirements.
Requirements Gathering Process
Understand the Problem: Identify the scope and objectives.
Stakeholder Involvement: Gather input from stakeholders.
Document Requirements: Clearly define functional and non-functional requirements.
Prioritize Requirements: Determine critical features for MVP.
Functional vs Non-Functional Requirements
Functional Requirements: Define specific behavior or functions (e.g., login, data retrieval).
Non-Functional Requirements: Define system attributes like performance, scalability, and security.
Components of System Design
Frontend: User interfaces and experience.
Backend: Servers, APIs, and databases.
Database: Storage and retrieval of data.
Networking: Communication between components.
System Design Life Cycle | SDLC (Design)
Requirements Analysis
System Architecture
Component Design
Implementation
Testing
Deployment
Maintenance
Scalability in System Design
The ability of a system to handle growth in workload efficiently.
Scalability and How to Achieve It
Horizontal Scaling: Adding more machines.
Vertical Scaling: Upgrading existing machines.
Horizontal vs Vertical Scaling
Feature
Horizontal Scaling
Vertical Scaling
Cost
Higher
Lower
Implementation
Complex
Simpler
Scalability Limit
High
Limited
Primary Bottlenecks that Hurt Scalability
Database Overload
Network Latency
CPU and Memory Constraints
System Architectural Styles
Monolithic Architecture
Single codebase.
Pros: Simple to develop.
Cons: Difficult to scale and maintain.
Microservices Architecture
Modular services.
Pros: Scalable and maintainable.
Cons: Complex to implement.
Monolithic vs Microservices Architecture
Feature
Monolithic
Microservices
Scalability
Limited
High
Flexibility
Low
High
Event-Driven Architecture
Systems respond to events asynchronously.
Serverless Architecture
Pay-as-you-go execution model.
High-Level Design (HLD)
What is High-Level Design?
Focuses on the architecture and major components of a system.
Availability in System Design
Ensures the system is operational and accessible.
Consistency in System Design
Guarantees data integrity across the system.
Reliability in System Design
Ensures the system operates correctly and recovers from failures.
CAP Theorem
Consistency: Every read receives the latest write.
Availability: Every request receives a response.
Partition Tolerance: System functions despite network failures.
Difference Between Concurrency and Parallelism
Concurrency: Multiple tasks make progress simultaneously.
Parallelism: Tasks execute simultaneously on different processors.
Load Balancer
Distributes traffic across servers to improve performance and reliability.
Consistent Hashing
Distributes data across nodes to ensure minimal redistribution during changes.
Content Delivery Network (CDN)
Caches content closer to users to reduce latency.
Latency and Throughput
Latency: Time taken to process a request.
Throughput: Number of requests processed in a given time.
Caching in System Design
Improves performance by storing frequently accessed data.
What is API Gateway?
Manages APIs and facilitates communication between microservices.
Message Queues
Enables asynchronous communication between components.
Communication Protocols
HTTP, gRPC, WebSocket, etc.
Network Protocols and Proxies
TCP/IP, DNS, Reverse Proxy, etc.
Unified Modeling Language (UML)
Standard for visualizing system design.
Databases in Designing Systems
Which Database to Choose – SQL or NoSQL
SQL: Structured data, complex queries.
NoSQL: Flexible schema, high scalability.
File and Database Storage Systems
File Storage: Stores files in directories.
Database Storage: Organized data in tables or collections.
Database Replication in System Design
Copies data across multiple servers for reliability.
Database Sharding
Splits data across multiple servers for scalability.