# mohamed8483/server architecture

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

- Interactive diagram: https://gitdiagram.com/mohamed8483/server
- Repository: https://github.com/mohamed8483/server

## Overview

MariaDB Server is a MySQL-compatible relational database with pluggable engines, replication and clustering, advanced SQL, security, and observability. The principal workflow is a client submitting SQL to the server, which processes it and accesses data through a storage engine. The tree and excerpts support several component boundaries, but do not show the complete SQL execution path; dashed, uncited links mark that evidence limit. README-described capabilities are included even where their implementation was not sampled.

Main entry points: [`sql/mysqld.h`](https://github.com/mohamed8483/server/blob/main/sql/mysqld.h) (Server runtime), [`sql/handler.h`](https://github.com/mohamed8483/server/blob/main/sql/handler.h) (Storage engine API), [`sql/sql_class.h`](https://github.com/mohamed8483/server/blob/main/sql/sql_class.h) (Session context), [`sql`](https://github.com/mohamed8483/server/tree/main/sql) (Advanced SQL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Server core"]
  node_protocol["Client protocol<br/>[mysql_com.h]"]
  node_server_runtime["Server runtime<br/>[mysqld.h]"]
  node_session["Session context<br/>[sql_class.h]"]
  node_table_metadata["Table metadata<br/>[table.h]"]
  node_field_types["SQL fields<br/>[field.h]"]
end

subgraph group_data["Data engines"]
  node_engine_api["Storage engine API<br/>[handler.h]"]
  node_innodb[("InnoDB")]
  node_aria[("Aria")]
  node_rocksdb[("MyRocks")]
  node_spider[("Spider sharding")]
  node_columnstore[("ColumnStore analytics")]
  node_duckdb["DuckDB integration"]
end

subgraph group_ops["Replication and operations"]
  node_replication["Replication"]
  node_galera["Galera clustering"]
  node_backup["Backup and restore"]
end

subgraph group_features["SQL and extensions"]
  node_sql_features["Advanced SQL"]
  node_vector["Vector search"]
  node_spatial_fulltext["Spatial and full-text"]
end

subgraph group_security["Security and observability"]
  node_auth["Authentication<br/>[server_ed25519.c]"]
  node_encryption["Data encryption"]
  node_performance_schema["Performance Schema"]
end

node_client(("SQL client"))
node_result(("Query results"))

node_client -.->|"sends SQL"| node_protocol
node_protocol -.->|"dispatches requests"| node_server_runtime
node_server_runtime -.->|"handles sessions"| node_session
node_session -.->|"accesses tables"| node_table_metadata
node_table_metadata -.->|"describes columns"| node_field_types
node_session -.->|"accesses data"| node_engine_api
node_engine_api -.->|"delegates storage"| node_innodb
node_engine_api -.->|"delegates storage"| node_aria
node_engine_api -.->|"delegates storage"| node_rocksdb
node_engine_api -.->|"delegates storage"| node_spider
node_engine_api -.->|"delegates storage"| node_columnstore
node_engine_api -.->|"delegates scans"| node_duckdb
node_server_runtime -.->|"supports SQL"| node_sql_features
node_sql_features -.->|"includes search"| node_vector
node_sql_features -.->|"includes search"| node_spatial_fulltext
node_server_runtime -.->|"supports replication"| node_replication
node_server_runtime -.->|"integrates clustering"| node_galera
node_backup -.->|"backs up data"| node_innodb
node_server_runtime -.->|"authenticates clients"| node_auth
node_server_runtime -.->|"supports encryption"| node_encryption
node_server_runtime -.->|"exposes metrics"| node_performance_schema
node_server_runtime -.->|"returns results"| node_result

click node_protocol "https://github.com/mohamed8483/server/blob/main/include/mysql_com.h"
click node_server_runtime "https://github.com/mohamed8483/server/blob/main/sql/mysqld.h"
click node_session "https://github.com/mohamed8483/server/blob/main/sql/sql_class.h"
click node_table_metadata "https://github.com/mohamed8483/server/blob/main/sql/table.h"
click node_field_types "https://github.com/mohamed8483/server/blob/main/sql/field.h"
click node_engine_api "https://github.com/mohamed8483/server/blob/main/sql/handler.h"
click node_innodb "https://github.com/mohamed8483/server/tree/main/storage/innobase"
click node_aria "https://github.com/mohamed8483/server/tree/main/storage/maria"
click node_rocksdb "https://github.com/mohamed8483/server/tree/main/storage/rocksdb"
click node_spider "https://github.com/mohamed8483/server/tree/main/storage/spider"
click node_columnstore "https://github.com/mohamed8483/server/tree/main/storage/columnstore"
click node_duckdb "https://github.com/mohamed8483/server/blob/main/storage/duckdb/runtime/cross_engine_scan.cc"
click node_sql_features "https://github.com/mohamed8483/server/tree/main/sql"
click node_vector "https://github.com/mohamed8483/server/tree/main/sql"
click node_spatial_fulltext "https://github.com/mohamed8483/server/tree/main/plugin/fulltext"
click node_replication "https://github.com/mohamed8483/server/tree/main/sql"
click node_galera "https://github.com/mohamed8483/server/blob/main/sql/wsrep_storage_service.cc"
click node_backup "https://github.com/mohamed8483/server/tree/main/extra/mariabackup"
click node_auth "https://github.com/mohamed8483/server/blob/main/plugin/auth_ed25519/server_ed25519.c"
click node_encryption "https://github.com/mohamed8483/server/blob/main/plugin/file_key_management/file_key_management_plugin.cc"
click node_performance_schema "https://github.com/mohamed8483/server/blob/main/storage/perfschema/pfs_engine_table.cc"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_protocol,node_server_runtime,node_session,node_table_metadata,node_field_types,node_client toneBlue
class node_engine_api,node_innodb,node_aria,node_rocksdb,node_spider,node_columnstore,node_duckdb toneAmber
class node_replication,node_galera,node_backup toneMint
class node_sql_features,node_vector,node_spatial_fulltext toneRose
class node_auth,node_encryption,node_performance_schema,node_result toneIndigo
```

## Components

### Server core

- [Client protocol](https://github.com/mohamed8483/server/blob/main/include/mysql_com.h): `include/mysql_com.h`
- [Server runtime](https://github.com/mohamed8483/server/blob/main/sql/mysqld.h): `sql/mysqld.h`
- [Session context](https://github.com/mohamed8483/server/blob/main/sql/sql_class.h): `sql/sql_class.h`
- [Table metadata](https://github.com/mohamed8483/server/blob/main/sql/table.h): `sql/table.h`
- [SQL fields](https://github.com/mohamed8483/server/blob/main/sql/field.h): `sql/field.h`

### Data engines

- [Storage engine API](https://github.com/mohamed8483/server/blob/main/sql/handler.h): `sql/handler.h`
- [InnoDB](https://github.com/mohamed8483/server/tree/main/storage/innobase): `storage/innobase`
- [Aria](https://github.com/mohamed8483/server/tree/main/storage/maria): `storage/maria`
- [MyRocks](https://github.com/mohamed8483/server/tree/main/storage/rocksdb): `storage/rocksdb`
- [Spider sharding](https://github.com/mohamed8483/server/tree/main/storage/spider): `storage/spider`
- [ColumnStore analytics](https://github.com/mohamed8483/server/tree/main/storage/columnstore): `storage/columnstore`
- [DuckDB integration](https://github.com/mohamed8483/server/blob/main/storage/duckdb/runtime/cross_engine_scan.cc): `storage/duckdb/runtime/cross_engine_scan.cc`

### Replication and operations

- [Replication](https://github.com/mohamed8483/server/tree/main/sql): `sql`
- [Galera clustering](https://github.com/mohamed8483/server/blob/main/sql/wsrep_storage_service.cc): `sql/wsrep_storage_service.cc`
- [Backup and restore](https://github.com/mohamed8483/server/tree/main/extra/mariabackup): `extra/mariabackup`

### SQL and extensions

- [Advanced SQL](https://github.com/mohamed8483/server/tree/main/sql): `sql`
- [Vector search](https://github.com/mohamed8483/server/tree/main/sql): `sql`
- [Spatial and full-text](https://github.com/mohamed8483/server/tree/main/plugin/fulltext): `plugin/fulltext`

### Security and observability

- [Authentication](https://github.com/mohamed8483/server/blob/main/plugin/auth_ed25519/server_ed25519.c): `plugin/auth_ed25519/server_ed25519.c`
- [Data encryption](https://github.com/mohamed8483/server/blob/main/plugin/file_key_management/file_key_management_plugin.cc): `plugin/file_key_management/file_key_management_plugin.cc`
- [Performance Schema](https://github.com/mohamed8483/server/blob/main/storage/perfschema/pfs_engine_table.cc): `storage/perfschema/pfs_engine_table.cc`

### Other components

- **SQL client**
- **Query results**

## Connections

- SQL client → Client protocol: sends SQL
- Client protocol → Server runtime: dispatches requests (evidence: `sql/mysqld.h`)
- Server runtime → Session context: handles sessions
- Session context → Table metadata: accesses tables
- Table metadata → SQL fields: describes columns (evidence: `sql/field.h`)
- Session context → Storage engine API: accesses data
- Storage engine API → InnoDB: delegates storage
- Storage engine API → Aria: delegates storage
- Storage engine API → MyRocks: delegates storage
- Storage engine API → Spider sharding: delegates storage
- Storage engine API → ColumnStore analytics: delegates storage
- Storage engine API → DuckDB integration: delegates scans (evidence: `storage/duckdb/runtime/cross_engine_scan.cc`)
- Server runtime → Advanced SQL: supports SQL (evidence: `sql/mysqld.h`)
- Advanced SQL → Vector search: includes search
- Advanced SQL → Spatial and full-text: includes search
- Server runtime → Replication: supports replication (evidence: `sql/mysqld.h`)
- Server runtime → Galera clustering: integrates clustering (evidence: `sql/wsrep_storage_service.cc`)
- Backup and restore → InnoDB: backs up data (evidence: `extra/mariabackup/common_engine.cc`)
- Server runtime → Authentication: authenticates clients
- Server runtime → Data encryption: supports encryption
- Server runtime → Performance Schema: exposes metrics
- Server runtime → Query results: returns results
