Archive formats · compression algorithms · backup & dedup · columnar storage · Python APIs · verified 2026

Data archival & compression

Package, shrink, back up, and preserve data for the long haul. Bundle with tar/zip; compress with the right algorithm — gzip for compatibility, xz for max ratio, zstd for the modern speed/ratio sweet spot, lz4 when speed is everything. This edition adds a backup & deduplication section (incremental tar/rsync, restic & Borg, delta & content-defined chunking), deeper zstd 1.5.7 & compression.zstd, and Parquet internals. Pairs CLI tools with their Python APIs — including Python 3.14's compression.zstd.

formats & algorithms backup & dedup Python APIs columnar storage choose, store & verify gotcha most common

Verified 2026-09-08 against GNU tar/coreutils & rsync, zstd 1.5.7/xz/lz4 docs, restic & BorgBackup docs, the CPython stdlib (incl. PEP 784's compression.zstd, new in 3.14), and the Apache Parquet/ORC/Avro specs. tar bundles; the algorithm compresses; backup tools add incrementals & dedup — distinct jobs.

Outline

Bundle & compress, then back up incrementally with dedup, drive it all from Python, pick durable columnar formats, and choose an algorithm by access pattern — always with a checksum.

Formats, algorithms & backup

  1. 1tar — bundle files
  2. 2zip & the classics
  3. 3zstd — the modern default
  4. 4xz, lz4, brotli
  5. 5Incremental backup
  6. 6Dedup backup tools
  7. 7Delta & chunking

Python APIs

  1. 8gzip / bz2 / lzma
  2. 9tarfile & zipfile
  3. 10compression.zstd (3.14)
  4. 11shutil archives

Columnar & durability

  1. 12Parquet / ORC / Avro
  2. 13Parquet internals
  3. 14Choosing an algorithm
  4. 15Cold storage & lifecycle
  5. 16Integrity & practice

Archive Formats & Algorithms

Bundle with tar/zip; compress with the algorithm that fits.

1tar — bundle filestape archive
2zip & the classicsgzip · bzip2
3zstd — the modern defaultZstandard 1.5.7
4xz, lz4, brotlithe specialists

Backup & Deduplication

Store only what changed — incrementals, dedup, and deltas.

5Incremental backuptar · rsync
6Dedup backup toolsrestic · Borg
7Delta & chunkingdiffs & CDC

Python APIs

Every major format has a stdlib module — including the new compression package.

8gzip / bz2 / lzmastdlib compressors
9tarfile & zipfilebundles in Python
10compression.zstdPython 3.14 · PEP 784
11shutil archivesone-liners

Columnar Storage

Formats built for analytics — and why they compress so well.

12Parquet / ORC / Avrodata-lake formats
13Parquet internalswhy it's small & fast

Choose, Store & Verify

Pick the codec, tier to cold storage, and prove the bytes.

14Choosing an algorithmthe tradeoff
15Cold storage & lifecycletiering
16Integrity & practicetrust the bytes

Worth memorizing

tar -czf a.tar.gz dir/create · -xzf extract · -tf list
zstd -19 · --ultra -22 · --maxmodern default; -T0 all cores
xz -9 (cold) · lz4 (hot) · gzip (compat)access pattern picks codec
tar -czg snap.snar · rsync --link-destincremental backup
restic / borgencrypted, deduplicated, incremental-forever
zstd --patch-from · CDCdeltas & dedup chunking
gzip.open / compresssame API in bz2, lzma
from compression import zstdstdlib zstd, new in 3.14
tarfile extractall(filter="data")block tarbombs; w:zst on 3.14
to_parquet(compression="zstd")row groups + encodings + pushdown
aws s3 cp --storage-class DEEP_ARCHIVEtier + lifecycle + WORM
sha256sum -c · restic/borg checkverify; compress THEN encrypt