# zmanda/amanda architecture

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

- Interactive diagram: https://gitdiagram.com/zmanda/amanda
- Repository: https://github.com/zmanda/amanda

## Overview

##### Main Components Identification
The system should be divided into these major components:

a. Core Components:
- Amanda Server (Backup Controller)
- Amanda Clients
- Storage Subsystem
- Authentication & Security Layer
- Database/Catalog System

b. Supporting Components:
- Configuration Management
- Scheduling System
- Recovery System
- Monitoring & Reporting

##### Component Relationships

a. Control Flow:
- Server → Clients (backup requests, configuration)
- Clients → Server (backup data, status)
- Server → Storage (data writing/reading)

b. Data Flow:
- Backup Path: Client → Network → Server → Holding Disk → Tape/Cloud
- Recovery Path: Tape/Cloud → Server → Network → Client

##### Architectural Patterns

a. Client-Server Architecture:
- Clear separation between server-src/ and client-src/ components
- Network boundary

b. Modular Design:
- Device abstraction (device-src/)
- Transfer system (xfer-src/)
- Authentication methods (common-src/security*)

##### Specific Implementation Details

Technical elements:

a. Storage Layer:
- Holding Disk
- Tape Devices
- Cloud Storage (S3)
- RAIT (Redundant Array of Independent Tapes)

b. Security Components:
- SSH/SSL Security
- Kerberos Support
- Encryption Systems

##### Key Interfaces

Interfaces:

a. External:
- Client Applications (application-src/)
- Storage Devices (device-src/)
- Authentication Systems

b. Internal:
- NDMP Protocol (ndmp-src/)
- Transfer Protocol (xfer-src/)
- IPC Mechanisms

##### Additional Elements

Supporting features:

a. Management Tools:
- Configuration System
- Monitoring Tools
- Recovery Interface

b. Auxiliary Services:
- Catalog Service
- Report Generation
- Status Monitoring

Remember to emphasize:
- The distributed nature of the system
- The flexibility in storage options
- The security architecture
- The modular design allowing for different backup applications

This will create a comprehensive visualization of Amanda's architecture that captures both its complexity and its elegant design.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef server fill:#2374ab
    classDef client fill:#48a9a6
    classDef storage fill:#4b644a
    classDef security fill:#e9d985
    classDef database fill:#c49991
    classDef management fill:#d4afb9
    classDef monitoring fill:#809bce
    classDef transfer fill:#95b8d1

    %% Client Layer
    subgraph Clients
        C1[Client System 1]:::client
        C2[Client System 2]:::client
        C3[Client System N]:::client
        SendBackup[SendBackup Module]:::client
    end
    click C1 "https://github.com/zmanda/amanda/tree/master/client-src/"
    click SendBackup "https://github.com/zmanda/amanda/blob/master/client-src/sendbackup.c"

    %% Server Core
    subgraph "Amanda Server"
        AServer[Backup Controller]:::server
        Driver[Driver Module]:::server
        Taper[Taper Service]:::server
        ConfigMgr[Configuration Manager]:::management
        RestAPI[REST API Interface]:::server
    end
    click AServer "https://github.com/zmanda/amanda/tree/master/server-src/"
    click Driver "https://github.com/zmanda/amanda/blob/master/server-src/driver.c"
    click Taper "https://github.com/zmanda/amanda/blob/master/server-src/taper.pl"
    click ConfigMgr "https://github.com/zmanda/amanda/blob/master/common-src/conffile.c"
    click RestAPI "https://github.com/zmanda/amanda/blob/master/rest-server/lib/Amanda/Rest.pm.in"

    %% Security Layer
    subgraph Security
        Auth[Authentication System]:::security
        SSH[SSH Security]:::security
        SSL[SSL Security]:::security
        Kerberos[Kerberos]:::security
    end
    click Auth "https://github.com/zmanda/amanda/blob/master/common-src/security.c"
    click SSH "https://github.com/zmanda/amanda/blob/master/common-src/ssh-security.c"
    click SSL "https://github.com/zmanda/amanda/blob/master/common-src/ssl-security.c"
    click Kerberos "https://github.com/zmanda/amanda/blob/master/common-src/krb5-security.c"

    %% Transfer System
    subgraph "Transfer Layer"
        XferSystem[Transfer System]:::transfer
        NDMP[NDMP Protocol]:::transfer
    end
    click XferSystem "https://github.com/zmanda/amanda/tree/master/xfer-src/"
    click NDMP "https://github.com/zmanda/amanda/tree/master/ndmp-src/"

    %% Storage Layer
    subgraph Storage
        HoldingDisk[Holding Disk]:::storage
        TapeDevice[Tape Device]:::storage
        S3Storage[S3 Storage]:::storage
        RAIT[RAIT System]:::storage
    end
    click TapeDevice "https://github.com/zmanda/amanda/blob/master/device-src/tape-device.c"
    click S3Storage "https://github.com/zmanda/amanda/blob/master/device-src/s3-device.c"
    click RAIT "https://github.com/zmanda/amanda/blob/master/device-src/rait-device.c"

    %% Database Layer
    subgraph "Database & Catalog"
        Catalog[Catalog System]:::database
        MySQL[MySQL Backend]:::database
        PostgreSQL[PostgreSQL Backend]:::database
    end
    click Catalog "https://github.com/zmanda/amanda/blob/master/perl/Amanda/DB/Catalog.pm"
    click MySQL "https://github.com/zmanda/amanda/blob/master/perl/Amanda/DB/Catalog2/MySQL.pm"
    click PostgreSQL "https://github.com/zmanda/amanda/blob/master/perl/Amanda/DB/Catalog2/PgSQL.pm"

    %% Monitoring & Recovery
    subgraph "Management Tools"
        Monitor[Monitoring System]:::monitoring
        Recovery[Recovery System]:::management
        Reports[Report Generator]:::monitoring
    end
    click Monitor "https://github.com/zmanda/amanda/blob/master/server-src/amstatus.pl"
    click Recovery "https://github.com/zmanda/amanda/blob/master/recover-src/amrecover.c"
    click Reports "https://github.com/zmanda/amanda/blob/master/server-src/amreport.pl"

    %% Relationships
    C1 & C2 & C3 --> SendBackup
    SendBackup --> XferSystem
    XferSystem --> AServer
    AServer --> Driver
    Driver --> Taper
    Auth --> AServer
    SSH & SSL & Kerberos --> Auth
    AServer --> ConfigMgr
    AServer --> RestAPI
    Taper --> HoldingDisk
    Taper --> TapeDevice
    Taper --> S3Storage
    Taper --> RAIT
    AServer --> Catalog
    Catalog --> MySQL & PostgreSQL
    AServer --> Monitor
    AServer --> Recovery
    Monitor --> Reports
    NDMP --> XferSystem

    %% Legend
    subgraph Legend
        L1[Server Components]:::server
        L2[Client Components]:::client
        L3[Storage Components]:::storage
        L4[Security Components]:::security
        L5[Database Components]:::database
        L6[Management Components]:::management
        L7[Monitoring Components]:::monitoring
        L8[Transfer Components]:::transfer
    end
```
