A good object storage service that supports pre-signed URLs can keep secure user file upload and download out of your application server: issue short-lived signed requests, and choose storage by the largest backup you must move, not by the upload demo that looks nicest. For a property-management system, that means the avatar upload and the nightly per-tenant backup can share a security model while using different throughput limits.
Start with the transfer boundary.
Keep it bounded.
The useful boundary is this: your API authenticates a person and decides which object they may touch. Object storage moves the bytes. A signed URL carries that decision to the browser or backup worker for a limited operation and time window. The URL is a capability, so logs, referrers, browser history, and copied tickets deserve the same care as credentials.
For a concrete restore test, use the same selected snapshot and vary only the number of concurrent parts. Start at one, then try a small fixed ceiling such as four or eight. Record the complete restore duration, not just the fastest individual request, because a restore that finishes one minute sooner but starves six other tenants is a scheduling failure. Watch memory on the worker, open connections, checksum time, and the queue behind the active restore. An interrupted transfer should resume from verified parts rather than restart the entire object. This is where a storage service's large-file behavior becomes an operational decision instead of a feature checkbox.
| Option | Signed request shape | Pick this when | Main throughput question |
|---|---|---|---|
| Amazon S3 | Presigned URL for a specific request | Your platform already speaks the S3 API | Can multipart upload and range reads match the backup sizes? |
| Google Cloud Storage | Signed URL for a bounded method and resource | Workloads and identity controls are already in that cloud | Which signed-request limits apply to your client and object layout? |
| Azure Blob Storage | SAS token scoped to resource and permissions | The rest of the estate uses Azure Blob APIs | How will SAS scope and parallel block upload affect restore time? |
| S3-compatible self-hosted storage | Presigned S3-style request | You operate the storage and network path | Can the cluster and disks sustain concurrent tenant restores? |
Which object storage service supports pre-signed URLs for tenant backups?
For a user avatar, a single signed PUT or POST is usually enough. Validate the declared content type and maximum size before issuing it, then let the browser send the bytes directly. A backup is a different animal. It can be large, interrupted, and restored while other tenants are active. Pick a protocol with resumable or multipart behavior, a way to verify each part, and range reads for restartable downloads.
Amazon S3, Google Cloud Storage, and Azure Blob Storage all expose signed access mechanisms, but the mechanism is not the architecture. Presigned URLs are request-specific in the S3 model; Google Cloud Storage signed URLs bind a method and resource; Azure SAS expresses permissions and scope in a token. Those differences change the adapter code and the audit fields, not the core rule: the API authorizes metadata, while the client transfers data.
I would record the largest expected object, the number of simultaneous restores, and the restore deadline before comparing providers. A 20 MB avatar test tells you almost nothing about a 40 GB tenant export. That is the trap.
What should the Node.js flow actually authorize?
Use an opaque object key, not a user-supplied filename. Keep tenant identity, snapshot ID, size, checksum, and lifecycle state in the database. The storage key is an implementation detail; the database row is the authority.
Here is a deliberately small TypeScript-shaped interface. The storage adapter can wrap S3-style signing, a cloud SDK, or an internal service without leaking provider fields into the rest of the application.
type SnapshotState = 'pending' | 'complete' | 'restoring' | 'failed';
type Snapshot = {
id: string;
tenantId: string;
objectKey: string;
bytes: number;
checksum: string;
state: SnapshotState;
};
type SignedTransfer = {
url: string;
method: 'PUT' | 'GET';
expiresAt: string;
};
interface BlobGateway {
signUpload(input: {
key: string;
contentType: string;
maxBytes: number;
}): Promise<SignedTransfer>;
signDownload(input: {
key: string;
range?: string;
}): Promise<SignedTransfer>;
}
The request handler must load the snapshot by both tenantId and snapshotId. Checking the snapshot ID alone is an authorization bug waiting to happen. The upload signer should also refuse a second upload after the row becomes complete, unless an explicit replacement operation created a new version.
async function createSnapshotUpload(
gateway: BlobGateway,
tenantId: string,
snapshot: Snapshot,
contentType: string,
): Promise<SignedTransfer> {
if (snapshot.tenantId !== tenantId) {
throw new Error('snapshot is outside tenant scope');
}
if (snapshot.state !== 'pending') {
throw new Error('snapshot is not accepting an upload');
}
return gateway.signUpload({
key: snapshot.objectKey,
contentType,
maxBytes: 50 * 1024 * 1024 * 1024,
});
}
The 50 * 1024 * 1024 * 1024 limit is an example policy, not a universal recommendation. Set it from retention rules, backup format, and observed tenant sizes. The critical part is that the signed request has a narrower lifetime than the backup job's retry window, so a retry obtains a fresh capability instead of reusing an old one.
After the client finishes, do not trust a browser callback as proof that the object is usable. A worker should inspect the object metadata, compare size and checksum with the snapshot row, and transition the row to complete in one guarded update. Restore follows the reverse path: authorize the selected snapshot, create a short-lived download capability, stream or range-read the object, and record the result.
How do you measure large-file throughput without fooling yourself?
Measure the whole path. Include signing latency, time to first byte, sustained transfer rate, retry volume, checksum verification, and time spent waiting for a restore slot. Run the test with several tenants and with a deliberately interrupted transfer. Network bandwidth is only one part of the result; concurrency limits, disk layout, client memory, and cross-region distance can dominate it.
The useful dashboard has separate series for sign_request_ms, upload_bytes, download_bytes, transfer_seconds, retry_count, and restore_queue_depth. Add tenant ID as a controlled, privacy-safe dimension only where cardinality is bounded. Never put the complete signed URL in logs. Its query string is a bearer capability until expiration.
There is a practical trade-off here. More parallel parts can improve large-file throughput, but they also raise memory use, request counts, and the amount of work left after an interruption. A small tenant may prefer a single stream; a large restore may justify bounded concurrency. Test both paths against the same object size and network distance.
Alerts should describe an action. A rising restore queue asks someone to inspect worker concurrency or storage latency. A checksum mismatch asks for object metadata and the producing job. A spike in signed-download requests asks for access review. One generic “storage error” counter does not tell an on-call engineer which branch to take.
Limits worth accepting before rollout
Signed URLs do not replace authorization; they package a prior authorization decision. They do not prevent a permitted client from uploading bad bytes, so validation after transfer remains necessary. They do not make a slow network fast, and they do not remove the need for lifecycle cleanup of abandoned multipart uploads.
This design is a poor fit when the application must transform every byte synchronously before storage, or when the network path cannot sustain the selected concurrency. In those cases, a controlled ingest worker or a simpler single-stream workflow may be the better trade-off.
The clean design has a small control plane and a boring data plane: the API owns tenant policy and snapshot state; storage owns byte transfer; workers verify and restore; metrics show where time went. That division keeps avatar uploads convenient while giving large tenant backups the resumability, checksums, and operational evidence they require.
References
- https://vercel.com/docs/vercel-blob
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html
- https://cloud.google.com/storage/docs/access-control/signed-urls
- https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT
Top comments (0)