# dolphindb/tutorials_cn architecture

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

## Overview

##### Main System Components

a) Core Database Layer
- Time-series storage engine (TSDB)
- Distributed storage system
- Partition management
- Memory management
- Cache engine
- Asynchronous replication system

b) Computing Layer
- SQL execution engine
- Stream computing engine
- JIT compiler
- Distributed computing framework
- Job scheduler
- Memory manager

c) Interface Layer
- API connectors (Python, Java, C++, R, etc.)
- Plugin system
- Protocol handlers
- Web interfaces

d) Management Layer
- Cluster management
- Security and permissions
- Resource tracking
- Monitoring system
- High availability components

##### Relationships and Data Flow

Following interactions:

a) External Connections:
- Client applications → API layer → Computing layer → Storage layer
- Streaming data sources → Stream computing engine → Storage/Memory
- Plugin connections → Plugin system → Computing/Storage layers

b) Internal Flow:
- Query processing path
- Data distribution across nodes
- Replication flows
- Cache interactions

##### Specific Architectural Elements

Specialized components:
- High availability cluster configuration
- Stream aggregation engines
- Real-time computing modules
- Time-series optimization features
- Distributed query execution paths

##### Storage/Database Layer (bottom)

- Blue: Core database components
- Green: Computing/Processing components
- Orange: Interface/API components
- Purple: Management/Monitoring components
- Red: Critical paths/High availability components

##### Additional Details

Annotations for:
- Scalability points
- High availability mechanisms
- Security boundaries
- Performance optimization paths
- Plugin integration points

##### Technical Specifications

Technical features:
- Distributed architecture capabilities
- Time-series optimization
- Stream processing features
- Real-time analytics support
- Cross-platform compatibility

- High-performance time-series processing
- Real-time streaming capabilities
- Distributed computing
- Plugin extensibility
- Multi-language support

Remember to maintain a balance between detail and clarity, focusing on the architectural components that make DolphinDB unique in handling time-series data and real-time analytics.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style definitions
    classDef client fill:#e1f5fe,stroke:#01579b
    classDef interface fill:#fff3e0,stroke:#e65100
    classDef compute fill:#e8f5e9,stroke:#1b5e20
    classDef storage fill:#e3f2fd,stroke:#0d47a1
    classDef management fill:#f3e5f5,stroke:#4a148c
    classDef critical fill:#ffebee,stroke:#b71c1c

    %% Client Layer
    subgraph ClientLayer
        CA[Client Applications]
        DS[Data Sources]
        EX[External Systems]
    end

    %% Interface Layer
    subgraph InterfaceLayer
        API[API Connectors]:::interface
        PS[Plugin System]:::interface
        WI[Web Interface]:::interface
        PH[Protocol Handlers]:::interface
    end

    %% Computing Layer
    subgraph ComputeLayer
        SQL[SQL Engine]:::compute
        SCE[Stream Computing Engine]:::compute
        JIT[JIT Compiler]:::compute
        DCF[Distributed Computing Framework]:::compute
        JS[Job Scheduler]:::compute
        MM[Memory Manager]:::compute
    end

    %% Storage Layer
    subgraph StorageLayer
        TSDB[Time-series Storage Engine]:::storage
        DS[Distributed Storage]:::storage
        PM[Partition Management]:::storage
        CE[Cache Engine]:::storage
        AR[Async Replication]:::storage
    end

    %% Management Layer
    subgraph ManagementLayer
        CM[Cluster Management]:::management
        SP[Security & Permissions]:::management
        RT[Resource Tracking]:::management
        MS[Monitoring System]:::management
        HA[High Availability]:::critical
    end

    %% Relationships
    CA --> API
    DS --> SCE
    EX --> PS

    API --> SQL
    API --> SCE
    PS --> SQL
    PH --> SQL
    WI --> SQL

    SQL --> TSDB
    SCE --> TSDB
    DCF --> DS
    MM --> CE

    CM --> HA
    SP --> API
    MS --> RT
    HA --> AR

    %% Click events
    click API "https://github.com/dolphindb/Tutorials_CN/blob/master/api_protocol.md"
    click PS "https://github.com/dolphindb/Tutorials_CN/tree/master/plugin/"
    click WI "https://github.com/dolphindb/Tutorials_CN/blob/master/web_chart_integration.md"
    click SCE "https://github.com/dolphindb/Tutorials_CN/blob/master/streaming_tutorial.md"
    click JIT "https://github.com/dolphindb/Tutorials_CN/blob/master/jit.md"
    click MM "https://github.com/dolphindb/Tutorials_CN/blob/master/memory_management.md"
    click TSDB "https://github.com/dolphindb/Tutorials_CN/blob/master/tsdb_engine.md"
    click CM "https://github.com/dolphindb/Tutorials_CN/blob/master/cluster_monitor.md"
    click SP "https://github.com/dolphindb/Tutorials_CN/blob/master/ACL_and_Security.md"
    click MS "https://github.com/dolphindb/Tutorials_CN/blob/master/DolphinDB_monitor.md"
    click HA "https://github.com/dolphindb/Tutorials_CN/blob/master/ha_cluster_deployment.md"

    %% Legend
    classDef legend fill:#f5f5f5,stroke:#333
    subgraph Legend
        L1[Client Layer]:::client
        L2[Interface Components]:::interface
        L3[Compute Components]:::compute
        L4[Storage Components]:::storage
        L5[Management Components]:::management
        L6[Critical Components]:::critical
    end
```
