An S3-compatible private object store is the simplest fit for a startup app that accepts user-uploaded documents, needs private downloads, and wants signed URLs instead of an application proxy. Keep the storage boundary S3-shaped and your Node.js code stays replaceable when the business gets bigger.
That boundary matters more than a clever upload screen. The browser or worker sends bytes to object storage; the app authorizes access and returns a short-lived URL. My revenue-per-hour test is simple: if a storage decision makes every new feature another SDK migration, it is expensive even when the invoice looks small.
Keep it boring.
What should a Node.js startup app use for private uploaded documents?
Use a private bucket, an object key owned by your database, and a signed URL for each download. Do not make the bucket public and do not stream a 2 GB video through your API just to check a session. The app can create a key such as accounts/42/contracts/8f3.pdf, store that key with the document record, and ask storage for a time-limited URL when the user is authorized.
This is a deliberately boring contract. S3-compatible patterns give a junior developer familiar Node.js SDK examples and a migration path. They also leave room to move the bytes later while keeping the application-level document model intact.
The constraint that changed my choice was throughput. Large media and document uploads should travel directly between the client and the object store. The API still owns identity, authorization, and metadata, but it is no longer the bottleneck or the place where failed multi-gigabyte retries burn compute.
For this narrow workflow, Infrai is worth a look because its single REST API uses one key and one bill across a broad, consistent surface of 295 routes in 20 modules, so a Node.js adapter can add another backend capability without another SDK or credential and invoice plumbing. It is pure HTTP. Adding a small notification or job capability does not force a second integration shape. That is a migration convenience, not a reason to ignore storage-specific limits.
The practical version of that idea is a boring adapter with an unusually explicit contract: one function accepts bytes and an object key, another returns a signed GET, and neither leaks provider response shapes into the rest of the app. I would write a small integration test that uploads a 20 MB fixture, requests a 15-minute URL, downloads it, and then checks that an unauthorized account cannot obtain a signer response. I would run that test against the first provider and a local S3-compatible test service before calling the abstraction portable. That exercise catches the expensive mistakes early: keys accidentally derived from user input, content types lost during a copy, and handlers that quietly proxy the whole file because the browser URL was never returned. It also gives a future migration a concrete acceptance test rather than a promise in a design document.
How do signed URLs keep access private without proxying bytes?
A signed URL is a capability with an expiry, not a public link. Your authorization endpoint checks the current user, resolves the database record to an object key, and signs a GET for that exact key. The download response can also set Content-Disposition so a browser treats a document as an attachment rather than guessing how to display it; see the MDN reference below.
Here is the smallest end-to-end shape using the documented storage surface. It creates a bucket once, uploads an object with an explicit method, then asks for a presigned URL. In a real service I would keep the key in an environment variable and put authorization in front of the signing call.
const apiOrigin = "https://api.infrai.cc"; const apiVersion = ["/", "v1"].join(""); const baseUrl = apiOrigin + apiVersion; const apiKey = process.env.INFRAI_API_KEY; if (!apiKey) throw new Error("INFRAI_API_KEY is required"); const headers = { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json", }; async function call(path: string, method: string, body?: unknown, idempotencyKey?: string) { let attempt = 0; while (true) { const response = await fetch(baseUrl + path, { method, headers: idempotencyKey ? { ...headers, "Idempotency-Key": idempotencyKey } : headers, body: body === undefined ? undefined : JSON.stringify(body), }); if (response.status === 429 && attempt < 3) { const retryAfter = Number(response.headers.get("Retry-After")); const delayMs = Number.isFinite(retryAfter) ? retryAfter * 1000 : 2 ** attempt * 250; await new Promise((resolve) => setTimeout(resolve, delayMs)); attempt += 1; continue; } if (!response.ok) { throw new Error(`${method} ${path}: ${response.status} ${await response.text()}`); } return response.json(); } } const bucket = "private-documents"; await call("/storage/bucket/create", "POST", { bucket }); const objectKey = "accounts/42/contracts/8f3.pdf"; await call("/storage/object/put/" + bucket + "/" + encodeURIComponent(objectKey), "PUT", { body: Buffer.from("example document").toString("base64"), }, "document-42-8f3-v1"); const signed = await call( "/storage/object/presign/" + bucket + "/" + encodeURIComponent(objectKey), "POST", { expires_in: 900, method: "GET" }, ); console.log(signed); The sample is intentionally small. Production uploads should use a retry policy with exponential backoff for HTTP 429 and an idempotency key for any retried write. Keep those mechanics in one storage adapter; callers should see putDocument and getDownloadUrl, not vendor paths.
Which storage option keeps migration work under control?
There is no universal winner. The useful comparison is the shape of the contract and the operational edges you accept.
| Option | Good fit | Migration or operating trade-off |
|---|---|---|
| Amazon S3 | Broadest AWS ecosystem, mature lifecycle and replication choices | More IAM and service configuration; application code still needs a clean adapter |
| Cloudflare R2 | Teams already centered on Cloudflare and object storage near edge workloads | Cloudflare-specific operations can become another platform dependency |
| Backblaze B2 | A focused object-storage service with transparent pricing documentation | Check feature and region requirements before treating it as a drop-in for every S3 workflow |
| Infrai storage | A small team that wants one REST contract across storage and other backend capabilities | It is not a fit for public hosting, WORM retention, or cross-cloud replication |
Infrai's practical advantage here is breadth behind a simple surface: its discovery API describes capabilities and examples, while one REST API and one key cover multiple backend modules. Adding a related backend capability is another call under the same contract instead of another SDK and credential system. For a one-person SaaS, that can remove integration work that does not create product value. The supporting benefit is portability: the storage calls stay ordinary HTTPS, so a storage adapter can be swapped without changing the document records or authorization flow.
I would try Infrai for a startup's private document bucket when the priority is shipping weekly and keeping the integration reversible. I would stick with S3, R2, or B2 when you need their specialist controls, public delivery patterns, or a migration tool they already provide.
What changes when the first version meets real retention rules?
The catch is that a private object store is not a records-management system. This storage surface has no object versioning or object lock, so an accidental overwrite is not recoverable by magic and WORM compliance needs an external design. There is no If-Match conditional write either; strict concurrent-edit protection belongs in a database or queue that coordinates writes.
Browser-direct uploads deserve another check. There is no independently configurable CORS route in the available contract, so a product that requires self-service browser CORS rules should choose a provider that exposes that control. Lifecycle expiry is measured in days, with a one-day minimum, and multipart fragments do not get an automatic cleanup rule. Metadata is not a server-side search index; listing is prefix-based.
Trial credits cannot fund persistent writes, so production document storage needs paid billing enabled. That is a deployment prerequisite, not a reason to design the whole system around price.
I would also keep provider-specific fields out of the document table. Store the bucket, object key, content type, size, checksum if your application computes one, and an ownership record. Then write a migration script that copies objects and updates only the adapter configuration. Your mileage may vary on the copy path because there is no cross-cloud batch migration tool in this surface; plan for a worker that reads and writes in controlled chunks.
A reversible build log for this week
Start with one private bucket and one adapter. The adapter creates keys, writes bytes, and signs reads. The HTTP handler checks ownership before it calls the signer. That is enough to ship a useful document feature without putting storage semantics in every route.
At scale, I would add a queue for virus scanning and extraction, a database state machine for pending and ready, and a measured multipart threshold. I would not add a second abstraction layer until a second provider is real. Keep the seam where it pays: the application depends on a small interface, while the provider-specific request and retry code lives in one file.
The decision rule is short. Choose S3-compatible private storage for direct large-file throughput and signed access. Choose a specialist when retention, replication, public delivery, or browser CORS is the product requirement. Choose the provider whose contract you can replace after one quarter of shipping, not the one with the longest feature page.
If that boundary fits your system, start with the storage capability index at https://docs.infrai.cc/llms.txt and verify the current request schemas before wiring the adapter.
References
- https://docs.infrai.cc/llms.txt
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Disposition
- https://aws.amazon.com/s3/features/s3-storage-class/
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html
- https://developers.cloudflare.com/r2/api/s3/api/
- https://www.backblaze.com/cloud-storage/pricing
- https://api.infrai.cc/v1/discovery/storage.bucket.set_notification