# Placement Driver (PD) Server

+ Metadata storage for the entire TiDB cluster
+ Assign unique Global ID and Transaction ID
+ Generate a global timestamp TSO
+ Collect cluster information for resource scheduling
+ Provide TiDB Dashboard (UI) service 

```
ID                Role    Host        Ports        OS/Arch       Status   Data Dir                      Deploy Dir
--                ----    ----        -----        -------       ------   --------                      ----------
...
10.0.0.110:2379   pd      10.0.0.110  2379/2380    linux/x86_64  Up|L|~!@UI@!~  /tidb-data/pd-2379            /tidb-deploy/pd-2379
...
```

![`smart`](PD_aa_001_20220506.png)

------------------------------------------------------------
The important features of Placement Driver include the following:

Metadata storage for the entire TiDB cluster
- Information such as region mapping to key range and where regions are located are stored in PD. For example, TiDB server obtains routing information from PD and then accesses it to the relevant TiKV for the data. In addition, the topological information of TiKV and the label information are also stored in the PD. Label will be explained in detail later.

Assigning a Global ID and a Transaction ID
- The Global ID we use, such as `store ID`, `region ID`, `peer ID`, `table ID`, `index ID`, etc., and the Transaction ID of the distributed transaction are also assigned by PD.

Generating a global timestamp TSO
- TSO is a global timestamp used to guarantee the order of transactions in the TiDB cluster. A very important feature of PD is to generate TSO.

Collecting cluster information for resource scheduling
- The TiKV node periodically reports the status of the cluster to PD. The PD is responsible for scheduling the Region among TiKV nodes according to the relevant status.