Stop Proxying Files Through Your Backend
A simple mental shift that changes how you design file systems at scale.
Most developers start building file systems the same way:
A user uploads a file → backend processes it → backend stores it → backend serves it back on download.
It feels natural. Safe. Controlled.
And it works… until it doesn’t.
At scale, this design slowly turns your backend into something it was never meant to be:
a high-throughput file proxy.
The hidden problem
When everything goes through your backend:
- your API becomes bandwidth-bound
- latency increases with load
- scaling becomes expensive
- and your “business logic server” turns into a file streaming pipeline
Not because you designed it wrong.
But because you didn’t separate responsibilities.
The core mistake
You are mixing two completely different systems:
- Control Plane → decisions, permissions, authentication
- Data Plane → raw file transfer, streaming, bandwidth
Most systems fail when both live inside the backend.
The better mental model
Instead of:
“Backend handles files”
Think:
“Backend only decides who is allowed to access files”
That’s it.
Nothing more.
Modern architecture
Here’s how scalable systems actually behave:
Client
↓
Backend (Auth + Policy Decision)
↓
Signed Access (URL / Cookie / Token)
↓
CDN / Object Storage
↓
Direct stream to client
Where does security actually live?
This is the part most people misunderstand.
Security is NOT enforced by proxying files through your backend.
It comes from:
- short-lived signed tokens
- strict access scopes (view / download / upload)
- cryptographic signatures
- edge-level validation
- private-by-default storage
The backend is no longer a gate that carries data.
It becomes a gate that issues permission.
Why this scales better
Once you adopt this model:
Backend
- stateless
- lightweight
- horizontally scalable
- no bandwidth bottleneck
CDN / Storage
- optimized for streaming
- globally distributed
- caching-aware
- built for high throughput
Each system does what it was designed for.
No overlap. No friction.
The mental shift
If there’s one idea to take away, it’s this:
A scalable backend should not move data. It should authorize access to data.
As soon as your backend starts “transporting files”, you’ve coupled control and data again — and that’s where scaling pain begins.
Final thought
Most file system architectures don’t fail because of weak storage systems.
They fail because of a simple misunderstanding:
treating the backend as a file pipeline instead of a decision engine.
Canonical version. Also on Medium.