Presigned URLs and direct upload
We move large bytes directly between the client and storage while the application controls permission. Delegated upload access must be narrow enough that a leaked capability cannot change unrelated objects. We will calculate transfer cost, constrain signed requests, bound expiration, and recover interrupted sessions.
#Section 9Why the application should not proxy every video
Heron’s illustrative video is 5,000,000,000 bytes. If the application receives it and forwards it, the application path handles 10,000,000,000 payload bytes across ingress and egress. A small 2,000-byte control exchange is a different workload. Their ratio is 5,000,000 in this simplified byte-count exercise.
At an illustrative direct transfer rate of 10,000,000 bytes per second, upload takes 500 seconds. If the application-proxied bottleneck is 2,000,000 bytes per second, it takes 2,500 seconds. These are assumed link rates, excluding setup, retransmission, storage work, and protocol overhead.
The application creates a pending record, reserves an object identity, and returns delegated access. The client then uploads bytes to storage. Completion returns through the application so it can verify that the reserved upload met its constraints. The absence of payload proxying does not remove ownership, validation, or quota checks.
#Section 10Presigned URLs delegate a specific operation
A presigned URL is a request whose authorization parameters are signed by an identity with permission to perform the operation. The holder can use that delegated operation while the signature and underlying authority remain valid. It is a capability and should be handled as a secret during its usable lifetime.
For Heron, reserve a private unique upload key and sign only the required method and resource. Bind supported required headers, checksum, or content constraints when the chosen API permits them. Do not give a client general bucket credentials or a reusable key for overwriting another user’s published clip.
S3 presigned URL documentation explains expiration and authority constraints. Presigned access is not inherently single-use. Repeated use may overwrite or repeat the permitted operation under its actual object rules, so immutable identity and state validation still matter.
#Section 11Expiration follows the underlying credential
Heron requests an illustrative 3,600-second URL lifetime, but the signing temporary credential has only 1,200 seconds remaining. The delegated authorization cannot outlive the required underlying credential. The simplified effective lifetime is the smaller value, 1,200 seconds, subject to other policy restrictions.
A 5,000,000,000-byte transfer at the assumed direct rate takes 500 seconds. Against an illustrative 600-second upload planning budget, that leaves 100 seconds. A URL expiring before the expected retry horizon can cause a partial upload to need fresh delegated access rather than forcing the client to discard all progress.
Do not claim that every ongoing transfer is terminated exactly at its signed expiration. Check when the service validates the request and what happens to a reconnect after expiration. Multipart transfers make this clearer: individual part requests can obtain fresh scoped signatures while preserving the same upload session.
#Section 12Initiate, upload, verify, publish
The client obtains upload access but closes the tab halfway through. The database must not treat initiation as a playable clip. Use a state machine such as pending, uploaded, verified, processing, and published, with failed or expired states where necessary.
Initiation records ownership and expected content constraints. Upload completion confirms storage state under the reserved identity. Verification checks length, checksum type and value, and required inspection. Processing creates derived immutable objects. Publication changes the database pointer only after its required objects and facts are ready.
Make each transition idempotent under its upload identity. A duplicate completion call should recover the same state rather than start duplicate conversions or create duplicate metadata. Retain unfinished reservations long enough for recovery, then reclaim them through a safe cleanup rule.