gitmyhub

pg_hardstorage

Go ★ 100 updated 4d ago

pg_hardstorage — enterprise-grade PostgreSQL backup: continuous WAL streaming + base backups, single static Go binary, PostgreSQL 15–18, Apache 2.0.

A single Go binary that protects PostgreSQL databases through continuous WAL streaming and scheduled base backups, enabling point-in-time recovery to any moment without OS-level access to the database host.

GoPostgreSQLS3DockerPrometheusKubernetessetup: moderatecomplexity 4/5

pg_hardstorage is a backup tool for PostgreSQL databases, distributed as a single static binary written in Go. It is designed to provide continuous, byte-precise protection by combining two running processes: one that streams every database change log (called a WAL, or write-ahead log) to a storage repository in real time, and a second that takes periodic full base backups to anchor the stream. Together they enable point-in-time recovery, meaning you can restore the database to any specific moment, not just the last nightly snapshot.

The central idea is that WAL streaming is always on. A process holds a replication slot inside PostgreSQL and ships every byte of changes as they are written, without needing access to the database host's operating system or file system. The connection uses PostgreSQL's standard replication protocol over an ordinary network connection. This design means pg_hardstorage can protect PostgreSQL running on bare metal, VMs, Patroni high-availability clusters, and databases managed by Kubernetes operators, as long as the replication protocol is available. Fully-managed cloud databases that disable the replication protocol are not supported.

Storage backends include local files, S3, Google Cloud Storage, Azure Blob, SFTP, and SCP. Encryption uses AES-256-GCM, and the tool integrates with four cloud key management services: AWS KMS, GCP KMS, Azure Key Vault, and HashiCorp Vault. Content-aware deduplication reduces repository size without relying on incremental backup chains.

Getting started is designed to be fast. A one-liner install script or Homebrew handles installation. Running the demo command in Docker demonstrates the full backup and restore cycle without any existing configuration. An interactive menu mode offers numbered actions (set up, back up, restore, verify) instead of requiring you to remember every command flag. A Docker Compose stack with MinIO, Prometheus, and Grafana is also included for a fuller evaluation environment. The tool supports PostgreSQL versions 15 through 18 and is released under the Apache 2.0 license.

Where it fits