# azure/azure-storage-fuse architecture

> Architecture diagram of the GitHub repository azure/azure-storage-fuse, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/azure/azure-storage-fuse
- Repository: https://github.com/azure/azure-storage-fuse

## Overview

##### High-Level Components (Main Layer)
- User Space (Application Layer) - Green
- Blobfuse2 Components - Blue
- Azure Storage Layer - Purple

- Application → FUSE → Blobfuse2 Pipeline → Cache Layer → Azure Storage
- Health Monitor → Components
- Configuration → Components

##### Performance Features (annotate relevant components)
- Parallel Download/Upload
- Cache Management
- Prefetch Mechanisms
- Write-back Caching

Key Design Principles to Emphasize:
##### Security features (config encryption, authentication)

This design should help developers understand both the high-level architecture and the detailed component interactions while highlighting the system's key features and constraints.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph User["User Space (Application Layer)"]
        App[Application]
    end

    subgraph Blobfuse["Blobfuse2 Core"]
        subgraph FuseLayer["FUSE Interface Layer"]
            LibFuse["LibFuse"]:::core
            ExtHandler["Extension Handler"]:::core
            FuseKernel["FUSE Kernel Module"]:::core
        end

        subgraph Pipeline["Pipeline System"]
            PipelineMgr["Pipeline Manager"]:::core
            BaseComp["Base Component"]:::core
            HandleMap["Handle Map Manager"]:::core
        end

        subgraph Storage["Storage Components"]
            AzStorage["Azure Storage Client"]:::storage
            AuthHandlers["Authentication Handlers"]:::storage
            BlobSupport["Block Blob & Data Lake"]:::storage
        end

        subgraph Cache["Caching System"]
            FileCache["File Cache"]:::cache
            BlockCache["Block Cache"]:::cache
            AttrCache["Attribute Cache"]:::cache
            EntryCache["Entry Cache"]:::cache
        end

        subgraph Health["Health Monitoring"]
            CPUMem["CPU/Memory Profiler"]:::monitor
            NetMon["Network Monitor"]:::monitor
            StatsColl["Statistics Collection"]:::monitor
            CacheMon["Cache Monitor"]:::monitor
        end

        subgraph Config["Configuration"]
            ConfigParser["Config Parser"]:::config
            SecModule["Security Module"]:::config
            CLI["CLI Interface"]:::config
            EnvHandler["Environment Variables"]:::config
        end
    end

    subgraph Azure["Azure Storage Layer"]
        AzureAPI["Azure Storage REST APIs"]
    end

    %% Main data flow
    App --> LibFuse
    LibFuse --> PipelineMgr
    PipelineMgr --> Cache
    Cache --> AzStorage
    AzStorage --> AzureAPI

    %% Component connections
    LibFuse --- ExtHandler
    LibFuse --- FuseKernel
    PipelineMgr --- BaseComp
    PipelineMgr --- HandleMap
    AzStorage --- AuthHandlers
    AzStorage --- BlobSupport

    %% Monitoring connections
    CPUMem -.-> PipelineMgr
    NetMon -.-> AzStorage
    StatsColl -.-> Cache
    CacheMon -.-> Cache

    %% Config connections
    ConfigParser --> PipelineMgr
    SecModule --> AuthHandlers
    CLI --> ConfigParser
    EnvHandler --> ConfigParser

    %% Styling
    classDef core fill:#a2d2ff
    classDef storage fill:#bdb2ff
    classDef cache fill:#caffbf
    classDef monitor fill:#ffd6a5
    classDef config fill:#ffadad

    %% Click events
    click LibFuse "https://github.com/Azure/azure-storage-fuse/blob/main/component/libfuse/libfuse.go"
    click ExtHandler "https://github.com/Azure/azure-storage-fuse/blob/main/component/libfuse/extension_handler.h"
    click PipelineMgr "https://github.com/Azure/azure-storage-fuse/blob/main/internal/pipeline.go"
    click BaseComp "https://github.com/Azure/azure-storage-fuse/blob/main/internal/base_component.go"
    click HandleMap "https://github.com/Azure/azure-storage-fuse/blob/main/internal/handlemap/handle_map.go"
    click AzStorage "https://github.com/Azure/azure-storage-fuse/blob/main/component/azstorage/azstorage.go"
    click AuthHandlers "https://github.com/Azure/azure-storage-fuse/blob/main/component/azstorage/azauth.go"
    click BlobSupport "https://github.com/Azure/azure-storage-fuse/blob/main/component/azstorage/block_blob.go"
    click FileCache "https://github.com/Azure/azure-storage-fuse/blob/main/component/file_cache/file_cache.go"
    click BlockCache "https://github.com/Azure/azure-storage-fuse/blob/main/component/block_cache/block_cache.go"
    click AttrCache "https://github.com/Azure/azure-storage-fuse/blob/main/component/attr_cache/attr_cache.go"
    click EntryCache "https://github.com/Azure/azure-storage-fuse/blob/main/component/entry_cache/entry_cache.go"
    click CPUMem "https://github.com/Azure/azure-storage-fuse/blob/main/tools/health-monitor/monitor/cpu_mem_profiler/cpu_mem_monitor.go"
    click NetMon "https://github.com/Azure/azure-storage-fuse/blob/main/tools/health-monitor/monitor/network_profiler/network_monitor.go"
    click CacheMon "https://github.com/Azure/azure-storage-fuse/blob/main/tools/health-monitor/monitor/file_cache/cache_monitor.go"
    click StatsColl "https://github.com/Azure/azure-storage-fuse/blob/main/tools/health-monitor/monitor/blobfuse_stats/stats_reader.go"
    click ConfigParser "https://github.com/Azure/azure-storage-fuse/blob/main/common/config/config_parser.go"
    click SecModule "https://github.com/Azure/azure-storage-fuse/blob/main/cmd/secure.go"
    click CLI "https://github.com/Azure/azure-storage-fuse/blob/main/cmd/secure_get.go"
    click EnvHandler "https://github.com/Azure/azure-storage-fuse/blob/main/cmd/secure_set.go"
```
