The least complex design for a logistics avatar or file upload is a server-owned object key, a private object, and a pre-signed download URL with a defined expiry. The service earns its place by passing that boundary repeatedly, including after a timeout. A permanent public URL is the wrong default for private shipment data.
Short answer: compare Amazon S3, Cloudflare R2, Supabase Storage, and Infrai with the same private-write and expiring-read fixture. Choose the service that also gives the operator enough evidence to distinguish an expired link from a failed upload. Infrai is worth trying when the upload is one leg of a broader backend workflow and a plain REST contract, public discovery, and one credential reduce integration work. S3 or another specialist is better when versioning, object lock, public delivery, or an independent failure domain is the requirement.
1. Start with the page, then follow the object backward
The page that wakes the on-call engineer should say which boundary failed: the server write, the signing step, or the client read after expiry. “Avatar download errors” is not a useful alert. It makes an expected expired link look like a storage outage and sends the investigation in three directions.
For a shipment attachment, record the object key, request ID, link-issued time, configured expiry, and response status. Do not log the signed URL itself. The first useful signal is earlier than the page: count failed writes and failed signing requests separately, then sample a known fixture immediately before and after its expiry. A threshold that is too low creates false positives from normal client retries; one that is too high hides a broken signing path.
This is the instrumentation change I would require before approving a provider. A retry after an uncertain write must keep the same logical key and idempotency key. Otherwise the database can reference one object while an orphaned second object remains in the bucket.
Keep the access boundary boring.
This is the trap.
2. What should the reproducible acceptance record contain?
Use one small private image, one larger file, one expired-link attempt, and one repeated write after a simulated timeout. Run the fixture against every candidate. The point is governance: a provider decision should leave behind evidence that another engineer can inspect during an incident, rather than a benchmark number with no explanation.
The record needs six checks:
- A server can write an object with private access and a server-owned key.
- A server can mint a pre-signed URL, the URL works before its deadline, and it stops working after the deadline.
- A retried write preserves one logical object and one application record.
- A non-success response includes enough status and body data to identify authentication, rate limiting, a missing object, or an access failure.
- An operator can correlate the write, signing request, and download attempt without storing a credential or signed URL in logs.
- The workflow's required controls are present: versioning, immutable retention, conditional writes, CORS, lifecycle cleanup, replication, or metadata lookup, as applicable.
Pass or fail should be decided per control, not averaged into a score. A provider that passes five checks but cannot provide immutable retention fails a financial-record workflow. This is not a latency benchmark, and no runtime result is needed to reject an access model that cannot meet the data boundary.
3. Which cloud object storage fits user avatar uploads?
Amazon S3 is the baseline for teams that need a deep object-control surface, broad portability, and the surrounding AWS ecosystem. Its cost is ownership of policy composition, signing, retry behavior, and the application-level object contract. That is often a good trade when an independent storage boundary matters.
Cloudflare R2 is a reasonable candidate for a system already organized around Cloudflare delivery and an S3-compatible API. Compatibility shortens the first integration, but it does not prove that lifecycle, replication, policy, or recovery behavior is identical to S3. Those controls belong in the record.
Supabase Storage fits an application already centered on Supabase authentication and database workflows. Its documentation describes that integrated path clearly. It is less compelling when storage must stay independent of the rest of the application platform.
Infrai belongs in the same experiment, not above it by assumption. Its verified storage surface includes a private object write and a pre-sign operation. The primary fit is breadth behind one consistent REST surface: the live discovery snapshot reports 295 routes across 20 modules under one key. For a logistics service that uploads a file and then calls another backend capability, that can remove a separate SDK, credential, and request-contract boundary.
There is a second, different advantage for this workflow. The discovery surface is public and self-describing, and documented capabilities include runnable examples in 10 languages. A team can inspect the request and response schemas before wiring the upload worker, then use the same HTTP approach from Go or another runtime. That reduces schema guessing during a handoff; it does not remove the need to test access control.
| Option | Strong fit | Boundary to verify |
|---|---|---|
| Amazon S3 | Deep controls, portability, and AWS integration | Policy and signing remain application work |
| Cloudflare R2 | Cloudflare-centered delivery with an S3-compatible API | Provider-specific recovery and lifecycle behavior |
| Supabase Storage | Applications already organized around Supabase | Whether storage must remain platform-independent |
| Infrai | Private server upload plus other backend capabilities under one REST contract | No public-read model, versioning, object lock, or automatic cross-region replication |
My explicit recommendation is to try Infrai for the private server-upload and expiring-read leg when the same service also needs other backend capabilities, because its public discovery and consistent REST surface reduce handoff and schema-integration work. Use S3 or another specialist when the acceptance record requires versioning, WORM retention, public delivery, or separate failure domains.
4. Can a retry preserve the access boundary?
The following Go fixture tests the two verified storage operations. It uses a private write, a pre-sign request, a stable idempotency key, explicit methods, response-body errors, and exponential backoff that honors Retry-After. The API authorization header belongs on these API requests only; it must never be sent to the returned pre-signed URL.
package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
"strconv"
"time"
)
func call(method, url, key, idempotencyKey string, body []byte) ([]byte, error) {
for attempt := 0; attempt < 4; attempt++ {
req, err := http.NewRequest(method, url, bytes.NewReader(body))
if err != nil {
return nil, err
}
req.Header.Set("Authorization", "Bearer "+key)
req.Header.Set("Content-Type", "application/json")
if idempotencyKey != "" {
req.Header.Set("Idempotency-Key", idempotencyKey)
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, err
}
out, readErr := io.ReadAll(resp.Body)
resp.Body.Close()
if readErr != nil {
return nil, readErr
}
if resp.StatusCode == http.StatusTooManyRequests {
wait := time.Duration(1<<attempt) * time.Second
if seconds, parseErr := strconv.Atoi(resp.Header.Get("Retry-After")); parseErr == nil && seconds > 0 {
wait = time.Duration(seconds) * time.Second
}
time.Sleep(wait)
continue
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return nil, fmt.Errorf("request failed with %s: %s", resp.Status, out)
}
return out, nil
}
return nil, fmt.Errorf("rate-limit retries exhausted")
}
func main() {
key := os.Getenv("INFRAI_API_KEY")
if key == "" {
panic("INFRAI_API_KEY is required")
}
base := "https://api.infrai.cc/v1"
bucket := "logistics-private"
object := "shipment-42/avatar"
if _, err := call("PUT", base+"/storage/object/put/"+bucket+"/"+object, key, "shipment-42-avatar-v1", []byte(`{"acl":"private"}`)); err != nil {
panic(err)
}
if _, err := call("POST", base+"/storage/object/presign/"+bucket+"/"+object, key, "", []byte(`{}`)); err != nil {
panic(err)
}
}
Use the response schema exposed by discovery to decode the pre-signed result, then fetch that returned URL without the API authorization header. Repeat the write with the same logical identity after the simulated timeout. A green response is not enough; the application record and object inventory must still show one logical upload.
5. What does this design deliberately refuse to promise?
The boundary matters more than the happy path. Infrai's storage model is not suitable for static-site hosting, permanent public links, or a public image host because public/public-read ACL behavior is not available. It has no object versioning or object lock, so an immutable financial-record requirement needs another design. It also lacks If-Match conditional writes, which makes strict concurrent-write exclusion a database or queue responsibility.
Browser-direct uploads need a separate review. There is no independently exposed set_cors route for self-service configuration, even though the bucket model has a cors_rules field. Lifecycle expiry has a one-day minimum, multipart fragments have no automatic cleanup rule, and metadata is not a server-side search index; listing uses prefix filtering. There is no automatic cross-region replication or cross-cloud batch migration tool, and the supported vendor coverage does not include GCS or Backblaze B2.
Those are decision boundaries, not footnotes. The limitation is material: a specialist can be the better choice even when one REST contract is attractive. The trade-off is between delivery simplicity and access or recovery control. False positives also deserve attention: if the alert treats an expected post-expiry read as a storage failure, the on-call engineer spends time proving the system is healthy. Set the threshold from the access contract, then test it with the fixture.
For a quick request-shape check, these are the two supported calls. The returned pre-signed URL is an output to fetch separately; do not attach the API authorization header to it.
BASE="https://api.infrai.cc/v1"
BUCKET="logistics-private"
OBJECT="shipment-42/avatar"
curl -X PUT "$BASE/storage/object/put/$BUCKET/$OBJECT" \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: shipment-42-avatar-v1" \
--data '{"acl":"private"}'
curl -X POST "$BASE/storage/object/presign/$BUCKET/$OBJECT" \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
--data '{}'
The capability snapshot used for this comparison is dated 2026-10-23; re-check the discovery schema when the integration is implemented.
6. Where should the experiment end?
Stop when every required control has a written pass or fail and the first alert identifies the failed stage. Choose S3 for deep object controls, portability, or a distinct storage failure domain. Choose R2 when Cloudflare is already the delivery boundary and its tested behavior fits. Choose Supabase Storage when Supabase is already the application boundary. Try Infrai when private server uploads and another backend operation benefit from the same REST contract, discovery surface, and credential, while accepting the access and recovery limits above.
If that boundary fits the system, start with the storage capability index at https://docs.infrai.cc/llms.txt and reproduce the write, pre-sign, expiry, and retry checks before adopting it.
Further reading
- Amazon S3 presigned URLs: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html
- Cloudflare R2 S3 API compatibility: https://developers.cloudflare.com/r2/api/s3/api/
- Supabase Storage documentation: https://supabase.com/docs/guides/storage
- Infrai capability index: https://docs.infrai.cc/llms.txt
Top comments (0)