Offline Mnesia backup versus online backup with safe_fallback under minimal downtime
0 reputation · 10 Apr 2023, 20:56 UTC
An Erlang service using Mnesia must schedule a backup with minimal node downtime. The team needs to decide whether to take an offline snapshot using mnesia:backup/2 with the force option or an online snapshot using mnesia:backup/2 with safe_fallback, then restore it with mnesia:restore/2 and confirm the recovered tables match the pre-backup state.
Assuming standard Erlang/OTP Mnesia behavior, offline backup produces a consistent snapshot but stops the node, while online backup keeps the node running yet may include uncommitted writes. mnesia:restore/2 can replay delta logs but does not automatically verify data integrity. Restoring an offline snapshot onto a running node with active table writes can cause schema conflicts, and delta-only restores may omit transactions committed after the snapshot.
Which approach best satisfies a hard downtime limit without introducing schema conflicts during restore? Should application-level checksum comparison be treated as mandatory after an online restore even when delta logs are available? What restore ordering prevents conflicts when tables continue receiving writes during the backup window?