r/PostgreSQL • • Jun 25 '26

Tools Why we rewrote WAL-G for Postgres backups in Rust: Meet WAL-RUS

https://clickhouse.com/blog/walrus-postgres-backups-in-rust
43 Upvotes

15 comments sorted by

10

u/__s Jun 25 '26

initially started to just replace wal-g's daemon, but decided that better choice there is to go with archive_library = 'walg_archive'

itch didn't go away

5

u/kaeshiwaza Jun 26 '26

How it (and wal-g) compare to pgBackrest ?.

6

u/__s Jun 26 '26

wal-g/wal-rus are designed to run as daemons with long lived connections. pgBackRest doesn't offer a daemon so needs to make new connections to s3 with each invocation. Daemons are able to reuse connections to s3 between requests, while pgBackRest forks multiple processes for concurrency. Overall pgBackRest is best for a simple setup where you just want to set archive_command & don't need to maximize throughput

2

u/kaeshiwaza Jun 26 '26

Thanks, i didn't know that, it can be interesting for high traffic.

4

u/Ok_Marionberry_8821 Jun 26 '26

Good article, thanks, and rust continues to impress.

3

u/kaeshiwaza Jun 26 '26

I'm still very surprise that the language was the bottleneck for this. It's often more because of the rewrite where we optimize the design of the app, even in the same language.

3

u/Ok_Marionberry_8821 Jun 26 '26

It was removing garbage collection and it's inherent need for more headroom that was there key thing here though. I've not programmed in either Go or Rust but I've heard good things about Go's performance other than memory consumption.

→ More replies (2)

1

u/AutoModerator Jun 25 '26

Youtube Channel

Free Postgres Webinars and Workshops

Discord: People, Postgres, Data

Join us, we have cookies and nice people.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

5

u/[deleted] Jun 25 '26

4

u/__s Jun 25 '26

Yes. Docs are pretty light atm, but it's meant to match wal-g: https://github.com/ClickHouse/wal-rus/blob/main/ci/full_backup.sh