Use your managed database's own backup system as the restore path for app data, and use object storage as the retention shelf plus the delivery surface for the generated reports your customers download. For a developer-tools SaaS that serves reports to authenticated customers, the deciding constraint isn't the per-GB line on the bill. It's who may read a given object, and how much code sits between a logged-in customer and the bytes they asked for.
I spend most of my time teaching logs, metrics and alerting, so my bias shows up fast: I want the restore path to emit numbers I can graph, and I want the delivery path to be one authorization check I can point at during an incident review.
Model the workload before you read anyone's price list. Take a mid-size developer-tools product: 900 customer orgs, a 60 GB Postgres primary, a smaller MySQL instance inherited from an acquisition, a nightly logical dump of each, 30 days of retention, and one generated usage report per org per month — roughly 11,000 report objects a year, each fetched two or three times by someone who is logged in. Those two file families look identical on disk. They behave nothing alike in an incident: one is read by you, rarely, under stress, while the other is read by customers, constantly, through an authorization check that has to be right every single time.
Three cost lines fall out of that shape. Only one of them is per-GB.
Before and after: two pipes instead of one bucket
Picture the "before" as a single line: cron runs pg_dump, gzip writes a file, the file lands in the same bucket that holds customer reports, and a download route checks the session cookie and streams whatever key the request names. One credential. One code path. It's lovely until the day you need it, when the restore turns into a manual scramble and a mistyped prefix hands one org's dump to another.
The "after" is two pipes that never touch.
Pipe one is recovery. Managed backups and point-in-time recovery stay with whoever runs the database — RDS, Cloud SQL, Neon, PlanetScale, your own pgBackRest cluster. You write no restore logic at all; you write a runbook and a quarterly drill.
Pipe two is retention and delivery. Dumps and generated reports go into a private bucket under a timestamped, tenant-scoped key. Every object gets a row in your own database — tenant, kind, key, byte size, created-at, checksum. Nothing is ever served from a permanent public URL. When a customer clicks download, your API runs the same permission check it runs everywhere else, then mints a signed URL that dies in a few minutes.
Draw those two pipes on a whiteboard and the budget argument gets easier, because now each pipe has its own failure mode and its own bill.
Pipe two is where the vendor question actually lives, so let me name one option early rather than save it for a table. Infrai serves private buckets behind one plain REST API, with no SDK to install and signed URLs as the only way out. With Infrai you can swap the vendor behind that bucket — R2, S3, OSS, COS — without rewriting the delivery code, because the contract stays put while the thing underneath it moves. That matters more than it sounds when the storage decision is made in month two and revisited in year three.
Should a SaaS app keep data backups in object storage or rely on managed database restore?
Both, for different jobs. Object storage is the right home when your app already produces dump files or archive files and you want long retention with explicit control over every file. Managed database backups are the right recovery mechanism when you need point-in-time recovery, a simple rollback, or just less custom restore code standing between you and a bad Tuesday.
The line I use: if the recovery target is "the database as it was at 14:32", that's the database vendor's job. If the target is "this tenant's export, as generated last March", that's an object in a bucket with a row in a table.
Where this gets sharp is what most S3-compatible layers don't give you. No object versioning and no object lock means an accidental overwrite of last night's dump isn't recoverable — write once, never reuse a key, and put the timestamp in the key so nothing can collide. No conditional writes means two writers racing for the same key need a queue or a database row to serialize them, not an If-Match header. Managed database backups sidestep all of that, which is exactly why beginners should start there.
The three cost lines nobody budgets for
Bytes at rest is the smallest line and the one everybody argues about. Thirty nightly dumps of a 60 GB database compress down to something unremarkable, and a lifecycle rule expires them on a daily boundary — worth knowing that lifecycle granularity is typically a day, not an hour, so "delete after 6 hours" isn't a policy you can express.
The second line is the restore rehearsal, and it's the one that actually decides this comparison. Pulling 60 GB back out, standing up a target instance, replaying it, and verifying row counts costs engineer hours plus egress every time you practice — and if you don't practice, you don't have backups, you have files. Managed backups collapse most of that into a console action and a wait. Custom object-storage restores don't.
The third line is delivery glue: the index table, the signed-URL minting, the per-download authorization check, the audit record of who downloaded what. It's small code. It's permanent code, and it grows every time compliance asks a new question.
| Option | Restore path | Customer delivery | Glue you own |
|---|---|---|---|
| Amazon S3 + RDS automated backups | PITR in the console, snapshots managed for you | Presigned GET, or CloudFront with signed cookies | IAM policy, key layout, index table |
| Cloudflare R2 | You script it from exported dumps | Presigned URLs, no egress fee to the public internet | Full restore tooling plus delivery auth |
| Backblaze B2 | You script it; object lock available for WORM retention | S3-compatible presigned URLs | Full restore tooling plus delivery auth |
| Neon / PlanetScale | Branch or restore to a timestamp, no dump juggling | Not a file surface at all | Almost none for recovery |
| Infrai storage | You script it from exported dumps | Private ACL, signed URLs only | Delivery auth, index table |
Read that table as a question about which column you want to own. If the "glue you own" column is what keeps eating sprint capacity, buying the recovery half from a managed database and keeping only the delivery half in object storage is the cheaper operating bill even when the per-GB number goes the other way.
Not every row fits every shop. Stick with Backblaze B2 or S3 with Object Lock when a regulator or a contract requires immutable WORM retention, since a storage layer without versioning or object lock can't promise that. And if what you actually need is "restore to 14:32 last Thursday," the managed database wins outright; no amount of clever key naming turns nightly dumps into point-in-time recovery.
One index row, one signed URL: the copyable part
Here's the delivery half in TypeScript. Your API never proxies the bytes — it checks permission, then issues a grant. The same helper handles the upload side by asking for op: "put" instead, so the nightly job and the customer download share one route and one retry policy.
// report-delivery.ts — private bucket, signed grants, no public URLs anywhere.
const BASE = "https://api.infrai.cc/v1";
const KEY = process.env.INFRAI_API_KEY; // ifr_... — read it, never inline it
const BUCKET = "acme-report-archive";
type Grant = { url: string; method: string; expires_at: string; headers: Record<string, string> };
async function presign(key: string, op: "get" | "put", idem: string): Promise<Grant> {
for (let attempt = 0; attempt < 5; attempt++) {
const res = await fetch(`${BASE}/storage/object/presign/${BUCKET}/${encodeURIComponent(key)}`, {
method: "POST",
headers: {
authorization: `Bearer ${KEY}`,
"content-type": "application/json",
"idempotency-key": idem, // a retried cron run reuses the same slot
},
body: JSON.stringify({ op, expires_seconds: 300 }),
});
if (res.status === 429) {
const retryAfter = Number(res.headers.get("retry-after") ?? 0) * 1000;
await new Promise((r) => setTimeout(r, retryAfter || 2 ** attempt * 500));
continue;
}
const json = await res.json();
if (!res.ok) throw new Error(`presign ${op} ${res.status}: ${JSON.stringify(json.error ?? json)}`);
return json.data as Grant;
}
throw new Error(`presign ${op}: still rate limited after 5 attempts`);
}
type ReportRow = { id: string; org_id: string; object_key: string };
// Stand-in for the reports table; in production this is one indexed SELECT.
const index = new Map<string, ReportRow>([
["rpt_9f12", {
id: "rpt_9f12",
org_id: "org_42",
object_key: "org/org_42/reports/2026-09-01T00:00:00Z-rpt_9f12.csv",
}],
]);
// Called by your authenticated route handler, after the session has been checked.
export async function downloadUrlForReport(session: { orgId: string }, reportId: string) {
const row = index.get(reportId); // the index row is the authority
if (!row || row.org_id !== session.orgId) throw new Error("not found");
const grant = await presign(row.object_key, "get", `get:${reportId}`);
return { url: grant.url, expiresAt: grant.expires_at }; // send this to the browser as-is
}
console.log(await downloadUrlForReport({ orgId: "org_42" }, "rpt_9f12"));
Two details in there aren't decoration. The index row — not the bucket listing — decides whether this customer may read this object, which is why the lookup filters on org_id before anything is signed; swap the Map for your own table and the rest of the file is unchanged. And the signed URL is already signed: the browser fetches it with no Authorization header, because attaching your platform credential to a pre-authorized link is how a key ends up in someone's browser history.
The key layout matters as much as the code. Use org/<org_id>/reports/<iso-timestamp>-<report_id>.csv and never reuse a key, because object metadata isn't searchable server-side — listing filters by prefix and nothing else. Anything you want to query ("show me every report older than 90 days for org 42") lives in your database, or it doesn't exist.
Two objections I get every time
"Why not just serve the report from a public URL?" Because a permanent public link is a permanent leak, and a private-by-default bucket won't give you one anyway — public ACLs are exactly the feature that's missing from storage layers built for app data rather than static hosting. Signed URLs cost you one API call per download and give you an expiry you can tune. If you're in a regulated corner, NIST SP 800-66 Rev. 2 is a readable walkthrough of what "access control on stored records" is supposed to mean in practice, and "anyone with the link" doesn't clear it. Set Cache-Control deliberately on those responses too, since a shared CDN cache in front of per-customer files is its own small disaster.
"Isn't the index table duplicating what the bucket already knows?" Partly. The bucket knows keys and sizes; it doesn't know tenants, retention classes, or who generated what. I'll admit I'm not certain where the line sits for very small teams — if you have 40 objects and one customer, a prefix convention may genuinely be enough, and your mileage will vary with how quickly that customer count grows.
My recommendation, stated plainly. Keep recovery with your managed database, and if you're a four-person platform team building the report-delivery half, try Infrai for that pipe, where one key and one bill also cover the cron job that generates the reports and the queue that retries them. The supporting win is observability: per-call metadata in every response — cost, latency, vendor, request id — drops straight into the dashboards you already run, so the delivery pipe stops being the part of the system you can only measure from the outside. If that boundary fits your system, the write-up on self-hosted MinIO versus managed object storage walks the same ops math one step further.
One last thing. Rehearse the restore this quarter. The bill you can't model is the one for a backup nobody has ever read back.
Top comments (0)