0% found this document useful (0 votes)
9 views

Basics of System Design

The document outlines the fundamentals of system design, including the distinction between functional and non-functional requirements, key components of system design, and the system design life cycle (SDLC). It also discusses various design strategies, database sharding, scaling methods, and the role of load balancers in optimizing system performance. Additionally, it compares structured and object-oriented analysis and design approaches.

Uploaded by

e8zxq8vk
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Basics of System Design

The document outlines the fundamentals of system design, including the distinction between functional and non-functional requirements, key components of system design, and the system design life cycle (SDLC). It also discusses various design strategies, database sharding, scaling methods, and the role of load balancers in optimizing system performance. Additionally, it compares structured and object-oriented analysis and design approaches.

Uploaded by

e8zxq8vk
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Basics of System Design

1. Functional vs Non-Functional Requirements

Functional Requirements:

 Define the specific behaviors and functions of a system.

 Represent what the system should do to satisfy user needs.

 Examples:

o User authentication and authorization.

o CRUD operations for a database.

o Generating reports.

Non-Functional Requirements:

 Define the quality attributes of a system, focusing on how it performs tasks.

 Represent constraints on the system's design and implementation.

 Examples:

o Performance: The system must handle 1,000 requests per second.

o Scalability: The system should scale to accommodate growth.

o Security: Data must be encrypted during transmission.

2. Components of System Design

System design is composed of several critical components that work together to achieve the desired
functionality. Key components include:

1. User Interface (UI):

o Enables users to interact with the system.

o Examples: Mobile apps, websites, dashboards.

2. Backend Services:

o Handles the core logic and processes requests.

o Examples: Business logic, server-side programming.

3. Database:

o Stores data persistently for retrieval and manipulation.

o Types: SQL (relational) and NoSQL (non-relational).

4. APIs:
o Provide communication between different components or systems.

o Examples: RESTful APIs, GraphQL.

5. Caching Layer:

o Stores frequently accessed data for faster retrieval.

o Example: Redis, Memcached.

6. Load Balancer:

o Distributes traffic evenly across servers to prevent overloading.

o Example: AWS Elastic Load Balancer.

7. Monitoring and Logging:

o Tracks system performance and logs events for debugging.

o Example: Prometheus, ELK Stack.

3. System Design Life Cycle (SDLC)

The SDLC outlines the process for designing, building, and maintaining a system. Key phases include:

1. Planning:

o Define project goals and feasibility.

o Gather initial requirements.

2. Analysis:

o Identify detailed functional and non-functional requirements.

o Analyze existing systems.

3. Design:

o Create high-level (HLD) and low-level (LLD) designs.

o Define architecture and select technologies.

4. Implementation:

o Write code and integrate components.

5. Testing:

o Validate the system against requirements.

o Perform unit, integration, and user acceptance testing.

6. Deployment:

o Launch the system into the production environment.

7. Maintenance:
o Address bugs, optimize performance, and implement updates.

4. Structured Analysis and Structured Design (SA/SD)

Structured Analysis:

 Focuses on understanding the system requirements.

 Uses tools like Data Flow Diagrams (DFDs) to represent processes and data flows.

Structured Design:

 Emphasizes creating modular designs with a clear hierarchy.

 Aims to reduce complexity and enhance reusability.

 Example: Breaking a system into subsystems such as UI, database, and backend.

5. System Design Strategy

Top-Down Approach:

 Start with the overall system and break it down into smaller modules.

 Focus on high-level design first.

 Example: Designing an e-commerce system by first defining user workflows.

Bottom-Up Approach:

 Start with individual modules or components and integrate them into a complete system.

 Example: Developing a payment gateway first, then integrating it into an e-commerce


platform.

Hybrid Approach:

 Combines both top-down and bottom-up strategies for flexibility.

6. Database Sharding – System Design Interview Concept

What is Sharding?

 Sharding is a database partitioning technique where large datasets are split into smaller,
manageable parts (shards).

 Each shard is stored on a separate server.

Benefits:

 Scalability: Handles larger data by distributing across servers.

 Performance: Reduces query latency by accessing only specific shards.

Challenges:
 Complexity: Increases complexity in maintaining distributed data.

 Consistency: Managing consistency across shards can be difficult.

7. System Design – Horizontal and Vertical Scaling

Horizontal Scaling:

 Adds more machines (servers) to the system.

 Used for distributed systems.

 Example: Adding more instances in a cloud service.

Vertical Scaling:

 Increases the resources (CPU, RAM) of a single machine.

 Example: Upgrading server hardware to handle more load.

8. Load Balancer in System Design

Role of a Load Balancer:

 Distributes incoming traffic across multiple servers to ensure reliability and efficiency.

 Types of algorithms:

o Round Robin: Sends requests sequentially to servers.

o Least Connections: Routes traffic to the server with the fewest active connections.

9. Routing Requests through Load Balancer

 Ensures that requests are directed to the optimal server.

 Example:

o Route static content to a cache server.

o Route dynamic content to application servers.

10. Latency and Throughput in System Design

Latency:

 The delay between a request being sent and a response being received.

 Affects user experience directly.

Throughput:

 The number of requests processed successfully per unit time.


 High throughput indicates a well-performing system.

11. Object-Oriented Analysis and Design

 Focuses on objects and their interactions.

 Emphasizes encapsulation, inheritance, and polymorphism.

12. Difference between Structured and Object-Oriented Analysis

Feature Structured Analysis Object-Oriented Analysis

Focus Processes and data flows Objects and their interactions

Tools Data Flow Diagrams (DFDs) UML diagrams

System View Functional Object-oriented

Example Billing system as data flow Billing system as a set of objects

This format provides detailed explanations of each topic in an easily digestible format. Let me know if
you need any additional details!

You might also like