# Using TiDB Lightning - Breakpoint Continued

__*Using Lightning*__
__*Lightning Breakpoint Continued*__

```
[checkpoint]
# Whether to enable checkpoints.
# While importing data, TiDB Lightning records which tables have been imported, so
# even if TiDB Lightning or some other component crashes, you can start from a known
# good state instead of restarting from scratch.
enable = true

# Where to store the checkpoints.
#  - file:  store as a local file (requires v2.1.1 or later)
#  - mysql: store into a remote MySQL-compatible database
driver = "file"

# The schema name (database name) to store the checkpoints
# Enabled only when `driver = "mysql"`.
# schema = "tidb_lightning_checkpoint"

# The data source name (DSN) indicating the location of the checkpoint storage.
#
# For the "file" driver, the DSN is a path. If the path is not specified, Lightning would
# default to "/tmp/CHECKPOINT_SCHEMA.pb".
#
# For the "mysql" driver, the DSN is a URL in the form of "USER:PASS@tcp(HOST:PORT)/".
# If the URL is not specified, the TiDB server from the [tidb] section is used to
# store the checkpoints. You should specify a different MySQL-compatible
# database server to reduce the load of the target TiDB cluster.
#dsn = "/tmp/tidb_lightning_checkpoint.pb"

# Whether to keep the checkpoints after all data are imported. If false, the
# checkpoints are deleted. Keeping the checkpoints can aid debugging but
# might leak metadata about the data source.
# keep-after-success = false
```
-------------------------------------------------------------
Importing large amounts of data typically takes hours to days, and long-running processes may experience abnormal interruptions. If you start from scratch every time you restart, you'll waste data that you've successfully imported before. To this end, TiDB Lightning provides a "breakpoint resume" function. Even if tidb-lightning crashes, it will continue to work at the previous progress when restarted.

TiDB Lightning supports two storage methods: local files or MySQL databases.

If driver = "file", the breakpoint is stored in a local file whose path is specified by the dsn parameter. Because breakpoints are frequently updated, it is recommended to place this file on a disk with unlimited writes, such as a RAM disk.
If driver = "mysql", the breakpoint can be stored in any MySQL 5.7 or higher compatible database, including MariaDB and TiDB. If no selection is made, it will exist in the target database by default.

The target database has a lot of operations during the import. Using the target database to store breakpoints increases the burden and may even cause data loss due to communication timeouts. Therefore, it is highly recommended that you deploy a temporary MySQL-compatible database server outside of the database. This database can also be installed on the tidb-lightning host. You can delete them after the import is complete.