# Data Consistency Options for `Dumpling`

+ `Dumpling` uses the **`--consistency {consistency_level}`** option to control the exported data consistency
  + **`flush`**: When works with `MySQL`, use **`FLUSH TABLES WITH READ LOCK`** to temporarily interrupt the `DML` and `DDL` operations of the replica database
  + **`snapshot`**: Get a consistent snapshot of the specified timestamp and export it
  + **`lock`**: Add read locks on all tables to be exported. You need to enable **`enable-table-ddl`** parameter first
  + **`auto`**: Use **`flush`** for `MySQL` and **`snapshot`** for `TiDB`
  + **`none`**: No guarantee for consistency

```
$ tiup dumpling --consistency snapshot ~!@--snapshot 436733107733004293@!~

$ tiup dumpling --consistency snapshot ~!@--snapshot "2022-10-17 19:03:11"@!~
```

--------------------------------------------------------------------------------

`Dumpling` uses the `--consistency {consistency level}` option to control the way in which data is exported for "consistency assurance". When using snapshot for consistency, you can use the `--snapshot` option to specify the timestamp to be backed up. You can also use the following levels of consistency:

- `flush:` Use `FLUSH TABLES WITH READ LOCK` to temporarily interrupt the `DML` and `DDL` operations of the replica database, to ensure the global consistency of the backup connection, and to record the binlog position (`POS`) information. The lock is released after all backup connections start transactions. It is recommended to perform full backups during off-peak hours or on the `MySQL` replica database.
- `snapshot:` Get a consistent snapshot of the specified timestamp and export it.
- `lock:` Add read locks on all tables to be exported.
- `none:` No guarantee for consistency.
- `auto:` Use flush for `MySQL` and snapshot for `TiDB`.