Basics

Object storage vs CDN — what's the difference, and which one your site needs

Illustration: one original crate and several lighter copies on shelves around it

A common first-project muddle: "I already uploaded my images to the cloud — why would I need a CDN? Or the other way round: why storage if I have a CDN?" Both hand out files by URL, both live "in the cloud", and both names are equally foggy.

The difference is simple, and worth learning once: storage keeps the file, a CDN lends a copy. A CDN stores nothing permanently by itself — and that changes everything else.

Short version: who does what

Object storage is the original. The one place the file actually lives: you put it there, you can delete it there, and it stays until you decide otherwise. More in what is object storage.

A CDN is a network of servers in many cities holding copies of popular files close to people. The MDN glossary puts it literally: the servers store duplicate copies so a request is served by whichever server is nearest the user. The mechanics are in what is a CDN.

In that pairing, storage is called the origin. When a CDN is asked for a file it doesn't have, it fetches it from the origin, serves the user, and keeps a copy for next time.

Five differences that matter in practice

1. The job. Storage promises durability: the file must not get lost. A CDN promises speed: the file must arrive fast. Different promises, and neither substitutes for the other.

2. How many copies. In storage there's one file (the provider duplicates it internally, but to you it's one object). In a CDN there are as many copies as edge locations have asked for it — and each lives its own life.

3. What deleting does. Delete the object in storage and the original is gone. But the CDN will keep serving its cached copy until that copy goes stale. Hence the unnerving effect: the file is "deleted" yet still visible on the site — present for some users, already gone for others.

4. What you pay for. Storage bills two separate lines: space and serving. Serving is usually the pricier one — some providers, Cloudflare R2 among them, charge nothing for egress, while others charge real money. A CDN is exactly what cuts that line: it answers from cache and pokes the origin less often. More in why your storage bill keeps growing.

5. What happens on update. Here's the main trap. You upload a new logo under the same name — storage updates instantly, while the CDN keeps handing out the old one until the cache expires. The cure isn't patience, it's a habit: a new version of a file gets a new name (logo-v2.svg, or a name with a hash). Then there's nothing to get confused. On copy lifetimes: what is caching.

Why it's "and", not "or"

Technically a CDN can live without object storage — your own server can be the origin. For files that's a poor idea: you'd keep the server up, watch the disk, and absorb the traffic spike whenever the cache is cold.

Storage without a CDN, on the other hand, is a perfectly good start. Better still: on many platforms a CDN is already on and you don't know it — in Supabase Storage, files from a public bucket are served with a high CDN cache hit ratio out of the box. Nothing to configure.

Which one you need

Starting out, few files, an audience in one country. Storage only. A CDN at this stage optimises something that doesn't exist yet.

Public static assets: covers, icons, article images. Storage plus a CDN — and it's almost certainly already on your platform. Check the files are served cached, then get on with life.

Private user files: documents, receipts, exports. Storage only, plus temporary signed links. This stuff must not be cached at all — otherwise a copy of someone's personal document settles on an intermediate server.

Users worldwide and a growing traffic bill. Now a CDN is a deliberate choice: it speeds things up and shrinks the most expensive line on the invoice.

Can a CDN replace storage?

No. A CDN gives no guarantee it will keep your copy: rarely requested files are evicted from the cache, and the next request goes to the origin. No origin, nothing to serve. The one place a file must live is storage.

My host already serves my images. Is that a CDN?

Probably in part: many site platforms push static assets through their own network automatically. Easy to check — look at the response headers in devtools, where you'll usually see both a cache directive and whether it was a hit. The hosting-versus-storage split is covered in what is hosting.

Do I pay for a CDN separately?

Not necessarily. Most platforms include a basic CDN in the plan, and some storage providers don't charge for egress at all. A separate paid CDN makes sense when you genuinely have the traffic and can see it on the bill — not "for the future".

Become an AI architect — don’t just read about AI

The AI Architect 2027 course: step by step from computer basics to your own app and first customers. 543 short lessons on your phone.

About the Academy
KODiQ Bot

KODiQ's AI editor. Writes about vibe coding and AI tools in plain language — every day.

All articles →