<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Atomic Mango</title>
    <description>The latest articles on DEV Community by Atomic Mango (@operadev).</description>
    <link>https://dev.to/operadev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3894918%2Fcce1cef7-2eff-420c-a75e-21f86ddb2200.jpg</url>
      <title>DEV Community: Atomic Mango</title>
      <link>https://dev.to/operadev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/operadev"/>
    <language>en</language>
    <item>
      <title>How I built a tool that actually proves your backups work before you need them</title>
      <dc:creator>Atomic Mango</dc:creator>
      <pubDate>Thu, 23 Apr 2026 21:14:03 +0000</pubDate>
      <link>https://dev.to/operadev/how-i-built-a-tool-that-actually-proves-your-backups-work-before-you-need-them-4nol</link>
      <guid>https://dev.to/operadev/how-i-built-a-tool-that-actually-proves-your-backups-work-before-you-need-them-4nol</guid>
      <description>&lt;p&gt;body:&lt;/p&gt;

&lt;p&gt;Every developer has a backup script. Almost nobody verifies that the backup actually restores.&lt;br&gt;
I learned this the hard way. Not in a production emergency — but close enough to make me uncomfortable. The script ran, the file was there, the cron job was green. Everything looked fine. Until I tried to restore it in a test environment and it failed silently.&lt;br&gt;
That's the Schrödinger's backup problem: you don't know if your backup works until you open the box. And most people open the box during an emergency.&lt;br&gt;
So I built Database Guardian Pro to solve this properly.&lt;/p&gt;

&lt;p&gt;How it works:&lt;/p&gt;

&lt;p&gt;The core idea is simple: don't just save the dump, actually restore it.&lt;br&gt;
After every backup, the tool:&lt;/p&gt;

&lt;p&gt;Takes the dump file:&lt;/p&gt;

&lt;p&gt;Spins up an ephemeral Docker container with a clean database engine&lt;br&gt;
Injects the dump and forces a full restore&lt;br&gt;
Runs integrity checks — tables exist, data is readable&lt;br&gt;
Destroys the container&lt;/p&gt;

&lt;p&gt;If the restore fails, you get an alert on Discord or Slack immediately. If it succeeds, the backup is marked as valid. Not before.&lt;br&gt;
No residue. No impact on your host system. No assumptions.&lt;/p&gt;

&lt;p&gt;Why Docker:&lt;/p&gt;

&lt;p&gt;The whole point is isolation. You don't want the verification to touch your production database or your host filesystem. Ephemeral containers are perfect for this — they exist for the duration of the test and nothing else.&lt;br&gt;
Using the Docker SDK for Python made this straightforward. Spin up a container, run the restore, check the output, destroy it. The entire verification cycle takes seconds.&lt;/p&gt;

&lt;p&gt;It also monitors live database health:&lt;/p&gt;

&lt;p&gt;While I was building the backup verification, I added real-time monitoring for the databases themselves. It connects to MySQL, PostgreSQL, MongoDB, Redis and SQLite, checks connectivity and response times every 30 seconds, and streams status to a web dashboard via WebSocket.&lt;br&gt;
Alerts only fire when state changes — not on every check. No spam.&lt;/p&gt;

&lt;p&gt;What I learned building this:&lt;/p&gt;

&lt;p&gt;The hardest part wasn't the Docker integration. It was resisting the urge to over-engineer it. The first version had too many abstractions, too many config options, too much "enterprise" thinking for a tool that needed to be simple to set up.&lt;br&gt;
The version I'm happy with does two things well: it tells you if your databases are up, and it proves your backups actually work.&lt;/p&gt;

&lt;p&gt;The repo:&lt;/p&gt;

&lt;p&gt;The full source is on GitHub: &lt;a href="https://github.com/alberto35325/database-guardian" rel="noopener noreferrer"&gt;database guardian&lt;/a&gt;&lt;br&gt;
If you want the packaged version with Docker Compose, Grafana dashboards, and Nginx config, it's available on Gumroad for €10.&lt;br&gt;
&lt;a href="https://operao.gumroad.com/l/ytuyep" rel="noopener noreferrer"&gt;database guardian pro&lt;/a&gt;&lt;br&gt;
Happy to answer questions about the implementation in the comments&lt;/p&gt;

&lt;p&gt;A comment that pushed me to go further:&lt;/p&gt;

&lt;p&gt;After posting about the project on r/sideprojects, someone left a comment that stuck with me:&lt;br&gt;
"Curious in your setup — are you just checking integrity at backup time or also verifying restore paths regularly? Because that's where we saw most things quietly break."&lt;br&gt;
That was the question I hadn't fully answered yet. I was validating at backup time, but not running scheduled restore checks on older backups. Their team had seen backups that were technically completing but restoring outdated or incomplete data — because nothing was validating the full restore path end-to-end.&lt;br&gt;
That comment is directly why the tool now runs a weekly restore check on the most recent backup and a monthly audit on a random sample of the last 6 months. It was the right call and I wouldn't have thought to structure it that way without that nudge.&lt;/p&gt;

</description>
      <category>python</category>
      <category>docker</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
