DEV Community

AnonymousDev
AnonymousDev

Posted on • Originally published at anonymouscoderdev.dev

Archon: A Zero-Config Database Backup Sidecar for Docker

Every developer knows they should back up their database.

Almost no one does it properly.

Not because they are lazy. Because doing it right is genuinely painful. You write a cron job, then forget to test the restore. You set up a script, then it silently fails for three weeks. You use a managed service, then get a bill you didn't expect.

The result: most projects run in production with either no backups, or backups that have never been tested and probably don't work.

Archon is my fix for this.


What it is

Archon is a database backup sidecar for Docker projects.

You add one block to your docker-compose.yml. That's it. No code changes to your application. No new infrastructure. No scripts to write or maintain.

archon:
  image: archon:latest
  volumes:
    - ./archon.config.yaml:/app/config.yaml
    - ./backups:/app/backups
  env_file: .env
  depends_on:
    postgres:
      condition: service_healthy
  restart: unless-stopped
Enter fullscreen mode Exit fullscreen mode

That's the only change to your stack.


What it handles

Archon runs as a separate container alongside your existing stack and takes care of the full backup lifecycle:

  • Scheduled backups (hourly, daily, weekly, monthly, or raw cron with timezone support)
  • AES-256 encryption at rest, toggled with one config line
  • SHA-256 checksum sidecar written with every backup, verified before every restore
  • Auto-retention with separate limits per rotation tier
  • Local, S3, and Azure Blob storage targets
  • Supports PostgreSQL, MongoDB, MySQL, and SQLite

The part most backup tools skip

Every backup gets a .sha256 sidecar file. Before any restore, Archon recomputes the hash and compares. If they don't match, corrupted file, partial download, accidental modification, Archon refuses to proceed.

A backup you can't trust is worse than no backup. It gives you false confidence and fails exactly when you need it most.


Granular row-level restore

Full database restores are the nuclear option. Sometimes you just need one table back, or ten rows. Archon supports row-level recovery: browse the backup without touching the live database, select rows, resolve foreign key dependencies automatically, apply with a conflict strategy of skip, replace, or merge.


Try it in 5 minutes

git clone https://github.com/AnonymousCoderDev/Archon.git
cd Archon/testing
docker compose up --build
Enter fullscreen mode Exit fullscreen mode

The testing/ directory is a fully self-contained environment with a real PostgreSQL database and seed data. Trigger a backup, simulate data loss, restore, verify. The full cycle in under 5 minutes.


Read the full post

The full write-up covers the complete config reference, the integrity pipeline, granular restore step by step, the full REST API, and the reasoning behind the sidecar architecture.

Full post: https://anonymouscoderdev.dev/archon-database-backups-that-just-work/

MIT licensed. No paywall. No sign-up.


Building in the dark. Knowledge is free.

Top comments (0)