Short answer: use browser-to-object-storage uploads with short-lived, tenant-scoped capabilities, then make the completion record the source of truth. The cheapest quote is irrelevant if a carrier can read another tenant's delivery footage, or if a retry creates two objects that the retention job cannot reconcile.
The page usually arrives later than the failure. An on-call sees a queue of media-processing jobs growing, a customer-facing upload marked complete, and a spike in objects with no matching shipment record. The first instinct is to inspect the worker. I start one step earlier: which tenant was allowed to mint the upload capability, which key was accepted, and which event proved that the bytes were complete?
It fails loudly.
No guesswork.
Which object storage service fits browser file uploads with presigned URLs?
For a logistics platform, a browser upload is a small distributed transaction. A dispatcher selects a shipment, a driver records a short video, and the browser sends a large object without making the application proxy every byte. The application still owns authorization and metadata. Storage owns the bytes. A worker later validates, indexes, and applies retention.
That division gives us a useful answer to a common question: the right service is the one whose isolation and operational behavior fit the workload, not the one with the lowest advertised storage rate. A presigned URL is a bearer capability. Anyone holding it can usually attempt the operation it represents until it expires, so its scope and lifetime deserve the same review as an access token.
The first alert should test a relationship, not a single HTTP status. For example, alert when the count of accepted upload-completion messages without a corresponding object-validation result stays above a small, workload-specific threshold for several minutes. A second signal can watch upload attempts rejected because the tenant in the request does not match the tenant encoded in the capability.
Those two signals describe different failures. The first is a pipeline lag or lost event. The second is an authorization defect, a client bug, or an operator using the wrong account. Combining them into one success ratio hides the distinction that matters during an incident.
A page with no tenant dimension is not actionable. Every metric and log entry needs a stable tenant identifier, shipment identifier, upload identifier, and object key fingerprint. Do not put a raw capability in a log. It is a credential, and log retention is wider than most engineers remember.
The useful alert annotation is a small chain of facts: tenant, upload identifier, current state, object presence, and age since the last transition. That lets the responder distinguish a browser that never finished from a worker that finished validation but failed to publish its result. It also limits the first investigation to records that can be safely replayed. A dashboard that only says “uploads are failing” sends the responder hunting through application, queue, and storage graphs with no shared identifier. That is how a five-minute signal becomes an hour of speculation.
How do five boundaries prevent cross-tenant damage?
I use five boundaries because each one answers a different question. They are policy checks, not a particular storage product's feature list.
- Identity boundary: the application authenticates the user and resolves the tenant from server-side membership data. The browser does not get to choose the tenant by sending a trusted-looking header.
- Capability boundary: the application mints a short-lived upload permission for one object, one operation, and one tenant namespace. The object name is generated by the server; shipment labels are metadata, not a path-construction API.
- Byte boundary: the storage policy limits which key prefix and content constraints the capability can use. A tenant identifier in a URL is useful for routing, but it is not isolation by itself.
- Record boundary: the application writes an upload intent before handing the browser a capability. Completion changes that intent through an idempotent state transition; it does not create an unrelated row from client-supplied JSON.
- Lifecycle boundary: deletion, retention, quarantine, and legal holds operate from the authoritative record and an inventory of objects. A missing record must be visible as an exception, not silently swept away.
The order matters. Authorization comes before signing. Recording intent comes before upload. Validation comes before publication to downstream consumers. This makes retries boring, which is exactly what an SRE wants at 03:00.
A practical key might contain an opaque tenant identifier, a generated upload identifier, and a date partition. It should not contain a driver name, phone number, or externally guessable shipment number. Key entropy reduces accidental collision and makes enumeration harder, but it does not replace authorization.
The completion handler must be idempotent. A browser may retry after losing the response; a queue may deliver a message twice; a worker may restart after persisting its result but before acknowledging the message. Store a unique upload identifier and accept the same completion again only when its immutable fields agree. If the size or checksum changes, quarantine the object and raise an operator-visible conflict.
I initially treated retries as a client concern. The operational concern is the second object that survives after the client has stopped caring.
Where does the alert trace lead backwards?
Imagine the page: unvalidated_uploads{tenant="acme"} is climbing, and the media queue age is 18 minutes. The application says the upload succeeded. The storage listing contains the object. The worker has no validation result.
Work backwards. First compare the upload intent, object metadata, and completion event using the upload identifier. If the object exists but the event is absent, inspect the browser completion path and the outbox that should publish the event. If the event exists but the worker has not claimed it, inspect queue lag and consumer leases. If the object is absent, inspect the capability issuance and the browser's final response rather than retrying blindly.
This is where a cheap direct-upload design often becomes expensive operationally. A retry can create a second object if the object name is generated on the client or if a new capability is minted without retaining the original upload identifier. Two objects may both look valid, while only one is attached to the shipment. The storage bill is a minor symptom; the real cost is ambiguous evidence in a delivery dispute.
I instrument the path with four timestamps: intent-created, capability-issued, upload-completed, and object-validated. Their differences make the alert explainable. Add counters for capability denials, completion conflicts, validation failures, and objects found without an intent. Keep the labels bounded. A label for every object key will turn a useful metric into a memory problem.
A Go interface keeps the application code honest about what it needs from storage:
type UploadIntent struct {
ID string
TenantID string
ObjectKey string
MaxBytes int64
MimeType string
}
type ObjectStore interface {
IssueUpload(ctx context.Context, intent UploadIntent, expires time.Duration) (string, error)
Head(ctx context.Context, key string) (ObjectInfo, error)
}
func issue(ctx context.Context, store ObjectStore, intent UploadIntent) (string, error) {
if intent.TenantID == "" || intent.ObjectKey == "" || intent.MaxBytes <= 0 {
return "", errors.New("invalid upload intent")
}
return store.IssueUpload(ctx, intent, 10*time.Minute)
}
The interface deliberately does not expose a general-purpose bucket client to request handlers. It makes expiry, object scope, and the later metadata check visible at the boundary. The concrete adapter can use a standards-compatible object store, but the policy remains application-owned.
Which storage decision survives a noisy month?
I evaluate candidates against a worksheet rather than a price table. For each tenant, record expected object size distribution, concurrent uploads, retry behavior, geographic placement, deletion deadline, audit requirements, and the blast radius of a credential mistake. A service that is inexpensive for bytes but awkward for tenant-specific policy may be a poor fit for this workload.
The important questions are operational. Can the system enforce a maximum object size before accepting the upload? Can it constrain the capability to a single key and operation? Can the application verify checksum or size after the upload? Are lifecycle rules observable and testable? Can access logs be correlated with the upload identifier without exposing secrets? What is the recovery process when an object exists without a record?
Test the boundary, not just the happy path. A useful test matrix includes an expired capability, a capability reused for a different key, a tenant attempting another tenant's prefix, a body larger than the declared limit, a duplicate completion, a missing object, and a deletion racing with validation. Run these tests against the actual adapter in a disposable environment. Mock tests are still useful for state transitions, but they cannot prove a policy enforced outside the application.
There is a trade-off here. More restrictive capabilities and more post-upload checks add latency and implementation work. I accept that cost for media tied to shipments because isolation failures are harder to contain than a slow upload. For low-value, public assets, the decision could be different; the data classification should drive the control strength.
Cache behavior also belongs in the design review. Upload responses, status documents, and error responses should have explicit cache directives so an intermediary cannot replay a tenant-specific result to another browser. Cache-Control describes how caches may store and reuse responses; it is not an authorization mechanism, but an ambiguous policy can turn a correct authorization check into a confusing client-side incident.
What does a quiet recovery look like?
A good recovery procedure starts with the upload identifier. Locate the intent, its object key, the object metadata, the completion events, and the validation result. Do not delete an orphan merely because it lacks a row; first check whether the database transaction or event publication is delayed. Quarantine uncertain objects, preserve the audit trail, and make the reconciliation job safe to run again.
The reconciliation job should report counts by reason: missing object, object without intent, duplicate completion, failed validation, and expired intent. It should emit a bounded alert and produce a reviewable list. A job that silently fixes everything is difficult to trust, especially when retention or legal hold is involved.
The false-positive cost matters too. If the threshold is too low, an ordinary dispatch-time burst wakes the on-call and teaches the team to ignore the page. If it is too high, a tenant-isolation defect can sit behind a healthy-looking aggregate. Calibrate against the normal upload-to-validation distribution, then review the threshold after a real traffic change. The alert should point to a bounded investigation, not merely announce that a graph moved.
The decision rule is straightforward: select the storage arrangement that makes tenant scope explicit, retries idempotent, lifecycle behavior observable, and recovery reversible. Treat byte price as one input among those controls. In a logistics system, predictable evidence beats a deceptively cheap upload path.
Further reading
- MDN,
Cache-Controlresponse header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control - RFC 9110, HTTP Semantics: https://www.rfc-editor.org/rfc/rfc9110
- OWASP File Upload Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/File_Upload_Cheat_Sheet.html
- W3C Trace Context Recommendation: https://www.w3.org/TR/trace-context/
Top comments (0)