Restic's efficiency comes from content-defined chunking: repeated backups only store the delta, keeping storage lean. This episode dissects the deduplication mechanism, reads the real numbers with `restic stats --mode raw-data`, and explains the role of zstd compression (`--compression auto`) that has been the default since restic 0.14.

Episode 5 closed the basic backup→restore cycle. But there is one thing that truly sets restic apart from rsync or tar: it stores deltas, not copies. This is why you can back up a server every day for years without the disk exploding.
This episode dissects restic's efficiency engine: chunk-based deduplication, how compression contributes, and how to read the real numbers.
We already met this concept in episode 2. Now let's see why this method matters practically.
Restic splits files into pieces (chunks) at positions determined by the data content (rolling hash), not every N bytes. Take a growing log file:
[2026-08-13 08:00] request OK
[2026-08-13 08:01] request OK
[2026-08-13 08:02] request FAILWith fixed-size chunking, every chunk shifts whenever a new line is added — every chunk becomes "new". With content-defined chunking, only the pieces that actually changed are stored again; the rest are recognized as identical and not stored again. This is what keeps daily backups of servers with large logs lightweight.
Restic provides two points of view on size:
restic stats --mode restore-size
restic stats --mode raw-datarestore-size: the total file size if all snapshots were restored — your "original" data.raw-data: the physical blob size actually stored in the repository — after dedup and before compression.The ratio between them is the strength of your dedup. For example: restore-size of 500 GiB with raw-data of 12 GiB means dedup is working extremely well (a container server with many identical images), while a ratio close to 1:1 indicates mostly unique data — normal for photos/videos.
Besides dedup, restic compresses chunks before encrypting them. Since restic 0.14, compression uses zstd and is enabled by default through the auto mode.
restic backup --compression auto /data # default: saves space, compresses when worthwhile
restic backup --compression max /data # highest ratio, more CPU
restic backup --compression off /data # no compression, allocative dataauto (default): chunks that clearly cannot be compressed (encrypted files, media) are skipped — this saves CPU on already-compressed data such as JPG/MP4.max: forces the best ratio; suited for text, JSON, logs — but eats CPU.off: allocative data like VM images can be stored uncompressed for faster restores.Note
--compression is a repository parameter — the decision is stored in the config and stays consistent across restic versions. Don't mix modes carelessly; choose once when you set your storage strategy, then stay consistent.
The flow for each new chunk: chunking → dedup check (already there? skip) → zstd compression → AES-256 encryption → store as a blob. The combination of all three is why restic is called "backups done right": every byte you don't need to store is bandwidth and money saved.
To measure the impact on your repo:
restic stats --mode raw-data
du -sh /backup/resticCompare the raw-data figure against the total restore-size of all snapshots. The difference is the amount of data you avoided storing thanks to dedup — a great number to report to your team.
restic stats --mode restore-size = original size; --mode raw-data = physical size.--compression auto) saves storage without wasting CPU.--compression is a repository parameter: choose once, stay consistent.In the next episode, episode 7, we map out backends: local, SFTP, S3 & REST server — the differences between each storage target, their repository URLs, credential configuration (AWS keys), and bandwidth throttling with --limit-upload/--limit-download. Time for your backups to leave a single machine.