Back to Pikiwidb

Pika Snapshot Backup Solution

docs/design/snapshot_en.md

4.0.3734 B
Original Source

Pika Snapshot Backup Solution

Principle

Unlike Redis, Pika's data is primarily stored on disk, giving it a natural advantage for data backup — backups can be accomplished directly through file copying.

Implementation

Process

  • Take a snapshot: Block writes (prevent clients from writing to the DB), and obtain the snapshot contents during this process.
  • Asynchronous thread copies files: Copies snapshot files using a modified RocksDB BackupEngine, which prevents file deletion during this process.

Snapshot Contents

  • All file names of the current DB
  • Size of the manifest file
  • sequence_number
  • Sync point
    • binlog filenum
    • offset