Insights·2026-09-16

What storage and a CDN are — where files live

A database is a table structure good at holding names, dates and numbers, so photos and video are not the kind of thing that belongs in its cells. Put them there and every read drags a heavy blob along. So files live separately in storage and the database holds only the path. On top of that, the net that pushes copies of frequently used files around the world in advance and serves them from somewhere nearby is a CDN, and a good share of every complaint that a site is slow starts in this layer.

파일은 스토리지에 두고 표에는 경로만 적는다 — 글의 요약 도식

Why images do not go in the table

The previous post said a database looks like a spreadsheet, a structure good at stacking names, dates and numbers one row at a time.

Photos and video are not the kind of thing that belongs in those cells. Conceptually you can put them there. It just does not perform.

The reason lies in how things are read. Drawing one list screen might query twenty rows, and if each row holds a whole image, images that will not even appear on screen get dragged out too. A database is not a tool built for heavy blobs travelling that often.

So they are separated. The file itself goes in a file store, and the database holds only the path to where the file sits.

The table holds only a path
posts table
─────────────────────────────────────────────
id  title         cover_path
1   First post    /uploads/2026/09/cover-1.webp
2   Second post   /uploads/2026/09/cover-2.webp

1. the screen queries posts and reads cover_path
2. it then asks storage for that file separately

Storage and the second request

The place files live is called storage. For a small service it may be a folder on the server; as things grow, a dedicated file service takes over.

In this structure the screen makes two requests. It asks the backend for values and receives a path, then asks for the file at that path separately. Browsers send that second request on their own when they meet an image address, so it is not something a person manages.

Separating what serves values from what serves files also lets them sit on different servers. One server answers value requests well; another serves files well. Different kinds of work, each better done apart.

CDN — the layer that handles distance and frequency

A comparison showing that frequently requested files are kept ready at nearby edge locations while rarely requested files are fetched from the origin on demand.

One more thing attaches here: distance.

Say an image sits on a server in the United States and someone in Korea is looking at it. The request travels the Pacific over undersea cable. A line of text is one thing, but a large blob like an image or video making that round trip every time is slow.

So copies get pushed out in advance. Frequently used files are copied to points of presence around the world, and when a request arrives the point nearest that person serves it. That net is a CDN, short for content delivery network.

It handles frequency too. A site logo is fetched by every visitor while the image on an unpopular post is almost never fetched. The first is worth keeping close at all times; the second is better pulled from the origin when a request actually arrives. Making that judgment for you is what this layer does.

LayerWhat it holdsWhat it decides
DatabaseValues and file pathsWhich values relate to which
StorageThe original filesWhere to keep them safely
CDNCopies of frequent filesWho gets served from where

Most complaints about a slow site start here

Bars comparing a slot that displays at 400 pixels wide against the 4000-pixel original file being sent to it.

A slowness report makes it tempting to open the code first. In practice it is often this layer.

A few checks are standard. Are images going out at their original size? Sending a 4000-pixel file into a slot that renders 400 pixels wide throws away exactly that much time.

Look at format too. The same picture is far lighter in a format built for the web. Then look at distance and caching: whether copies are being served from somewhere close, and whether a file already fetched is configured so the browser need not fetch it again.

Open the network tab in your browser's developer tools and you can see exactly which file took how long. Looking here before touching code usually produces the answer. The next post is the last: moving all of this to another computer.