Персистентность | Tarantool
Документация на русском языке
поддерживается сообществом
Concepts Модель данных Персистентность

Персистентность

To ensure data persistence, Tarantool records updates to the database in the so-called write-ahead log (WAL) files. When a power outage occurs or the Tarantool instance is killed incidentally, the in-memory database is lost. In such case, Tarantool restores the data from WAL files by reading them and redoing the requests. This is called the «recovery process». You can change the timing of the WAL writer or turn it off by setting the wal.mode.

Tarantool также сохраняет набор файлов со статическими снимками данных (snapshots). Файл со снимком — это дисковая копия всех данных в базе на какой-то момент. Вместо того, чтобы перечитывать все WAL-файлы с момента создания базы, Tarantool в процессе восстановления может загрузить самый свежий снимок и затем прочитать только те WAL-файлы, которые были созданы начиная с момента сохранения снимка. После создания новых снимков более ранние WAL-файлы могут быть удалены, чтобы освободить место на диске.

To force immediate creation of a snapshot file, use the box.snapshot() function. To enable the automatic creation of snapshot files, use Tarantool’s checkpoint daemon. The checkpoint daemon sets intervals for forced snapshots. It makes sure that the states of both memtx and vinyl storage engines are synchronized and saved to disk, and automatically removes earlier WAL files.

Файлы со снимками можно создавать, даже если WAL-файлы отсутствуют.

Примечание

The memtx engine takes only regular snapshots with the interval set in the checkpoint daemon configuration.

Движок vinyl постоянно сохраняет состояние в контрольной точке в фоновом режиме.

See the Internals section for more details about the WAL writer and the recovery process. To learn more about the configuration of the checkpoint daemon and WAL, check the Persistence page.

Нашли ответ на свой вопрос?
Обратная связь