Case Study · Storage · 2023 — 2024
Object storage with validated uploads, signed-URL access control, and CDN-style retrieval.
User-generated files (documents, images) needed to be stored and served at scale without routing every byte through the application server, which was a bottleneck and a cost sink. Uploads also had to be validated and access-controlled — not every file should be public, and not every upload should be trusted.
A product handling sensitive merchant documents. Files had to be cheap to store and fast to serve globally, but access had to be authorized per-request — a public bucket was not an option.
Request path
Client
request upload
Backend API
validate
Signed URL
scoped
R2
direct PUT
CDN
cached read
Failure recovery & consistency
Bad type/size
rejected
No grant
403
Expired URL
re-sign
Access
granted
Upload
Access
APIs
Chose
·Direct client ↔ R2 transfer via signed URLs
·S3-compatible API for portability
·Short URL expiry for tighter access control
Gave up
·Server-side stream processing of uploads
·Permanent public links (expiry adds re-signing)
·Single-provider lock-in convenience
0
file bytes routed through the app server
global
CDN-fronted delivery with low latency
100%
reads gated by a time-limited grant