Why the edge exists: CDN distance versus object store rest
A CDN shortens the trip to static bytes, and the object store is the far rung where they rest.
Distance sets the cost of every read, so a static file copied to a nearby edge removes network round trips that would otherwise cross continents. The mechanism is replication of immutable bytes into many regional caches. The consequence is that each edge keeps its own working set and must be sized, tuned, and invalidated as a cache, not treated as a faster origin.
A CDN stores copies of static files at points of presence close to users. Each point of presence holds a working set, not the whole catalogue, because files are large and memory is small, so it often stores objects on disk. Operators choose between push and pull. Push loads known content, such as a scheduled release, before traffic arrives. Pull fills an edge on the first request: the edge asks the origin, the origin returns the object, and later users in that region hit the copy. Geo-sharding gives each edge a different subset, and one object may exist at several resolutions. The object store sits behind this as origin. It separates storage from compute, so capacity grows without adding idle processors.
The abstraction hides the cold miss and the cost of being wrong about popularity. A pull edge that has never seen an object forwards every first request to origin, so a sudden spike reaches every point of presence at once. The origin receives the full request rate while users wait for each edge to fill. A media startup serving uploads straight from a bucket learns this when one clip goes viral: playback crosses regions for every viewer, egress is billed per byte, and nothing was warm. Push would have helped, but nobody knew which clip would spread. The abstraction also hides that a CDN has its own invalidation and lease behaviour, so an updated object can stay stale at the edge after the store already holds the new bytes. The edge is a cache, and it fails like one.
Start by asking who reads the bytes and how soon. If the object is immutable, public, and large, place it on a CDN. Push it when the release schedule is known, and pull it when popularity is unpredictable. Keep the object store as origin. If the data is mutable or per user, do not place it on a shared edge cache, because the hit rate will be near zero and one wrong key can expose one user's data to another. For analytical data, use the object store as the resting place and rent compute per job. Keep a Hadoop-style cluster only when locality earns its cost: repeated scans, tight batch deadlines, or the same bytes moved every time. Before you ship, write down the freshness the cache may promise and the distance it saves, because a cache cannot repair a store whose consistency you guessed wrong.
- cross-continent round trip
- hundreds of ms
- edge TTL
- minutes
- object store request
- milliseconds to tens of ms
- cold fill
- one origin trip per object per edge
One request and response crossing an ocean. Every uncached static read pays it, so distance dominates latency for distant users.
How long an edge keeps a copy before asking origin again. Shorter TTLs bring freshness, while longer ones shield the origin from repeated fills.
One read or write against the store. Fast enough for batch work and most origin fetches, but slower than a local disk.
The first request in each region for an uncached object. Pull pays it for every new object, while push moves it before launch.
The naive design treats an object store like a local disk. You write a file under a key, point a cache at it, and assume readers will eventually see the newest bytes. Caches built in front of storage carry that assumption, so a short delay looks harmless.
The wall arrives when an overwrite is read back stale. The cache has already stored the old version, and every later reader receives it too, so one lagging read becomes a shared error that lasts until the cache expires or is invalidated.
The fix started at the store. AWS documents S3's move to strong read-after-write consistency for new objects and overwrites, so a read after a successful write returns the new bytes. That removed one class of stale-cache bug and changed what a cache in front of S3 could safely promise.
The lesson is that edge design states two things: how far the bytes travel and how fresh they must be. Write both down before choosing the cache, because a cache cannot repair a store whose consistency you guessed wrong.