Why I stopped restoring prod snapshots for local dev (and ran a scrubbed read‑only replica instead)

Restoring prod DB snapshots on laptops ate hours, risked leaks, and broke onboarding. I built a scrubbed, read‑only replica developers can query — here’s what I actually spent and where it still fails.

Written by: Arjun Malhotra

Laptop on a wooden desk with a coffee cup, notebook and code visible on the screen
Photo by Annie Spratt on Unsplash

It was 10:30 pm, my home Wi‑Fi was doing its usual tantrum, and a new hire pinged asking for a full DB restore so they could debug a production‑only report. The dump was 22 GB. Their hotspot had 4 GB left. I could hear the clock tick.

We’d been doing this dance for months: someone needs a copy of production, someone else grants S3 access, someone else runs pg_restore for an hour, then we scrub the most obvious PII and pray no secrets leak to Slack. It cost time, bandwidth, and patience. And because we were all human, something leaked eventually. One engineer once left a CSV in a public temp link for three hours. I don’t want to relive that night.

I stopped saying “okay” and built a different problem: a scrubbed, read‑only production replica that our devs can query over a tunnel. It didn’t fix every case, but it replaced 80% of local restores and eliminated the ridiculous GitHub‑paste‑of‑PII incidents.

What I wanted — and why restores failed

The solution I shipped (practical, cheap, and boring) I provisioned a small managed Postgres as a read replica of production and put a scrubbing pipeline between the replica stream and the dev endpoint.

Short version of what it looks like:

How much it cost me

So total: ~₹1,700–₹2,700/month. For our team of 10 devs that number bought us 20–30 hours/week of reclaimed time and one less panic about accidental leaks. If you have a bigger org, you’ll pay more; if you already use managed read replicas, this is mostly a copy+scrub job.

Why this actually made developers happier

The failure that taught me the most Three months in, we missed a production bug. It was a write path race condition that only happened when a particular field was non‑null with a specific pattern. Our scrubbing pipeline zeroed out that column for privacy. Because the replica was scrubbed and read‑only, nobody could reproduce the failure locally and we spent two days chasing a ghost until we discovered the scrub rule.

Two hard lessons:

Operational caveats I learned the hard way

When to still do a full restore

What I actually walked away with The replica didn’t replace all restores. It replaced the repetitive, time‑wasting, risky ones. For the cost of a daily coffee per developer (₹150–₹250/month), we removed the worst parts of prod snapshot chaos: slow restores, data leaks, and onboarding friction. But it also forced us to write stricter rules about what counts as “dev data,” and to accept that some bugs will always need a carefully controlled full snapshot.

Takeaway: if your team is still running ad‑hoc prod restores for routine debugging, build a scrubbed read‑only replica first. It’ll save hours and reduce privacy risk — but remember to keep a playbook for the few cases that genuinely need a full, writable snapshot.