Skip to main content
Mostafa Effati

About this platform

A working notebook for engineering practice

This is Mostafa Effati’s personal engineering platform: a place to turn hands-on work into clear writing, structured learning, and useful digital products.

Student collaborator

  • Ms Zahra Ehsani

    Former student · platform contributor

    Ms Zahra Ehsani worked on parts of this platform during her studies and brought thoughtful, practical contributions to its development. I'm glad to recognize her work here.

What you will find

  • Long-form articles, books, tutorials, and practical snippets.
  • Courses and guided learning paths built around real engineering work.
  • Case studies, open-source work, experiments, and product releases.

Built deliberately

  • A bilingual Persian and English experience with native RTL support.
  • Theme-aware, keyboard-friendly interfaces with a focused visual language.
  • Content and product changes developed as one versioned system.

The platform is continuously evolving. Some sections are complete products; others are active experiments that improve as the underlying work develops.

Stop Proxying Files Through Your Backend

A scalable system design shift — treat the backend as a permission engine, not a file pipeline.
Mostafa Effati3 min readsoftware-architecture

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.

Related documents

Command menu

↑ ↓to move · Enter to select · Esc to close
Navigation
Actions

Press Esc to close · ⌘K to toggle