# oceanbase/seekdb architecture

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

- Interactive diagram: https://gitdiagram.com/oceanbase/seekdb
- Repository: https://github.com/oceanbase/seekdb

## Overview

seekdb is a MySQL-compatible database for embedded and server use, with transactional SQL, hybrid vector/full-text/scalar search, and agent-oriented sandboxing. The main workflow is a client request through the MySQL interface and SQL execution into transactional storage, with log persistence; queries can combine vector and full-text retrieval. README-described asynchronous indexing and copy-on-write fork/merge are included as product capabilities, but their implementation files are not present in the supplied tree, so their placement and connections are documented rather than source-verified. The sampled source confirms SQL plan generation, memtable lookup, log I/O submission, and tablet metadata persistence.

Main entry points: [`src/sql/code_generator/ob_static_engine_cg.cpp`](https://github.com/oceanbase/seekdb/blob/master/src/sql/code_generator/ob_static_engine_cg.cpp) (SQL Engine), [`src/observer/mysql/obmp_query.cpp`](https://github.com/oceanbase/seekdb/blob/master/src/observer/mysql/obmp_query.cpp) (MySQL Protocol), [`src/observer`](https://github.com/oceanbase/seekdb/tree/master/src/observer) (Async Index Pipeline), [`src/storage/ddl/ob_ddl_pipeline.cpp`](https://github.com/oceanbase/seekdb/blob/master/src/storage/ddl/ob_ddl_pipeline.cpp) (DDL Pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Interfaces"]
  node_mysql["MySQL Protocol<br/>[obmp_query.cpp]"]
  node_observer["Database Runtime<br/>[main.cpp]"]
end

subgraph group_sqlsearch["SQL and Search"]
  node_engine["SQL Engine"]
  node_vector["Vector Embeddings"]
  node_vectorapi["Vector Runtime API"]
  node_fulltext["Full-Text Search"]
  node_retrieval["Sparse Retrieval"]
end

subgraph group_storage["Transactional Storage"]
  node_memtable["Memtable Query"]
  node_tabletmeta[("Tablet Metadata")]
  node_ddl["DDL Pipeline"]
  node_logservice["Log Service<br/>[log_engine.cpp]"]
  node_logstore[("Log Storage<br/>[ob_i_log_storage.h]")]
end

subgraph group_operations["Agent and Operations"]
  node_change["Async Index Pipeline"]
  node_sandbox["COW Sandboxes"]
end

node_client(("SQL Client"))

node_client -->|"sends SQL"| node_mysql
node_mysql -.->|"executes query"| node_engine
node_engine -.->|"accesses rows"| node_memtable
node_engine -.->|"requests embeddings"| node_vector
node_engine -->|"runs vector search"| node_vectorapi
node_engine -->|"runs text search"| node_fulltext
node_engine -.->|"retrieves matches"| node_retrieval
node_change -->|"consumes redo"| node_logservice
node_change -->|"updates delta index"| node_vectorapi
node_engine -.->|"executes DDL"| node_ddl
node_ddl -.->|"persists metadata"| node_tabletmeta
node_logservice -.->|"writes log"| node_logstore
node_engine -->|"forks or merges"| node_sandbox
node_observer -.->|"serves protocol"| node_mysql

click node_mysql "https://github.com/oceanbase/seekdb/blob/master/src/observer/mysql/obmp_query.cpp"
click node_engine "https://github.com/oceanbase/seekdb/blob/master/src/sql/code_generator/ob_static_engine_cg.cpp"
click node_vector "https://github.com/oceanbase/seekdb/blob/master/src/query/vector/ob_vector_embedding_handler.cpp"
click node_vectorapi "https://github.com/oceanbase/seekdb/tree/master/src/data_plane/api/data_plane/vector"
click node_fulltext "https://github.com/oceanbase/seekdb/tree/master/src/data_plane/api/data_plane/fts"
click node_retrieval "https://github.com/oceanbase/seekdb/tree/master/src/data_plane/api/data_plane/retrieval"
click node_change "https://github.com/oceanbase/seekdb/tree/master/src/observer"
click node_sandbox "https://github.com/oceanbase/seekdb/tree/master/src/storage"
click node_memtable "https://github.com/oceanbase/seekdb/blob/master/src/storage/memtable/mvcc/ob_query_engine.cpp"
click node_tabletmeta "https://github.com/oceanbase/seekdb/blob/master/src/share/tablet/ob_tablet_meta_table_storage.cpp"
click node_ddl "https://github.com/oceanbase/seekdb/blob/master/src/storage/ddl/ob_ddl_pipeline.cpp"
click node_logservice "https://github.com/oceanbase/seekdb/blob/master/src/logservice/palf/log_engine.cpp"
click node_logstore "https://github.com/oceanbase/seekdb/blob/master/src/logservice/ob_i_log_storage.h"
click node_observer "https://github.com/oceanbase/seekdb/blob/master/src/observer/main.cpp"

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_observer,node_client toneBlue
class node_engine,node_vector,node_vectorapi,node_fulltext,node_retrieval toneAmber
class node_memtable,node_tabletmeta,node_ddl,node_logservice,node_logstore toneMint
class node_change,node_sandbox toneRose
```

## Components

### Interfaces

- [MySQL Protocol](https://github.com/oceanbase/seekdb/blob/master/src/observer/mysql/obmp_query.cpp): `src/observer/mysql/obmp_query.cpp`
- [Database Runtime](https://github.com/oceanbase/seekdb/blob/master/src/observer/main.cpp): `src/observer/main.cpp`

### SQL and Search

- [SQL Engine](https://github.com/oceanbase/seekdb/blob/master/src/sql/code_generator/ob_static_engine_cg.cpp): `src/sql/code_generator/ob_static_engine_cg.cpp`
- [Vector Embeddings](https://github.com/oceanbase/seekdb/blob/master/src/query/vector/ob_vector_embedding_handler.cpp): `src/query/vector/ob_vector_embedding_handler.cpp`
- [Vector Runtime API](https://github.com/oceanbase/seekdb/tree/master/src/data_plane/api/data_plane/vector): `src/data_plane/api/data_plane/vector`
- [Full-Text Search](https://github.com/oceanbase/seekdb/tree/master/src/data_plane/api/data_plane/fts): `src/data_plane/api/data_plane/fts`
- [Sparse Retrieval](https://github.com/oceanbase/seekdb/tree/master/src/data_plane/api/data_plane/retrieval): `src/data_plane/api/data_plane/retrieval`

### Transactional Storage

- [Memtable Query](https://github.com/oceanbase/seekdb/blob/master/src/storage/memtable/mvcc/ob_query_engine.cpp): `src/storage/memtable/mvcc/ob_query_engine.cpp`
- [Tablet Metadata](https://github.com/oceanbase/seekdb/blob/master/src/share/tablet/ob_tablet_meta_table_storage.cpp): `src/share/tablet/ob_tablet_meta_table_storage.cpp`
- [DDL Pipeline](https://github.com/oceanbase/seekdb/blob/master/src/storage/ddl/ob_ddl_pipeline.cpp): `src/storage/ddl/ob_ddl_pipeline.cpp`
- [Log Service](https://github.com/oceanbase/seekdb/blob/master/src/logservice/palf/log_engine.cpp): `src/logservice/palf/log_engine.cpp`
- [Log Storage](https://github.com/oceanbase/seekdb/blob/master/src/logservice/ob_i_log_storage.h): `src/logservice/ob_i_log_storage.h`

### Agent and Operations

- [Async Index Pipeline](https://github.com/oceanbase/seekdb/tree/master/src/observer): `src/observer`
- [COW Sandboxes](https://github.com/oceanbase/seekdb/tree/master/src/storage): `src/storage`

### Other components

- **SQL Client**

## Connections

- SQL Client → MySQL Protocol: sends SQL (evidence: `README.md`)
- MySQL Protocol → SQL Engine: executes query
- SQL Engine → Memtable Query: accesses rows
- SQL Engine → Vector Embeddings: requests embeddings
- SQL Engine → Vector Runtime API: runs vector search (evidence: `README.md`)
- SQL Engine → Full-Text Search: runs text search (evidence: `README.md`)
- SQL Engine → Sparse Retrieval: retrieves matches
- Async Index Pipeline → Log Service: consumes redo (evidence: `README.md`)
- Async Index Pipeline → Vector Runtime API: updates delta index (evidence: `README.md`)
- SQL Engine → DDL Pipeline: executes DDL
- DDL Pipeline → Tablet Metadata: persists metadata
- Log Service → Log Storage: writes log
- SQL Engine → COW Sandboxes: forks or merges (evidence: `README.md`)
- Database Runtime → MySQL Protocol: serves protocol
