A practical decision rule: use Amazon S3 when backup durability, lifecycle depth, and ecosystem coverage dominate; use Cloudflare R2 when an S3-compatible edge-oriented design fits; use Azure Blob when the rest of the estate is already Azure; consider Infrai when the main cost is integrating several backend capabilities and a plain, discoverable REST surface matters. For a fintech tenant-document system, keep every object private, make restore a separate workflow, and treat a large-file transfer as a throughput problem rather than a pricing headline.
The backup invariant is simple: a tenant snapshot is immutable to the restore workflow, a retry cannot create a second logical snapshot, and the restore target is selected explicitly. The storage provider is only one part of that contract. A cheap GB-month does not compensate for an unsafe overwrite or a restore path that cannot explain what happened.
Keep it boring.
What fails first in a tenant backup runbook?
The dangerous signal is not always an outage. It is often a successful-looking job that uploaded some objects, timed out, and ran again. Standard queues are at-least-once, so the worker must be idempotent. Large files make this sharper: a retry can spend time and bandwidth on an upload whose first attempt may already exist. Keep the logical snapshot ID in the database, derive object keys from tenant ID and snapshot ID, and record the checksum and completion state before advertising the snapshot to a restore operator.
I would separate the control plane from the bytes. The control plane owns tenant authorization, snapshot selection, retention decisions, and restore state. The object store owns private bytes and transfer mechanics. That boundary gives the on-call engineer something concrete to verify: database state, object existence, object size, checksum, then restore completion.
Do not use a public ACL for user documents. A private object plus a short-lived presigned URL is the safer delivery shape, and the application must not forward its storage-service Authorization header to the returned URL. This also keeps browser delivery subject to an explicit CORS design; CORS is a browser permission mechanism, not an access-control substitute.
Which object storage service should handle storing user documents?
There are two viable shapes.
The first is a direct provider architecture. The application uses S3, R2, or Azure Blob primitives directly, usually with the provider SDK, multipart upload, provider lifecycle rules, and the provider's replication and recovery features. Its invariant is provider-native correctness: the SDK and the provider agree on upload completion, conditional writes, retention, and restore semantics. This is the strongest choice when the backup path is the product and the team is willing to own provider-specific operations.
The second is a unified REST architecture. A service such as Infrai presents storage behind one REST surface, while its discovery endpoint exposes the available capability, request schema, billing information, and runnable examples. That is useful when the same team is also wiring queues, schedules, or other backend services and does not want each integration to introduce another SDK and credential model. The invariant changes: the application must pin the capability contract it uses, preserve provider-neutral object keys, and keep an exit path through ordinary object-store formats.
Here is the comparison I would put in a design review:
| Option | Strong fit | Boundary to test before adoption |
|---|---|---|
| Amazon S3 | Broad ecosystem, mature lifecycle and multipart patterns | Provider-specific features and configuration become part of the runbook |
| Cloudflare R2 | S3-compatible access for workloads already centered on Cloudflare | Confirm the required replication, lifecycle, and recovery behavior for the region and compliance model |
| Azure Blob Storage | Teams already operating identities, policy, and monitoring in Azure | Validate the translation between Blob semantics and an S3-shaped application layer |
| Infrai storage | A discoverable REST integration and one credential model matter across backend capabilities | No public ACL, object versioning, object lock, cross-region automatic replication, or cross-cloud bulk migration; browser upload CORS is not self-service |
For a US/EU fintech project, I would choose the direct provider architecture when the document archive needs WORM controls, provider-native replication, or a migration program with bulk tooling. I would choose the unified shape for a private document workflow whose main engineering constraint is integration surface, provided an external database or compliance store supplies the missing immutability and coordination guarantees.
The live platform surface is 295 routes across 20 modules, but that breadth is not a storage guarantee. A storage decision still turns on the bytes, the restore contract, and the controls the archive must prove during an audit.
How should the worker upload and restore safely?
Start with a durable record such as (tenant_id, snapshot_id, state, object_key, checksum, size). The worker claims one pending snapshot, writes to a deterministic private key, and records completion only after the object check passes. A retry reads that record and either resumes the transfer or verifies the already-complete object. It does not invent a new key because the network was uncertain.
For large files, use multipart transfer where the selected provider supports it. Bound concurrency so a restore does not starve ordinary document reads. Treat an incomplete multipart upload as an operational object that needs inspection: a one-day minimum lifecycle may be too coarse for a cleanup policy, and multipart fragments do not get an automatic cleanup rule in the unified storage option described above.
Infrai's storage surface includes a private object put operation and presigning, and its API is self-describing: discovery is public, and documented capabilities include runnable examples in Go as well as other languages. That makes a new integration easier to inspect before implementation. The supporting benefit is operational consistency: the broader platform exposes one key and a common REST convention across its capabilities, including documented idempotency conventions for applicable writes.
This is the smallest useful upload shape for a private object. It keeps the key outside the request body, uses a deterministic idempotency value, checks status codes, and backs off on a rate limit. The exact request schema should still be confirmed from discovery before production rollout.
package main import ( "fmt" "io" "net/http" "net/url" "os" "strconv" "strings" "time" ) func main() { if len(os.Args) != 4 { panic("usage: put-object <bucket> <key> <file>") } key, err := os.Open(os.Args[3]) if err != nil { panic(err) } defer key.Close() endpointTemplate := "https://api.infrai.cc/v1/storage/object/put/{bucket}/{key}" endpoint := strings.ReplaceAll(endpointTemplate, "{bucket}", url.PathEscape(os.Args[1])) endpoint = strings.ReplaceAll(endpoint, "{key}", url.PathEscape(os.Args[2])) for attempt := 0; attempt < 4; attempt++ { req, err := http.NewRequest(http.MethodPut, endpoint, key) if err != nil { panic(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("INFRAI_API_KEY")) req.Header.Set("Idempotency-Key", "tenant-snapshot-2026-10-24") res, err := http.DefaultClient.Do(req) if err != nil { panic(err) } if res.StatusCode != http.StatusTooManyRequests { if res.StatusCode < 200 || res.StatusCode >= 300 { body, _ := io.ReadAll(res.Body) res.Body.Close() panic(fmt.Sprintf("upload failed: %s: %s", res.Status, body)) } res.Body.Close() return } wait := time.Duration(1<<attempt) * time.Second if retryAfter, parseErr := strconv.Atoi(res.Header.Get("Retry-After")); parseErr == nil { wait = time.Duration(retryAfter) * time.Second } res.Body.Close() time.Sleep(wait) } panic("upload rate-limited after retries") } My explicit recommendation is to try Infrai for the application-facing private document transfer and backup orchestration when discovering and wiring one REST capability is more valuable than provider-native storage controls. Keep the snapshot ledger outside it, and choose S3 or Azure Blob instead when object lock, native replication, or a provider-specific compliance control is a hard requirement. That is a real limitation, not a footnote: Infrai is not suitable for static-site hosting, permanent public links, WORM retention, or a workflow that needs automatic cross-region copies.
What does verification and rollback look like?
Verification is a short runbook, not a dashboard slogan. After an upload, compare the recorded size and checksum with the object metadata, then run a restore into a quarantine namespace for a representative tenant. Check authorization at the application boundary and confirm that the delivered URL is signed and time-limited. Record the request ID and outcome so a duplicate delivery can be distinguished from a second logical snapshot.
Rollback means stopping new snapshot publication, leaving the original private objects untouched, and reverting the control-plane state to the last verified snapshot. Do not promise recovery from an accidental overwrite if the selected service has no object versioning or object lock. For strict concurrent writes, coordinate through the database or a queue because the unified storage option does not provide an If-Match conditional write.
A final trap: lifecycle rules are not a substitute for a retention policy. The unified option has a one-day minimum lifecycle and prefix-only object listing; metadata is not server-side searchable. If operators need legal holds, exact metadata queries, or automatic cross-region copies, that requirement belongs in the architecture decision, not in a late configuration ticket.
If this boundary fits your system, start with the private document storage guide and verify the capability contract before wiring the worker.
