# man-group/arcticdb architecture

> Architecture diagram of the GitHub repository man-group/arcticdb, 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/man-group/arcticdb
- Repository: https://github.com/man-group/arcticdb

## Overview

##### Main Components (Top Level)

- Client Layer (Python Interface)
- Core Processing Layer (C++ Engine)
- Storage Layer (Multiple Backends)

##### Detailed Component Breakdown

a. Client Layer:
- Python API components (/python/arcticdb/)
- Version Store interface
- Adapters for different storage backends
- Query builder and processing interfaces

b. Core Processing Layer (cpp/arcticdb/):
- Column Store: Show the columnar data organization
- Codec: Illustrate compression and encoding components
- Pipeline: Display data processing flow
- Version Management: Show version control system
- Processing: Include query execution and optimization

c. Storage Layer:
- Supported backends:
- S3
- LMDB
- Azure Blob Storage
- In-Memory Storage

- Read path (Storage → Processing → Client)
- Write path (Client → Processing → Storage)
- Version control operations
- Async operations

##### Key Components to Highlight

a. Version Store:
- Version management
- Snapshot capabilities
- Time travel functionality

b. Data Processing:
- Column-based storage
- Compression engine
- Query optimization
- Parallel processing

c. Storage Abstraction:
- Storage adapters
- Multi-backend support
- Serialization/Deserialization

##### Supporting Elements

- Interfaces between components
- Async operations and parallel processing
- Configuration management

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef python fill:#4B8BBE,color:white
    classDef cpp fill:#00599C,color:white
    classDef storage fill:#FF8C00,color:white
    classDef processing fill:#9370DB,color:white
    classDef interface fill:#98FB98,color:black

    %% Client Layer
    subgraph ClientLayer
        PythonAPI["Python API"]:::python
        VersionStore["Version Store Interface"]:::python
        QueryBuilder["Query Builder"]:::python
        StorageAdapters["Storage Adapters"]:::python
    end

    %% Core Processing Layer
    subgraph CoreLayer
        ColumnStore["Column Store"]:::cpp
        Codec["Codec Engine"]:::cpp
        Pipeline["Processing Pipeline"]:::cpp
        VersionMgmt["Version Management"]:::cpp
        QueryProc["Query Processing"]:::cpp
        EntityDef["Entity Definitions"]:::cpp
        StreamHandler["Stream Handler"]:::cpp
    end

    %% Storage Layer
    subgraph StorageLayer
        StorageFactory["Storage Factory"]:::interface
        subgraph Backends
            S3["S3 Backend"]:::storage
            LMDB["LMDB Backend"]:::storage
            Azure["Azure Blob"]:::storage
            InMem["In-Memory"]:::storage
        end
    end

    %% Relationships
    PythonAPI --> VersionStore
    PythonAPI --> QueryBuilder
    PythonAPI --> StorageAdapters
    
    VersionStore --> VersionMgmt
    QueryBuilder --> QueryProc
    StorageAdapters --> StorageFactory
    
    QueryProc --> Pipeline
    Pipeline --> ColumnStore
    Pipeline --> Codec
    Pipeline --> StreamHandler
    
    ColumnStore --> EntityDef
    
    StorageFactory --> S3
    StorageFactory --> LMDB
    StorageFactory --> Azure
    StorageFactory --> InMem

    %% Click events for component mapping
    click PythonAPI "https://github.com/man-group/arcticdb/blob/master/python/arcticdb/arctic.py"
    click VersionStore "https://github.com/man-group/arcticdb/tree/master/python/arcticdb/version_store/"
    click StorageAdapters "https://github.com/man-group/arcticdb/tree/master/python/arcticdb/adapters/"
    click ColumnStore "https://github.com/man-group/arcticdb/tree/master/cpp/arcticdb/column_store/"
    click Codec "https://github.com/man-group/arcticdb/tree/master/cpp/arcticdb/codec/"
    click Pipeline "https://github.com/man-group/arcticdb/tree/master/cpp/arcticdb/pipeline/"
    click QueryProc "https://github.com/man-group/arcticdb/blob/master/cpp/arcticdb/processing/query_planner.hpp"
    click QueryBuilder "https://github.com/man-group/arcticdb/blob/master/python/arcticdb/version_store/processing.py"
    click VersionMgmt "https://github.com/man-group/arcticdb/tree/master/cpp/arcticdb/version/"
    click EntityDef "https://github.com/man-group/arcticdb/tree/master/cpp/arcticdb/entity/"
    click StreamHandler "https://github.com/man-group/arcticdb/tree/master/cpp/arcticdb/stream/"
    click StorageFactory "https://github.com/man-group/arcticdb/blob/master/cpp/arcticdb/storage/storage_factory.hpp"
    click S3 "https://github.com/man-group/arcticdb/tree/master/cpp/arcticdb/storage/s3/"
    click LMDB "https://github.com/man-group/arcticdb/tree/master/cpp/arcticdb/storage/lmdb/"
    click Azure "https://github.com/man-group/arcticdb/tree/master/cpp/arcticdb/storage/azure/"
    click InMem "https://github.com/man-group/arcticdb/tree/master/cpp/arcticdb/storage/memory/"

    %% Legend
    subgraph Legend
        Python["Python Components"]:::python
        CPP["C++ Components"]:::cpp
        Storage["Storage Components"]:::storage
        Process["Processing Components"]:::processing
        Inter["Interfaces"]:::interface
    end
```
