Skip to content

Backup & Restore (Whole-Block Snapshots, Validated Recovery & Portable RDB)

This guide covers Engula 2.3.0's dual-mode RDB snapshot architecture, Copy-on-Write (CoW) memory control, three-mode validated startup recovery, offline verification with valkey-check-rdb, and AOF operational boundaries.


1. Dual-Mode Snapshot Architecture: Native Whole-Block (engula-rdb 1) vs. Standard Logical (engula-rdb 0)

Engula 2.3.0 preserves 100% of standard persistence directives (SAVE, BGSAVE, BGSAVE SCHEDULE, save "") and provides runtime-selectable snapshot serialization via engula-rdb:

Configuration Wire/Disk Format & Mechanism Primary Use Cases
engula-rdb 1 (Default) Native Whole-Block Physical Snapshot (v4 format; backward-compatible reader for v3): Stage 1 sequentially writes pre-compressed memory blocks and shared compression dictionaries (zero decompression, zero re-encoding); Stage 2 snapshots physical hash-table slot positions across all 16,384 per-slot sub-tables in Cluster mode so cold loads place entries directly without hash recomputation or rehashing Routine production cold backups, rapid crash/restart recovery, and sub-2-second homogeneous primary-replica fullsync
engula-rdb 0 100% Standard Logical RDB (REDIS0011): Materializes compressed records into standard Redis 7.2 / Valkey object encodings (incurring decompression CPU and returning to traditional save/load speeds) Cross-engine export to vanilla Redis 7.2 / Valkey, offline data-warehouse ETL scanners, 2.2.0/2.2.1 version bridging, and zero-lock-in exit
How

BGSAVE Uses fork() and Bounds Copy-on-Write Memory Engula 2.3.0 uses standard POSIX fork() for BGSAVE to guarantee point-in-time command atomicity between event-loop ticks. Its low memory overhead comes from three mechanisms working together: ① smaller compressed physical footprints shrink OS page tables (fork() takes ~15–25 ms vs. 54–89 ms); ② progressive per-block child page release drops OS physical page references immediately after serializing each multi-page block while the parent suspends background compaction/recompression and appends foreground writes into fresh blocks; and ③ a 13.7× shorter save window drastically narrows the time window in which live writes can dirty shared pages.


2. Measured Snapshot, Cold-Load & CoW Performance Reference

Measured figures from the public live verification suite (/proof-live#rdb at 8 GB scale vs. Redis 7.2) and controlled Engula 2.3.0 workstation verification (vs. Redis 7.2.14):

Scenario & Dataset Engula (engula-rdb 1) Redis 7.2 Baseline Operational Impact
Background BGSAVE (String, 8 GB · 40M keys) 3.71 s 50.86 s 13.7× faster, shrinking backup windows from ~1 minute to seconds
Synchronous SAVE (String, 8 GB) 2.04 s 36.54 s 17.9× faster (Hash 14.1–15.0×, Set 11.3–14.1×; compressed List nodes natively serialized since 2.2.2)
Cold Restart LOAD (String, 8 GB) 2.39 s 14.62 s 6.1× faster cold node recovery
BGSAVE CoW Overhead Under Load (2M × 1 KB, 50,000 ops/s random writes) +141 MB (+14%) +2,324 MB (+74%) ~16× lower absolute CoW overhead, eliminating 2× snapshot RAM over-provisioning
2-Replica Reconnect Storm BGSAVE Peak (16 live write clients) 5,285 MB 13,205 MB ~40% of vanilla peak RSS (58.9% lower)

To benchmark save/load timings on your own production dump.rdb and hardware, run Engula RDBPerf. Always size host snapshot headroom as steady-state used_memory_rss + measured rdb_last_cow_size at peak write rate.


3. Production Backup Configuration, Archival & Portable Export

3.1 Production engula.conf Persistence Baseline

1dir /var/lib/engula
2dbfilename dump.rdb
3
4# Tune automatic save points to your RPO, or set save "" to disable scheduled RDB triggers
5save 900 1
6save 300 10
7save 60 10000
8
9rdbcompression yes
10rdbchecksum yes
11stop-writes-on-bgsave-error yes
12disable-thp yes
13
14# Enable v4 native whole-block snapshots and automatic 3-mode validated startup recovery
15engula-rdb 1
16engula-rdb-deep-validate auto
17engula-rdb-validate-max-drop-ratio 100

3.2 Triggering Backups, Checking Status & Running Offline valkey-check-rdb

1# 1. Trigger asynchronous snapshot (or BGSAVE SCHEDULE when another child is active)
2redis-cli -h <host> -p <port> BGSAVE
3
4# 2. Confirm rdb_bgsave_in_progress:0 and rdb_last_bgsave_status:ok
5redis-cli -h <host> -p <port> INFO persistence | grep -E 'rdb_bgsave_in_progress|rdb_last_bgsave_status|rdb_last_bgsave_time_sec|rdb_last_cow_size'
6
7# 3. Verify archived Engula RDB header CRCs, reference invariants, and footer fingerprints offline
8valkey-check-rdb /var/lib/engula/dump.rdb
9
10# 4. Ship snapshot to off-site / cross-AZ backup storage (use LUKS disk encryption or S3/OSS SSE at rest)
11cp /var/lib/engula/dump.rdb /backup/engula/dump-$(hostname)-$(date +%Y%m%d%H%M%S).rdb

3.3 Exporting Standard REDIS0011 Snapshots for Vanilla Redis 7.2 / Valkey or ETL

1# Switch to standard logical RDB format and trigger a fresh snapshot
2redis-cli -h <backup-replica> -p <port> CONFIG SET engula-rdb 0
3redis-cli -h <backup-replica> -p <port> BGSAVE

Note: CONFIG SET engula-rdb 0 governs subsequent saves and does not convert an already-written dump.rdb on disk. Per-key commands (DUMP, RESTORE, MIGRATE) always emit standard RDB v11 + CRC64 payloads regardless of engula-rdb.


4. Three-Mode Validated Startup Recovery & Bounded Drop Gate

When booting from a native snapshot or loading an incoming native fullsync, Engula 2.3.0 automatically selects one of three recovery modes and logs the outcome in ENGULA INFO health:

Load Mode (engula_rdb_last_load_mode) Trigger Condition Execution Path & Replication Impact
fast (Physical Fast Load) Normal restart where footer 4-counter totals and fingerprint match in O(1) Streams compressed blocks sequentially and restores physical slot positions directly in seconds
filtered (Reference-Closure Filter) Footer totals show benign orphan records left by concurrent DEL during the fork() window Filters unreferenced records via a bitmap closure at install time (orphans_reclaimed); zero logical key loss and incremental PSYNC2 remains intact
rebuild (Deep Decode & Slot Rebuild) Persistent engula-corruption.marker from a runtime fail-stop, engula-rdb-deep-validate yes, or Standalone ↔ Cluster topology change (2.2.3+) Decodes and verifies every entry individually and recomputes target hash slots (~10.9s on 2M × 1 KB strings)

Bounded Repair Gate (engula-rdb-validate-max-drop-ratio)

  • PPM Budget & 128-Record Floor: In 2.3.0, engula-rdb-validate-max-drop-ratio is expressed in parts per million (ppm), defaulting to 100 (0.01%). Any non-zero setting enforces a minimum floor of 128 records so isolated media bit-flips on small shards remain repairable, while 0 forbids dropping even a single record.
  • Refusal on Widespread Corruption: If corrupted entries exceed the budget (or structural/CRC headers fail), the server exits with code 1 before accepting clients, leaving dump.rdb and the marker untouched for operator forensics.
  • Downstream Replication Safety: Whenever engula_rdb_last_load_dropped > 0, the server automatically invalidates its prior replid and replication backlog so downstream replicas perform a clean FULLRESYNC rather than silently diverging.

5. AOF Persistence Interoperability & Boundaries

Engula 2.3.0 supports appendonly yes and hybrid AOF (aof-use-rdb-preamble yes) with three explicit operational boundaries:

  1. Standard Traditional RDB Preamble in BGREWRITEAOF: AOF rewrites intentionally emit a standard REDIS logical RDB preamble so AOF loaders and external audit tools remain 100% compatible. Schedule BGREWRITEAOF outside peak traffic windows (though child page management still holds AOF CoW overhead far below vanilla Redis: 208 MB vs. 2,520 MB).
  2. Active-AOF Dataset Reset Guard (2.3.0): Refuses unsafe internal dataset-reset calls while another subsystem holds an active AOF handle, protecting persistence consistency.
  3. RDB-Scoped Auto-Rebuild & Storage-Layer Encryption at Rest: Marker-driven three-mode validation applies to RDB startup/fullsync loads rather than AOF replay; enforce encryption at rest via filesystem/volume encryption (LUKS, EBS/cloud disk encryption) or object-storage SSE.

Related: High Availability & Cross-DC DR · Incident Triage & Fail-Stop Playbook · Engula RDBPerf