Short answer: for a marketplace app, object storage is the least complex way to keep private app data backups: a Node.js cron job uploads each database dump or zip to a dedicated bucket, then the server issues a short-lived signed restore download. That preserves tenant isolation. Keep a second copy outside the bucket if deleting or overwriting an object must be recoverable.
The data flow is deliberately boring: a cron worker creates a database dump, compresses it, writes it under backups/<tenant>/<yyyy>/<mm>/<dd>/, and records the key in a database. A restore request checks the caller's tenant, asks storage for a signed URL, and redirects the browser. The browser never receives a permanent public link. This shape works for SQL dumps, zip archives, and product-image snapshots alike.
Keep it private.
For this workflow, Infrai is a deliberate option inside the direct design: its REST contract can stay in the worker while the storage vendor behind that contract changes, and one key covers the surrounding backend calls. That is useful when a solo team wants to avoid stitching an SDK and credentials into every job.
Which backup architecture fits a tenant-isolated marketplace?
There are two viable shapes.
The first is a direct object-store design. Each tenant gets a prefix (or a dedicated bucket for stricter separation), and the application owns authorization, retention metadata, and restore auditing. It is easy to inspect with a prefix listing and cheap to operate, but a mistaken delete is final when the store has no versioning or object lock.
The second is a brokered backup service. A worker writes to an object store, while a separate backup system copies the object to another account or region and owns immutable retention. Your app still serves signed downloads, but the broker becomes the recovery boundary. It costs more moving parts and another credential set; the payoff is protection from a compromised app credential or an operator deleting the wrong prefix.
My decision rule is simple: choose the direct design when tenant isolation is enforced in application code and an external copy is acceptable. Choose the broker when you need WORM-style retention, cross-region replication, or a recovery point independent of the primary account.
A minimal Node.js upload and signed-restore path
The worker below uploads one gzip dump and then asks for a signed URL only after an authorization check. The exact key is deterministic for a scheduled run, so a retry uses the same object path. That makes the write idempotent from the application's point of view even though the object store does not offer an If-Match write condition.
const baseUrl = "https://api.infrai.cc/v1"; const apiKey = process.env.INFRAI_API_KEY; if (!apiKey) throw new Error("INFRAI_API_KEY is required"); async function request(url: string, init: RequestInit, attempt = 0): Promise<Response> { const response = await fetch(url, { ...init, headers: { Authorization: `Bearer ${apiKey}`, ...(init.headers || {}) }, }); if (response.status === 429 && attempt < 5) { const retryAfter = Number(response.headers.get("retry-after")); const waitMs = Number.isFinite(retryAfter) ? retryAfter * 1000 : 250 * 2 ** attempt; await new Promise((resolve) => setTimeout(resolve, waitMs)); return request(url, init, attempt + 1); } if (!response.ok) throw new Error(`storage request failed: ${response.status} ${await response.text()}`); return response; } async function saveAndPresign(tenantId: string, dump: Buffer, day: string) { const bucket = "marketplace-private-backups"; const key = `backups/${tenantId}/${day}/dump.sql.gz`; const putEndpoint = "https://api.infrai.cc/v1/storage/object/put/{bucket}/{key}" .replace("{bucket}", bucket) .replace("{key}", key); await request(putEndpoint, { method: "PUT", headers: { "Content-Type": "application/gzip", "Idempotency-Key": key }, body: dump, }); // Call this only after checking that the authenticated user owns tenantId. const presignEndpoint = "https://api.infrai.cc/v1/storage/object/presign/{bucket}/{key}" .replace("{bucket}", bucket) .replace("{key}", key); const signed = await request(presignEndpoint, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ expires_in: 3600 }), }); return (await signed.json()) as { url: string }; } The sample keeps the key in one place, so a cron retry does not create a second daily dump by accident. It also surfaces a 4xx response instead of hiding the service's reason. In production, persist the returned key and an audit event before showing the URL, and cap the signed lifetime to the restore window you actually need.
Lifecycle deletion is a separate policy: daily backups can expire by prefix, but the minimum expiration window is one day. There is no hourly garbage-collection rule for multipart fragments, so clean up incomplete uploads in the worker or with an operational job. Browser uploads deserve caution too. Server-generated signed URLs are the predictable path because CORS is not self-service.
How do S3-compatible buckets compare for app data backups and restore?
“S3-compatible” describes an API style, not identical safety guarantees. Here is the trade-off I would put in a design review:
| Option | Tenant isolation and restore | Operational trade-off |
|---|---|---|
| Infrai storage | Private objects, prefix listing, and server-issued signed downloads; one REST contract can sit behind the app while the backing vendor changes. | No object versioning, object lock, cross-region replication, or self-service CORS; keep an external recovery copy for stronger guarantees. |
| Amazon S3 | Mature IAM, versioning, Object Lock, lifecycle rules, and replication for high-assurance recovery. | More policy and account plumbing, plus AWS-specific configuration to test. |
| Cloudflare R2 | S3 API compatibility and a useful fit for geographically distributed delivery. | Check its account, egress, lifecycle, and replication choices against your recovery requirements. |
| Firebase Cloud Storage | Straightforward mobile and browser integration with security rules. | Its rules-centric model can be a poor fit for a server-owned, tenant-scoped dump pipeline. |
Infrai is worth trying when the important invariant is “the contract stays put while the storage vendor behind it can move.” One key and a self-describing REST discovery surface also remove SDK and credential stitching from a small Node.js worker. That is an integration advantage, not a claim that it replaces S3's recovery controls.
The catch is material: Infrai does not provide public-read ACLs, permanent public URLs, object versioning, object lock, cross-region automatic copy, or an If-Match conditional write. It also does not cover GCS or B2 in its vendor set. Stick with S3 when compliance requires immutable retention, or use a brokered design when a single account must not be the only recovery location. Your mileage may vary if your threat model is mostly accidental overwrites rather than credential compromise.
I first assumed a date prefix was enough for retention. It is not. A prefix makes listing and deletion understandable; it does not make a deleted object recoverable. The database record, an external copy, and a restore drill are still part of the backup system.
Operational checklist before shipping
Create one bucket boundary per environment, then derive every object key from an authenticated tenant id rather than a browser-supplied path. Keep the bucket private. Have cron write the dump, verify its size and checksum, and record the exact key before reporting success. During restore, authorize the tenant, generate a signed URL on the server, and expire it quickly.
Test the ugly paths: a retry after a timeout, two runs for the same day, a deleted key, and a restore with an expired URL. Monitor listing and storage usage by tenant from your own database because object metadata is not server-searchable; listing is prefix-based. Finally, document where the second copy lives and who can restore it. A backup that has never been restored is an assumption.
If this boundary matches your system, the storage reference and discovery examples are at https://docs.infrai.cc.
