🍩
System Design: Zero to Hero
  • 👋About System Design Learning Journey
  • Contents
  • 1️⃣1. Fundamentals of System Design
    • 1.1. Introduction to System Design
    • 1.2. Basic Principles and Concepts
    • 1.3. Trade-offs in System Design
    • 1.4. Non-Functional Requirements in System Design
    • 1.5. Back-of-the-Envelope Calculations in System Design
    • 1.6. Mini-Project: Simple Key-Value Store in Go
Powered by GitBook
On this page
  • Modularity and Abstraction
  • Coupling and Cohesion
  • SOLID Principles in System Design
  1. 1. Fundamentals of System Design

1.2. Basic Principles and Concepts

Modularity and Abstraction

Modularity

Modularity is the degree to which a system's components may be separated and recombined. It involves dividing a system into smaller, independent parts that can be developed, tested and maintained separately.

Benefits of modularity:

  1. Easier to understand and manage complex systems

  2. Facilitates parallel development by different teams

  3. Allows for easier updates and maintenance

  4. Promotes reusability of components

Abstraction

Abstraction is the process of hiding the complex reality while exposing only the necessary parts. It helps in reducing complexity and allows you to focus on a general concept rather than specific implementations.

Levels of abstraction in system design:

  1. Physical level: How data is actually stored

  2. Logical level: What data is stored and relationships between data

  3. View level: How the data is presented to end-users

Coupling and Cohesion

Coupling

Coupling refers to the degree of interdependence between software modules. Low coupling is desirable because it reduces the impact of changes in one module on others.

Types of coupling (from tight to loose):

  1. Content coupling

  2. Common coupling

  3. Control coupling

  4. Stamp coupling

  5. Data coupling

  6. Message coupling

Cohesion

Cohesion refers to the degree to which the elements inside a module belong together. High cohesion is desirable as it indicates that the module is focused on doing one thing well.

Types of cohesion (from low to high):

  1. Coincidental cohesion

  2. Logical cohesion

  3. Temporal cohesion

  4. Procedural cohesion

  5. Communicational cohesion

  6. Sequential cohesion

  7. Functional cohesion

SOLID Principles in System Design

SOLID is an acronym for five design principles intended to make software designs more understandable, flexible, and maintainable.

  1. Single Responsibility Principle (SRP)

    • A class should have only one reason to change

    • Promotes high cohesion

  2. Open-Closed Principle (OCP)

    • Software entities should be open for extension but closed for modification

    • Encourages the use of interfaces and abstract classes

  3. Liskov Substitution Principle (LSP)

    • Objects of a superclass should be replaceable with objects of its subclasses without affecting the correctness of the program

    • Ensures that inheritance is used correctly

  4. Interface Segregation Principle (ISP)

    • Many client-specific interfaces are better than one general-purpose interface

    • Prevents classes from implementing unnecessary methods

  5. Dependency Inversion Principle (DIP)

    • High-level modules should not depend on low-level modules. Both should depend on abstractions

    • Abstractions should not depend on details. Details should depend on abstractions

    • Promotes loose coupling

Applying these principles helps create systems that are more modular, flexible, and easier to maintain and extend over time.

Previous1.1. Introduction to System DesignNext1.3. Trade-offs in System Design

Last updated 6 months ago

1️⃣