# Scheduling Process Overview


![left](./student-guide/diagram/04-Process-01-01.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
  - When you add a new node, you can migrate replica from other nodes
  - After the node is offline, the data of the node needs to be migrated

At the same time we need to meet the following performance requirements
  - Maintain uniform distribution of leaders throughout the cluster
  - Maintain uniform storage capacity for each node
  - Maintain uniform distribution of access hotspots
  - Control the speed of Balance to avoid disrupting online services
  - Management node status, including manual online/offline nodes, and automatic offline failure nodes

In order to meet these requirements, firstly, we need to collect enough information, such as the status of each node, information of each Raft Group, statistics of service access operations, etc. Second, we need to set some policies. Based on these information and scheduling policies, PD formulates a scheduling plan that meets the requirements as much as possible. Finally, we need some basic operations to complete the scheduling plan.

Since TiKV is not responsible for the allocation of regions, only PD has a global perspective, then only PD nodes can complete this task, so the whole process is:
- Information collection
- Build schedule
- Execute scheduling

Below, we will introduce them separately.