# Using TiDB Lightning - Parallel Importing

__*Using Lightning*__
__*Lightning parallel import*__

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

-------------------------------------------------------------
Import data from a single table in parallel. In this scenario, multiple single-table files stored in a directory or cloud storage (such as Amazon S3) are imported into the downstream TiDB database in parallel by different TiDB Lightning instances. This feature is new in v5.3.0.
Since TiDB Lightning needs to upload the generated key-value data to the TiKV node where each replica of the corresponding region resides, the import speed is limited by the target cluster size. In general, it is recommended to ensure that the number of TiKV instances in the target TiDB cluster and the number of TiDB Lightning instances is greater than n:1 (where n is the number of replicas in Region). Also, in order to achieve the best performance when using the TiDB Lightning parallel import mode, the following restrictions are recommended:

Performance optimization recommendations:
Each TiDB Lightning is deployed on a separate machine. TiDB Lightning consumes all CPU resources by default. Deploying multiple instances on a single machine does not improve performance.
The total size of the source files imported by each TiDB Lightning instance does not exceed 5 TiB
The total number of TiDB Lightning instances does not exceed 10