# `PARMS::` Main Features of TiDB Server

+ Handling client connections
+ Parse and compile SQL statements
+ Map relational data to key-value pairs
+ Execute SQL statements
+ Online DDL execution
+ Garbage Collection
+ Cache small table in memory

![`right`](TiDBServerArchitecture_aa_002_20220509.png)

------------------------------------------------------------------------------
In the previous unit, we learned that TiDB server is the SQL layer, exposes the connection endpoint of the MySQL protocol to the outside, and is responsible for accepting client connections, parsing, optimizing and executing SQL statements. It is also responsible for generating distributed execution plans. TiDB server itself does not store data, it only parses SQL and forwards the actual data read request to the underlying storage node TiKV (or TiFlash).

1. The modules `Protocol Layer`, `Parser`, `Compiler`, and `Executor` are mainly responsible for parsing and compiling (optimizing) SQL statements. After processed by these modules, an execution plan for SQL statement is generated.
2. The `Executor` and `DistSQL` modules are mainly responsible for executing SQL execution plans in batches.
3. The modules `Transaction` and `KV` are responsible for transaction related writes.
4. The modules `PD Client` and `TiKV Client` are responsible for interacting with `Placement Driver` and `TiKV`.
5. The modules `Schema Load`, `Worker` and `Start Job` collaborate together to execute the online `DDL`.

MemBuffer is used to cache the result sets, metadata, and login authentication information, etc.

Feature cached table (v6.0) is suitable for those hotspot small tables that are frequently accessed and rarely modified. That is, the data of the entire table is loaded into the memory of the TiDB server, and the table data is obtained directly from the memory, avoiding fetching table data from TiKV instances, thus improving the read performance.
