WALF

Loading...

WalFetch.com helps database engineers configure wal fetch, WAL-G, and PostgreSQL continuous archiving.

Wal Fetch (WAL-G) vs pgBackRest: PostgreSQL Backup Tool Comparison

When choosing a PostgreSQL backup strategy, WAL-G's wal-fetch and pgBackRest are the two most popular open-source options. Both support continuous archiving and PITR, but they differ significantly in architecture, performance, compression options, and operational complexity.

WAL-G (wal-fetch) is a lightweight, single-binary tool written in Go. It supports multiple databases (PostgreSQL, MySQL, MongoDB, Redis), multiple compression algorithms (LZ4, LZMA, ZSTD, Brotli), and integrates directly with cloud storage APIs. Its simplicity makes it ideal for cloud-native deployments.

pgBackRest is a dedicated PostgreSQL backup tool with a richer feature set including parallel backup and restore, backup retention policies, S3/Azure/GCS support, and a dedicated repository host model. It is more complex to configure but offers finer-grained control over backup policies.

Performance comparison: WAL-G's wal-fetch with WALG_DOWNLOAD_CONCURRENCY tuned for your environment can achieve very high throughput from S3, often limited only by available bandwidth. pgBackRest also supports parallel WAL restore using process-max setting.

Compression: Both tools support multiple compression algorithms. WAL-G defaults to LZ4 (fast compression/decompression), while pgBackRest defaults to gzip. For maximum compression ratio, LZMA or Brotli in WAL-G, or lz4/zst in pgBackRest offer better trade-offs.

Cloud storage support is comparable between both tools. WAL-G natively supports S3, GCS, Azure Blob, and S3-compatible endpoints. pgBackRest added S3, Azure, and GCS support in recent versions. Both tools work well in cloud-native PostgreSQL environments.

“Both wal fetch and pgBackRest are production-grade tools—the best choice depends on your cloud environment, database size, and operational preferences.”

Step-by-Step: Evaluate Requirements

Follow these steps to implement wal fetch in your PostgreSQL environment effectively.

Step 1

Evaluate Requirements

Consider database size, RTO/RPO requirements, cloud provider, and team expertise when choosing between WAL-G wal-fetch and pgBackRest.
Step 2

Test Compression

Benchmark LZ4 vs ZSTD in WAL-G and lz4 vs gzip in pgBackRest on your actual workload to find the best speed/size trade-off.
Step 3

Compare Restore Times

Run a trial recovery with each tool using a copy of your production backup to measure actual restore speed under realistic conditions.
Step 4

Plan for Scale

For very large databases (10TB+), pgBackRest's parallel restore may offer advantages, while WAL-G's simplicity suits most sub-10TB deployments.