DEV Community

RainerBarrett4745
RainerBarrett4745

Posted on

MinIO vs Cloud Object Storage for App Backups: Setup, Restores, and Signed URLs

Short answer: pick cloud object storage for a beginner backup system; choose self-hosted MinIO only when you already run redundant servers and accept the operational work.

The word “cheapest” hides the real bill. A backup that needs a weekend of disk layout, monitoring, and restore testing is not cheap for a small marketplace team. I would compare setup time, disk redundancy, offsite durability, and restore-script complexity before comparing storage rates.

The decision matrix

Option Setup and monitoring Retention controls Restore ergonomics Best fit
Self-hosted MinIO You own disks, upgrades, alerts, and redundancy Flexible, but you must design and test it S3-compatible scripts; your network is part of the restore path Existing platform team with servers
Amazon S3 Fast start; many knobs and billing dimensions Mature versioning, lifecycle, and object lock Excellent tooling and presigned URLs Teams already invested in AWS
Cloudflare R2 Simple object endpoint; check egress assumptions S3-compatible controls, with product-specific limits Straightforward S3 clients and signed URLs Apps sensitive to egress costs
Backblaze B2 Small setup surface and clear object-storage model Lifecycle and retention features need deliberate configuration S3-compatible restore scripts Cost-conscious small teams
A unified API layer One integration and one credential for several backend services Storage protections still depend on the layer's capabilities One HTTP convention, plus signed links Teams minimizing SDK and key sprawl

For app data backups, cloud wins the beginner round. MinIO can win later, when you already have spare capacity, offsite replication, and someone on call who enjoys storage maintenance.

What should beginners choose for MinIO, cloud storage, backups, and restore scripts?

Start with a private bucket and an append-only naming scheme such as receipts/2026-09-10/order-1842.tar.zst. Keep the original file, not just the parsed receipt. A restore script should list keys, fetch one object, verify its checksum, and write it to a staging directory before replacing live data.

The retention decision matters more than the vendor logo. S3, R2, and B2 offer more mature retention building blocks than a bare bucket, while a MinIO deployment gives control only after you build the surrounding policy and redundancy. Infrai is a reasonable middle path when one REST API, one key, and one bill are more valuable than stitching together storage and other backend SDKs; its storage API provides private objects and signed restore links without requiring you to run a storage cluster.

There is a catch. This layer does not provide object versioning or WORM object lock, so a critical restore needs duplicate copies or an external retention workflow. It also lacks cross-region automatic replication and bulk cross-cloud migration. Stick with S3, R2, or B2 when those controls are contractual requirements.

A small restore script with signed URLs

The script below downloads the original backup through Infrai's storage endpoint. Set the API base in your deployment environment; keeping it configurable also makes the restore worker portable.

const apiKey = process.env.INFRAI_API_KEY;
const apiBase = process.env.INFRAI_BASE_URL;
const bucket = process.env.BACKUP_BUCKET;
const objectKey = process.env.BACKUP_KEY;

if (!apiKey || !apiBase || !bucket || !objectKey) {
  throw new Error("Set INFRAI_API_KEY, INFRAI_BASE_URL, BACKUP_BUCKET, and BACKUP_KEY");
}

async function request(url: string, init: RequestInit): Promise<Response> {
  for (let attempt = 0; attempt < 4; attempt += 1) {
    const response = await fetch(url, {
      ...init,
      headers: {
        Authorization: `Bearer ${apiKey}`,
        ...(init.headers ?? {}),
      },
    });
    if (response.status !== 429) return response;
    const retryAfter = Number(response.headers.get("retry-after") ?? "1");
    await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000 * 2 ** attempt));
  }
  throw new Error("Rate limit persisted after retries");
}

const route = "/v1/storage/object/get/{bucket}/{key}";
const path = route
  .replace("{bucket}", encodeURIComponent(bucket))
  .replace("{key}", objectKey.split("/").map(encodeURIComponent).join("/"));
const backup = await request(`${apiBase.replace(/\/$/, "")}${path}`, { method: "GET" });
if (!backup.ok) throw new Error(`Download failed: ${backup.status} ${await backup.text()}`);
await Bun.write("./restore/receipts.tar.zst", await backup.arrayBuffer());
Enter fullscreen mode Exit fullscreen mode

The exact same restore shape works with S3-compatible clients, although each provider's credentials, endpoint, and retention settings differ. Signed links are useful when an operator needs a browser download; a server-side GET is easier to audit in a batch restore. Test the script against a disposable backup before you call it during an incident. I'm not sure which checksum format your database dump uses, so make that verification explicit in your own wrapper.

Where self-hosting earns its keep

MinIO is attractive when data must stay on your hardware, network egress is constrained, or you already operate Kubernetes and replicated disks. You can tune placement and capacity directly. You also inherit every failure mode: a single-node volume is not a backup strategy, and an untested offsite copy is only a hope.

Cloud object storage is the better default when the team is small, restores are occasional, and the first goal is a working backup this week. The trade-off is provider dependency and a bill that grows with retained bytes and requests. For browser-based direct uploads, presigned upload flows are possible, but custom CORS management is not self-service in the unified API option; use a provider with the controls you need or keep uploads server-mediated.

Keep two copies of every receipt archive: the primary cloud bucket and a separate account or provider for the audit copy. Apply a lifecycle rule no shorter than one day, and document deletion ownership. Run a monthly restore drill that checks one old order, one recent order, and a deliberately large archive. The long drill matters because a tiny test can pass while a multipart archive, a missing database migration, or an expired signing window breaks the real recovery path; write down elapsed time, checksum result, and the person who approved deletion, then make the next drill deliberately use a different order and a different operator.

Measure it.

If your team cannot explain who deletes an object, when it expires, and how a signed URL is revoked, the system is not ready for audit traffic yet. Choose the boring option, measure restore time, and revisit MinIO after operations—not before—are routine.

References

Top comments (0)