# Scheduling: Total Process
__*General process of dispatch*__

![left](./student-guide/diagram/SchedulingProcessOverview_en_002_20220509.png)

------------------------------------------------------------
As distributed, highly available database storage, we must meet the following requirements:
- Fixed number of replica
- replica need to be distributed across different nodes
- After adding a new node, you can migrate a replica on another node
- After the node goes offline, the data of the node needs to be migrated

In addition, we need to meet the following performance requirements:
- Maintain a uniform distribution of leaders throughout the cluster
- Maintain uniform storage capacity of each node
- Maintain a uniform distribution of hotspots
- Control the speed of Balance to avoid affecting online services
- Management node status, including manual online/offline nodes, and automatic downlink of failed nodes

In order to meet these requirements, we first need to collect enough information, such as the status of each node, information of each Raft Group, statistics of service access operations, etc. Secondly, we need to set up some policies. Based on this information and scheduling strategy, PD will formulate a scheduling plan that meets the requirements described above as much as possible; and finally, some basic operations are needed to complete the scheduling plan.
Since TiKV is not responsible for allocating regions, only PD has a global perspective, so only PD nodes can complete this task, so the whole process is as follows:
1. Information collection
2. Generating a schedule
3. Execute a schedule