graph LR
domain["domain"]
br["br"]
cdc["cdc"]
tidb_kv["tidb.kv"]
planner["planner"]
ddl["ddl"]
br -- "Queries for a consistent view of the schema" --> domain
br -- "Reads large volumes of key-value data" --> tidb_kv
cdc -- "Monitors for schema changes" --> domain
cdc -- "Reads committed data changes from the storage layer's logs" --> tidb_kv
planner -- "Consults for schema information" --> domain
ddl -- "Orchestrate and persist schema changes" --> domain
The Cluster Management subsystem is composed of operational tools and a central metadata component that enables their function. The following six components are fundamental to its architecture and its interaction with the core database.
Acts as the central authority for cluster-wide metadata. It caches and manages schema information, versions, and coordinates online DDL jobs, serving as the bridge between the database core and management tools.
Related Classes/Methods:
domain/
Manages the creation of consistent, distributed snapshots for backup and restore operations. It coordinates with the underlying storage to capture a transactionally consistent view of the data across the cluster.
Related Classes/Methods:
br/
Captures and streams row-level data changes (INSERT, UPDATE, DELETE) in real-time to downstream systems. It enables data integration by tapping into the underlying storage logs.
Related Classes/Methods:
cdc/
Provides the primary abstraction layer for accessing the distributed key-value data in the underlying storage engine (TiKV). It is optimized for the high-throughput reads required by br and cdc.
Related Classes/Methods:
tidb/kv/
Responsible for parsing and optimizing SQL queries. It is a critical consumer of the domain component, relying on it for the schema information necessary to build efficient query execution plans.
Related Classes/Methods:
planner/
Manages the execution of Data Definition Language (DDL) statements. It interacts directly with the domain component to apply and track schema changes across the distributed environment.
Related Classes/Methods:
ddl/