# anything0000/seekdb_anything architecture

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

- Interactive diagram: https://gitdiagram.com/anything0000/seekdb_anything
- Repository: https://github.com/anything0000/seekdb_anything

## Overview

seekdb is a MySQL-compatible database for embedded and server use, with ACID storage, hybrid search, asynchronous vector indexing, and copy-on-write sandboxes. The principal workflow is a client issuing SQL through the MySQL interface, which the SQL engine plans and executes against storage; search can combine vector, full-text, and scalar predicates. README-described embedding and sandbox capabilities are included, but their implementation links are not inferred where source excerpts do not establish them.

Main entry points: [`src/sql/code_generator/ob_static_engine_cg.cpp`](https://github.com/anything0000/seekdb_anything/blob/master/src/sql/code_generator/ob_static_engine_cg.cpp) (Plan Generation), [`src/storage`](https://github.com/anything0000/seekdb_anything/tree/master/src/storage) (Data and Transactions), [`src/storage/memtable/mvcc/ob_query_engine.cpp`](https://github.com/anything0000/seekdb_anything/blob/master/src/storage/memtable/mvcc/ob_query_engine.cpp) (MVCC Query Engine), [`src/observer/mysql`](https://github.com/anything0000/seekdb_anything/tree/master/src/observer/mysql) (MySQL Protocol)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Client Interfaces"]
  node_mysql["MySQL Protocol"]
  node_embedded["Embedded Runtime<br/>[engine.rs]"]
  node_nio["SQL Networking"]
end

subgraph group_sql["SQL and Search"]
  node_query["SQL Query Handling<br/>[obmp_query.cpp]"]
  node_planner["Plan Generation"]
  node_vector["Vector Search"]
  node_fulltext["Full-Text Search"]
end

subgraph group_storage["Storage and Transactions"]
  node_memtable["MVCC Query Engine"]
  node_data[("Data and Transactions")]
  node_redo["Redo Log<br/>[log_engine.cpp]"]
  node_tabletmeta[("Tablet Metadata")]
  node_common["Shared Runtime Utilities"]
end

subgraph group_extensions["Agent Capabilities"]
  node_embedding["Embedding Tasks"]
  node_changes["Change Stream"]
  node_delta[("Delta HNSW")]
  node_snapshot[("Snapshot Index")]
  node_sandbox[("COW Sandboxes")]
end

node_client(("SQL Client"))

node_client -->|"sends SQL"| node_mysql
node_client -->|"opens database"| node_embedded
node_embedded -.->|"exposes SQL connection"| node_nio
node_mysql -.->|"routes queries"| node_query
node_query -.->|"plans SQL"| node_planner
node_planner -->|"plans hybrid search"| node_vector
node_planner -->|"plans hybrid search"| node_fulltext
node_planner -.->|"executes queries"| node_memtable
node_memtable -.->|"reads rows"| node_data
node_data -->|"commits redo"| node_redo
node_data -.->|"stores metadata"| node_tabletmeta
node_client -.->|"requests embeddings"| node_embedding
node_data -->|"feeds redo"| node_changes
node_changes -->|"updates asynchronously"| node_delta
node_delta -->|"queries alongside"| node_snapshot
node_client -->|"forks database"| node_sandbox
node_common -.->|"provides utilities"| node_memtable

click node_mysql "https://github.com/anything0000/seekdb_anything/tree/master/src/observer/mysql"
click node_embedded "https://github.com/anything0000/seekdb_anything/blob/master/rust/in-process/src/engine.rs"
click node_nio "https://github.com/anything0000/seekdb_anything/tree/master/rust/sql-nio/src"
click node_query "https://github.com/anything0000/seekdb_anything/blob/master/src/observer/mysql/obmp_query.cpp"
click node_planner "https://github.com/anything0000/seekdb_anything/blob/master/src/sql/code_generator/ob_static_engine_cg.cpp"
click node_vector "https://github.com/anything0000/seekdb_anything/blob/master/src/query/vector/ob_vector_embedding_handler.cpp"
click node_fulltext "https://github.com/anything0000/seekdb_anything/tree/master/src/data_plane/api/data_plane/fts"
click node_memtable "https://github.com/anything0000/seekdb_anything/blob/master/src/storage/memtable/mvcc/ob_query_engine.cpp"
click node_data "https://github.com/anything0000/seekdb_anything/tree/master/src/storage"
click node_redo "https://github.com/anything0000/seekdb_anything/blob/master/src/logservice/palf/log_engine.cpp"
click node_tabletmeta "https://github.com/anything0000/seekdb_anything/blob/master/src/share/tablet/ob_tablet_meta_table_storage.cpp"
click node_embedding "https://github.com/anything0000/seekdb_anything/blob/master/src/query/vector/ob_vector_embedding_handler.cpp"
click node_changes "https://github.com/anything0000/seekdb_anything/tree/master/src/observer/change_stream"
click node_delta "https://github.com/anything0000/seekdb_anything/tree/master/src/observer/vector_index"
click node_snapshot "https://github.com/anything0000/seekdb_anything/tree/master/src/observer/vector_index"
click node_sandbox "https://github.com/anything0000/seekdb_anything/tree/master/src/storage"
click node_common "https://github.com/anything0000/seekdb_anything/tree/master/src/oblib"

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_mysql,node_embedded,node_nio,node_client toneBlue
class node_query,node_planner,node_vector,node_fulltext toneAmber
class node_memtable,node_data,node_redo,node_tabletmeta,node_common toneMint
class node_embedding,node_changes,node_delta,node_snapshot,node_sandbox toneRose
```

## Components

### Client Interfaces

- [MySQL Protocol](https://github.com/anything0000/seekdb_anything/tree/master/src/observer/mysql): `src/observer/mysql`
- [Embedded Runtime](https://github.com/anything0000/seekdb_anything/blob/master/rust/in-process/src/engine.rs): `rust/in-process/src/engine.rs`
- [SQL Networking](https://github.com/anything0000/seekdb_anything/tree/master/rust/sql-nio/src): `rust/sql-nio/src`

### SQL and Search

- [SQL Query Handling](https://github.com/anything0000/seekdb_anything/blob/master/src/observer/mysql/obmp_query.cpp): `src/observer/mysql/obmp_query.cpp`
- [Plan Generation](https://github.com/anything0000/seekdb_anything/blob/master/src/sql/code_generator/ob_static_engine_cg.cpp): `src/sql/code_generator/ob_static_engine_cg.cpp`
- [Vector Search](https://github.com/anything0000/seekdb_anything/blob/master/src/query/vector/ob_vector_embedding_handler.cpp): `src/query/vector/ob_vector_embedding_handler.cpp`
- [Full-Text Search](https://github.com/anything0000/seekdb_anything/tree/master/src/data_plane/api/data_plane/fts): `src/data_plane/api/data_plane/fts`

### Storage and Transactions

- [MVCC Query Engine](https://github.com/anything0000/seekdb_anything/blob/master/src/storage/memtable/mvcc/ob_query_engine.cpp): `src/storage/memtable/mvcc/ob_query_engine.cpp`
- [Data and Transactions](https://github.com/anything0000/seekdb_anything/tree/master/src/storage): `src/storage`
- [Redo Log](https://github.com/anything0000/seekdb_anything/blob/master/src/logservice/palf/log_engine.cpp): `src/logservice/palf/log_engine.cpp`
- [Tablet Metadata](https://github.com/anything0000/seekdb_anything/blob/master/src/share/tablet/ob_tablet_meta_table_storage.cpp): `src/share/tablet/ob_tablet_meta_table_storage.cpp`
- [Shared Runtime Utilities](https://github.com/anything0000/seekdb_anything/tree/master/src/oblib): `src/oblib`

### Agent Capabilities

- [Embedding Tasks](https://github.com/anything0000/seekdb_anything/blob/master/src/query/vector/ob_vector_embedding_handler.cpp): `src/query/vector/ob_vector_embedding_handler.cpp`
- [Change Stream](https://github.com/anything0000/seekdb_anything/tree/master/src/observer/change_stream): `src/observer/change_stream`
- [Delta HNSW](https://github.com/anything0000/seekdb_anything/tree/master/src/observer/vector_index): `src/observer/vector_index`
- [Snapshot Index](https://github.com/anything0000/seekdb_anything/tree/master/src/observer/vector_index): `src/observer/vector_index`
- [COW Sandboxes](https://github.com/anything0000/seekdb_anything/tree/master/src/storage): `src/storage`

### Other components

- **SQL Client**

## Connections

- SQL Client → MySQL Protocol: sends SQL
- SQL Client → Embedded Runtime: opens database
- Embedded Runtime → SQL Networking: exposes SQL connection
- MySQL Protocol → SQL Query Handling: routes queries
- SQL Query Handling → Plan Generation: plans SQL
- Plan Generation → Vector Search: plans hybrid search
- Plan Generation → Full-Text Search: plans hybrid search
- Plan Generation → MVCC Query Engine: executes queries
- MVCC Query Engine → Data and Transactions: reads rows (evidence: `src/storage/memtable/mvcc/ob_query_engine.cpp`)
- Data and Transactions → Redo Log: commits redo
- Data and Transactions → Tablet Metadata: stores metadata
- SQL Client → Embedding Tasks: requests embeddings
- Data and Transactions → Change Stream: feeds redo
- Change Stream → Delta HNSW: updates asynchronously
- Delta HNSW → Snapshot Index: queries alongside
- SQL Client → COW Sandboxes: forks database
- Shared Runtime Utilities → MVCC Query Engine: provides utilities (evidence: `src/storage/memtable/mvcc/ob_query_engine.cpp`)
