Synchronization & Backup Engines
At the heart of DodaBackup is an asynchronous multi-threaded engine authored in Rust. Unlike generic file copy utilities that rely on synchronous blocking calls, DodaBackup pipelines directory discovery, metadata comparison, cryptographic checksumming, and I/O transfers across independent worker thread pools.
Before diving into engine internals, ensure you have reviewed how profiles are configured in our Creating & Managing Backup Profiles Guide.
Comparison Matrix
| Feature | Two-Way Sync | Mirror Backup | Incremental Backup | Continuous Watcher |
|---|---|---|---|---|
| Data Direction | Bi-directional (↔) | One-way Source → Dest | One-way Source → Dest | One-way Source → Dest |
| New Files | Copied both ways | Copied to destination | Copied to destination | Streamed immediately |
| Modified Files | Resolved by rule | Overwritten on destination | Overwritten on destination | Streamed immediately |
| Deleted at Source | Deleted at destination | Deleted at destination | Preserved at destination | Action depends on mode |
| Execution Trigger | Manual / Scheduled | Manual / Scheduled | Manual / Scheduled | Real-Time Kernel Event |
| Primary Use Case | Shared USB between PCs | Exact system image | Long-term file archives | Active coding & drafting |
1. Two-Way Synchronization (Bi-directional)
Two-Way Sync ensures that two folders on different storage drives or locations remain 100% equivalent. It is the premier choice when alternating work between a desktop computer and a mobile laptop using a shared USB drive.
sequenceDiagram
participant S as Source Folder
participant E as DodaBackup Engine
participant D as Destination Folder
E->>S: 1. Read metadata tree & hashes
E->>D: 2. Read metadata tree & hashes
Note over E: Reconcile changes, conflicts & deletions
E->>D: 3. Propagate newer files from Source
E->>S: 4. Propagate newer files from Destination
Conflict Handling
When a file with the same relative path has been modified in both locations since the last sync baseline:
- Newer Wins (Default): The version with the highest UTC modification timestamp prevails.
- Source Wins: The Source directory is treated as the authority.
- Interactive Prompt: The synchronization pauses and asks you which version to keep or if both should be preserved with unique timestamp suffixes (e.g.,
document (Conflict 2026-11-18).docx). You can configure these collision rules in Stage 5 of the Profile Wizard.
2. Mirror Backup (Exact Replica)
Mirror Backup is an exact one-way replication engine. It ensures that the Destination target is a photographic clone of the Source.
The 3-Phase Mirror Pipeline
To prevent data loss during power cuts or abrupt disconnects, DodaBackup executes mirrors in three distinct phases:
- Discovery & Delta Analysis: Scans both paths in parallel using Rayon worker threads. It identifies files to add, files to update, and orphaned files existing in the destination that no longer exist in the source.
- Atomic In-Flight Staging: New and modified files are copied to the destination using atomic temporary suffixes (
.doda_tmp_[uuid]). Only when the write completes and the file size/checksum is verified does DodaBackup atomically rename the temporary file to its final destination name. - Safe Orphan Cleanup: Files marked for deletion from the destination are purged only after all new files have verified successfully. If a transfer fails mid-way, existing destination files are kept untouched. To restore your data from a Mirror backup, follow our Restore & Data Recovery Guide.
3. Incremental Backup (History Preservation)
Incremental Backup is the safest mode for document retention, financial audits, and digital photography. It copies all additions and updates from the Source into the Destination, but strictly never deletes anything from the Destination.
Why Incremental Is Essential
If an employee or family member accidentally deletes a critical folder on their primary machine, a standard Mirror backup would propagate that deletion. In Incremental mode, the destination retains every file ever backed up.
- Only modified files (detected via timestamp delta or SHA-256 hash change) are transferred.
- Clean destination state: Identical directory hierarchy with zero proprietary database lock-in. You can browse destination files directly using Windows File Explorer. See Zero Vendor Lock-In.
4. Continuous Watcher (Real-Time Sentinel)
The Continuous Watcher transforms DodaBackup from a periodic backup tool into an active, real-time protection sentinel.
graph TD
USER["User Saves File (Ctrl + S)"] --> OS["Windows Kernel (NTFS)"]
OS --> KERNEL["ReadDirectoryChangesW Hook"]
KERNEL --> DEBOUNCE["Doda Event Debouncer<br/>(300ms Coalesce Window)"]
DEBOUNCE --> RUST["Rust Thread Pool Worker"]
RUST --> SYNC["Atomic Write to Destination"]
Technical Implementation
- Zero Polling Overhead: Unlike legacy tools that scan your hard drive every 60 seconds (grinding your disk and draining laptop battery), DodaBackup registers asynchronous I/O completion ports (
IOCP) with the Windows kernel viaReadDirectoryChangesW. - Intelligent Event Debouncing: When an application (like Photoshop or Visual Studio) saves a file, it may trigger dozens of micro-writes in a few milliseconds. DodaBackup buffers these events within an adaptive 300ms window, transferring the file only when the application has released its file handle.
- Resource Footprint: Consumes 0.0% CPU while waiting for disk events and occupies under 25 MB of resident RAM. For system boot options, refer to Startup & Background Preferences.