- Published on
a Rust Rewrite of WAL-G for PostgreSQL Backups
- Authors

- Name
- DeepHorus
ClickHouse Unveils WAL-RUS: A High-Performance Rust Rewrite of WAL-G for PostgreSQL Backups
In a significant development for the PostgreSQL ecosystem, data analytics company ClickHouse has announced the open-source release of WAL-RUS, a tool designed to replace and enhance the widely-used WAL-G backup utility. Announced in a blog post on July 25, 2024, WAL-RUS is a ground-up rewrite written in Rust, targeting critical performance and resource efficiency shortcomings in the original Go-based tool. The primary achievement of this rewrite, according to ClickHouse, is a dramatic reduction in virtual memory usage, a common pain point for enterprises managing large-scale database backups. This move signals a growing trend of leveraging Rust's performance and safety features to rebuild foundational data infrastructure tools.
WAL-G has long been the standard for creating continuous archival and backups for PostgreSQL databases, enabling point-in-time recovery. It functions by archiving Write-Ahead Log (WAL) files to cloud storage services like AWS S3, which is essential for both disaster recovery and replicating data. However, as PostgreSQL database sizes have grown into the terabytes, the resource consumption of backup processes has become a critical operational bottleneck. The original WAL-G tool, written in Go, often required significant virtual memory allocations during the compression of WAL segments, leading to higher costs and potential instability in large deployments.
The core innovation of WAL-RUS lies in its rearchitected compression and streaming pipeline. By implementing a more memory-efficient approach, the tool boasts a reduction in virtual memory usage by over 70% compared to WAL-G in benchmark tests conducted by ClickHouse. For instance, when compressing a 256MB WAL segment, WAL-G's memory footprint spiked dramatically, whereas WAL-RUS maintained a consistently low and stable profile. This efficiency gain translates directly into lower cloud computing costs, as customers can use smaller, less expensive virtual machine instances for their backup orchestration tasks without sacrificing reliability.
The implications of this performance leap are substantial for businesses operating large PostgreSQL deployments. Lower memory consumption means backup operations can run more reliably on resource-constrained environments or alongside other critical services. It also enhances scalability, allowing organizations to manage backup workloads for hundreds or thousands of databases more cost-effectively. ClickHouse emphasizes that WAL-RUS maintains full compatibility with backups created by WAL-G, ensuring a seamless migration path for existing users and preventing vendor lock-in, a crucial factor for open-source tool adoption.
The development team at ClickHouse, led by engineers like Vladimir Golovin, shared that the project originated from their own operational needs while building their managed ClickHouse Cloud service, which relies heavily on PostgreSQL. "We were hitting a wall with WAL-G's performance at scale," Golovin explained in the release post. "Rewriting it in Rust allowed us to rethink the architecture from the ground up, focusing on concurrency and memory safety without a garbage collector's overhead." Early feedback from internal use and beta testers has highlighted not just the memory savings, but also increased throughput and predictability during backup operations.
Looking ahead, the release of WAL-RUS is poised to influence the broader database tooling community. ClickHouse has open-sourced the tool under the Apache 2.0 license, inviting contributions from PostgreSQL developers and users worldwide. Future roadmap items include exploring support for additional compression algorithms and deeper integration with other cloud storage providers. As the PostgreSQL ecosystem continues to mature and scale to enterprise heights, projects like WAL-RUS demonstrate how modern systems programming languages can breathe new, high-performance life into essential infrastructure, ultimately making robust data protection more accessible and economical.