# basilysf1709/distributed-systems architecture

> Architecture diagram of the GitHub repository basilysf1709/distributed-systems, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/basilysf1709/distributed-systems
- Repository: https://github.com/basilysf1709/distributed-systems

## Overview

##### Main Components Organization

a) Educational Resources Layer
- "Designing Data-Intensive Applications" chapters (Ch1-Ch12) in a structured grid
- MIT Course Materials section
- High-Quality Resources section (Papers, Comparisons)

b) Implementation Layer
- Algorithms Implementation Section
- Consistent Hashing (Zig)
- Hinted Handoff (Zig)
- MapReduce (Go)
- Quorum implementations

c) Practical Examples Layer
- Rate Limiting System (Go API)
- Complete architecture of the Go API implementation
- Handlers, middleware, and services

##### Specific Implementation Details

For the Rate Limiting API (as it's a concrete implementation):
**[API Layer]**
- ↓
**[Middleware Layer (Rate Limiting)]**
- ↓
**[Services Layer]**
- ↓
**[Utils Layer]**

**┌─────────────────────────────────────────────┐**
- Learning Resources             │
- ┬─────────────┬────────────────┤
- DDIA Book  │ MIT Course  │ Research Papers│
- ┴─────────────┴────────────────┘
- ↓             ↓            ↓
**┌─────────────────────────────────────────────┐**
- Practical Implementations         │
- ┬─────────────┬────────────────┤
- Algorithms  │  Rate       │    System      │
- (Zig/Go)    │  Limiting   │    Design      │
- ┴─────────────┴────────────────┘

##### Implementation Details Focus

For each practical implementation (e.g., Rate Limiting API), show:
- Entry points
- Middleware chains
- Service layer interactions
- External dependencies
- Configuration management

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Learning_Resources
        DDIA["DDIA Book Chapters"]:::educational
        click DDIA "https://github.com/basilysf1709/distributed-systems/tree/main/designing-data-intensive-applications/"
        
        subgraph Chapters
            Ch1["Chapter 1"]:::chapter
            Ch2["Chapter 2"]:::chapter
            Ch3["Chapter 3"]:::chapter
            Ch4["Chapter 4"]:::chapter
            Ch5["Chapter 5"]:::chapter
            Ch6["Chapter 6"]:::chapter
            Ch7["Chapter 7"]:::chapter
            Ch8["Chapter 8"]:::chapter
            Ch9["Chapter 9"]:::chapter
            Ch10["Chapter 10"]:::chapter
            Ch11["Chapter 11"]:::chapter
            Ch12["Chapter 12"]:::chapter
        end
        
        MIT["MIT Course Materials"]:::educational
        Papers["Research Papers"]:::educational
        DB["Database Resources"]:::educational
        click DB "https://github.com/basilysf1709/distributed-systems/tree/main/databases/"
    end

    subgraph Implementations
        direction TB
        
        subgraph Algorithms
            CH["Consistent Hashing (Zig)"]:::algorithm
            click CH "https://github.com/basilysf1709/distributed-systems/blob/main/algorithms/consistent-hashing/consistent-hashing.zig"
            
            HH["Hinted Handoff (Zig)"]:::algorithm
            click HH "https://github.com/basilysf1709/distributed-systems/blob/main/algorithms/hinted-handoff/hinted-handoff.zig"
            
            MR["MapReduce (Go)"]:::algorithm
            click MR "https://github.com/basilysf1709/distributed-systems/blob/main/algorithms/mapreduce/mapreduce.go"
            
            QR["Quorum"]:::algorithm
            click QR "https://github.com/basilysf1709/distributed-systems/tree/main/algorithms/quorum/"
        end

        subgraph RateLimiting["Rate Limiting System"]
            direction TB
            
            API["API Layer"]:::implementation
            click API "https://github.com/basilysf1709/distributed-systems/tree/main/system-design-interviews/rate-limiting-algorithms/go-api/internal/api/"
            
            Mid["Middleware Layer"]:::implementation
            click Mid "https://github.com/basilysf1709/distributed-systems/tree/main/system-design-interviews/rate-limiting-algorithms/go-api/internal/api/middleware/"
            
            Svc["Services Layer"]:::implementation
            click Svc "https://github.com/basilysf1709/distributed-systems/tree/main/system-design-interviews/rate-limiting-algorithms/go-api/internal/services/"
            
            Utils["Utils Layer"]:::implementation
            click Utils "https://github.com/basilysf1709/distributed-systems/tree/main/system-design-interviews/rate-limiting-algorithms/go-api/pkg/utils/"
            
            Main["Entry Point"]:::implementation
            click Main "https://github.com/basilysf1709/distributed-systems/blob/main/system-design-interviews/rate-limiting-algorithms/go-api/cmd/server/main.go"
            
            TB["Token Bucket"]:::implementation
            click TB "https://github.com/basilysf1709/distributed-systems/blob/main/system-design-interviews/rate-limiting-algorithms/go-api/internal/services/nameservice/TokenBucket.go"
            
            Handlers["API Handlers"]:::implementation
            click Handlers "https://github.com/basilysf1709/distributed-systems/tree/main/system-design-interviews/rate-limiting-algorithms/go-api/internal/api/handlers/"
            
            Router["Router"]:::implementation
            click Router "https://github.com/basilysf1709/distributed-systems/blob/main/system-design-interviews/rate-limiting-algorithms/go-api/internal/api/router.go"
        end
    end

    subgraph SystemDesign["System Design Interview"]
        SDR["Interview Resources"]:::interview
        click SDR "https://github.com/basilysf1709/distributed-systems/tree/main/system-design-interviews/Summary/"
    end

    %% Relationships
    DDIA --> Algorithms
    DDIA --> RateLimiting
    MIT --> Algorithms
    Papers --> Implementations
    
    Main --> API
    API --> Mid
    Mid --> Svc
    Svc --> Utils
    API --> Handlers
    API --> Router
    Svc --> TB

    %% Styling
    classDef educational fill:#3498db,stroke:#2980b9,color:white
    classDef algorithm fill:#e67e22,stroke:#d35400,color:white
    classDef implementation fill:#2ecc71,stroke:#27ae60,color:white
    classDef interview fill:#9b59b6,stroke:#8e44ad,color:white
    classDef chapter fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        L1["Educational Resources"]:::educational
        L2["Algorithms"]:::algorithm
        L3["Implementations"]:::implementation
        L4["Interview Resources"]:::interview
        L5["Book Chapters"]:::chapter
    end
```
