Skip to content

CASE STUDY · SIBIYON PRODUCT

Haviez Backup

A backup marked green is not necessarily a backup you can restore. This tool exists because the difference only shows up on your worst day.

KIND
Our own product
WHAT IT BACKS UP
Apps running on Docker
COPIES
Server disk, Telegram, laptop
STATUS
Live, in our own use

The green tick that lies

Almost every backup tool stops at one question: was the file created? If so, the status is green, and nobody asks again for months.

The question that actually matters never gets asked: if this file were restored right now, would it come back whole? You find out on the day there is no other option left — which is the wrong day to find out.

Row counts taken inside the same transaction

While it takes the database dump, the agent also counts the rows in every table. The decisive part is the word “while”: the counting happens inside the same transaction snapshot as the dump.

Counted a few seconds before or after, the numbers can drift because transactions landed in between, and a verification built on them means nothing — it would go red on a healthy backup, or worse, go green on a broken one.

That count is stored attached to the backup. Later, when the copy is restored, the restored row counts are compared against it. An exact match, or it does not pass.

An app page in Haviez Backup: a 3-2-1 copies card, a run duration chart, and the automatic restore drill result.
One app. Three copies in three places, charts for how long each run took and how much genuinely new data was added after deduplication, then the latest restore drill — which in this shot happens to have failed, and that is exactly how it should look.

The restore drill runs itself, every week

Every Sunday in the small hours, unprompted, the agent restores the latest snapshot into a throwaway database, matches its row counts against the numbers recorded at backup time, and deletes the database again.

No human has to remember. If the counts do not match, the alert arrives on a quiet Sunday rather than on the Tuesday when the database is already gone.

Three copies, two media, one off the server

The first copy lives on the server's own disk: incremental, compacted by deduplication, encrypted. Fast to reach for, but it dies with the server.

The second is sent off the box, into a private Telegram channel. The choice sounds odd until you hear the reasons: free, generous in capacity, outside the hosting provider's control, and already encrypted before it leaves. Each set is split into parts with a manifest pinned in the channel, so a server rebuilt from nothing can find the latest set with no records to hand beyond the repository password.

The third copy is pulled down to a laptop. It is the only copy that cannot be deleted by anyone who manages to get into the server.

The restore page in Haviez Backup, listing apps and a drill history showing both passes and failures.
The restore page. The history shows passes and failures side by side; hiding the failures would remove the only reason this page exists.

Restoring is made hard to do wrong

Someone restoring a database is usually panicking. The interface is designed for a person in that state, not for someone calmly reading documentation.

So a restore never writes over production by default. The default is to restore into a temporary database, verify it, then delete it automatically after 24 hours. Production stays untouched until the person is genuinely sure.

Overwriting production is still possible, but it has to be paid for: typing the app's name, entering an admin password and a 2FA code, and — where there is more than one admin — approval from another one. Before the overwrite, a safety snapshot is taken automatically, so that even a decision made in a panic can still be undone.

The app list in Haviez Backup with columns for server, status, data sources, last backup and the 3-2-1 copies.
The app list. One row per app, with its data sources, when it last succeeded, when it runs next, and the three 3-2-1 copies as three icons that are either lit or not.

One dashboard, many servers

Applications do not all live in one place. Agents on other servers connect outward to the central dashboard rather than the other way round — so no port needs opening on any server, and no new address needs defending.

If the centre goes down, the agents elsewhere keep to their schedules and keep sending their own alerts. A dashboard going dark must not take the backups with it.

What is proven, and what is not

Proven: restores from the on-disk copy and from the Telegram archive both succeeded in production, with row counts matching exactly the numbers recorded when the backup was taken. Not proven: this tool has never yet been used to recover from real damage. Until that day comes we have no figures on how much time it saves — and we would rather keep it that way.

Screenshots are from a local test installation; the app names shown in them are invented. The warnings and failures visible in these images are real, not staged — that is how it looks when something is wrong.

BUILT ON

  • Go
  • SQLite
  • restic
  • rclone
  • Docker
  • Telegram Bot API
  • Cloudflare Tunnel

All work

Let's build something worth running

Tell us what you are trying to build or monitor. We will be straightforward about whether we can solve it, and how we would approach it.

Tell us about your project

No commitment. We reply personally within 1–2 business days.

WhatsApp