# snu-dbs/m2bench architecture

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

- Interactive diagram: https://gitdiagram.com/snu-dbs/m2bench
- Repository: https://github.com/snu-dbs/m2bench

## Overview

##### High-Level Components

a. Dataset Management Layer
- Data Generation Components
- Data Scaling Components
- Raw Dataset Storage
- Generated Dataset Storage

b. Implementation Layer
- Multiple DBMS Implementations
- Query Execution Components
- Data Loading Components

c. Task Execution Layer
- Benchmark Tasks
- Performance Measurement
- Results Collection

##### Component Relationships and Data Flow

**[Raw Datasets] → [Data Generator] → [Data Scaler] → [Generated Datasets]**
- ↓
**[Implementation Layer] ← [Data Loading Scripts] ← [Generated Datasets]**
- ↓
**[Task Execution] → [Performance Results]**

##### Specific Design Elements

- Hexagons for data processing components (Generator, Scaler)

b. Implementation Components:
- Separate containers for each DBMS (AgensGraph, ArangoDB, Polyglot)
- Connection points between different data models
- Data loading workflows
- Query execution paths

c. Task Execution:
- Task categories
- Multi-model interactions
- Performance measurement points

##### Technical Details

a. Data Model Support:
- Relational (MySQL/PostgreSQL)
- Document (MongoDB)
- Property Graph (Neo4j)
- Array (SciDB)

b. Integration Points:
- Data format conversions
- Cross-model query execution
- Performance monitoring hooks

##### Implementation-Specific Details

For each DBMS implementation, show:
- Data loading pipelines
- Query execution paths
- Model-specific optimizations
- Cross-model query handling

##### Additional Elements

Include:
- Version information for supported DBMSs
- Data flow direction indicators
- System requirements and dependencies
- Scale indicators for the benchmark

Remember to include a clear indication of the three main datasets (ecommerce, healthcare, disaster) and how they flow through the system, from raw data to benchmark execution.

This design will help developers understand both the high-level architecture and the detailed interactions between components in this multi-model benchmark system.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Dataset Management Layer"
        RawData["Raw Datasets"]:::rawdata
        DataGen["Data Generator"]:::processor
        DataScale["Data Scaler"]:::processor
        GenData["Generated Datasets"]:::gendata
        
        subgraph "Raw Datasets"
            Ecom1["Ecommerce Data"]:::dataset
            Health1["Healthcare Data"]:::dataset
            Disaster1["Disaster Data"]:::dataset
        end
        
        subgraph "Generated Datasets"
            Ecom2["Ecommerce"]:::dataset
            Health2["Healthcare"]:::dataset
            Disaster2["Disaster"]:::dataset
        end
    end
    
    subgraph "Implementation Layer"
        subgraph "Database Systems"
            Agens["AgensGraph"]:::dbms
            Arango["ArangoDB"]:::dbms
            Orient["OrientDB"]:::dbms
            Poly["Polyglot"]:::dbms
        end
        
        subgraph "Data Loading"
            LoadComp["Loading Components"]:::loader
            DBConn["Database Connectors"]:::connector
        end
    end
    
    subgraph "Task Execution Layer"
        Tasks["Benchmark Tasks"]:::task
        QueryExec["Query Execution"]:::executor
        PerfMeasure["Performance Measurement"]:::monitor
        Results["Results Collection"]:::results
    end
    
    RawData --> DataGen
    DataGen --> DataScale
    DataScale --> GenData
    
    Ecom1 & Health1 & Disaster1 --> DataGen
    DataScale --> Ecom2 & Health2 & Disaster2
    
    GenData --> LoadComp
    LoadComp --> DBConn
    DBConn --> Agens & Arango & Orient & Poly
    
    Agens & Arango & Orient & Poly --> QueryExec
    QueryExec --> PerfMeasure
    PerfMeasure --> Results
    Tasks --> QueryExec
    
    %% Click Events
    click DataGen "https://github.com/snu-dbs/m2bench/tree/publish/Datasets/Generator/"
    click DataScale "https://github.com/snu-dbs/m2bench/tree/publish/Datasets/DataScaler/"
    click RawData "https://github.com/snu-dbs/m2bench/tree/publish/Datasets/raw_datasets/"
    click GenData "https://github.com/snu-dbs/m2bench/tree/publish/Datasets/{ecommerce,healthcare,disaster}/"
    click Agens "https://github.com/snu-dbs/m2bench/tree/publish/Impl/agensgraph/"
    click Arango "https://github.com/snu-dbs/m2bench/tree/publish/Impl/arangodb/"
    click Orient "https://github.com/snu-dbs/m2bench/tree/publish/Impl/orientdb/"
    click Poly "https://github.com/snu-dbs/m2bench/tree/publish/Impl/polyglot/"
    click LoadComp "https://github.com/snu-dbs/m2bench/tree/publish/Impl/*/load_datasets/"
    click QueryExec "https://github.com/snu-dbs/m2bench/tree/publish/Impl/*/run_tasks/"
    click Tasks "https://github.com/snu-dbs/m2bench/blob/publish/Tasks/alltasks.md"
    click PerfMeasure "https://github.com/snu-dbs/m2bench/blob/publish/Impl/polyglot/run_tasks/include/Polyglot/Latency_Check.h"
    click DBConn "https://github.com/snu-dbs/m2bench/tree/publish/Impl/polyglot/run_tasks/include/Connection/"
    click QueryExec "https://github.com/snu-dbs/m2bench/tree/publish/Impl/polyglot/run_tasks/src/Polyglot/"
    
    %% Styling
    classDef processor fill:#f96,stroke:#333
    classDef rawdata fill:#fcc,stroke:#333
    classDef gendata fill:#cfc,stroke:#333
    classDef dataset fill:#ccf,stroke:#333
    classDef dbms fill:#c9f,stroke:#333
    classDef loader fill:#fc9,stroke:#333
    classDef connector fill:#9cf,stroke:#333
    classDef task fill:#f9c,stroke:#333
    classDef executor fill:#9fc,stroke:#333
    classDef monitor fill:#c9c,stroke:#333
    classDef results fill:#ccc,stroke:#333
```
