intermediate 2 min answer

A social platform discovers that data egress is its largest single cost line. Which architectural changes reduce it most, and which are ineffective?

sharechategresscdncache-hitarchitecture
Show the full answer Hide the answer

The changes that reduce it most

  • CDN cache hit ratio. Every percentage point is a direct reduction in origin egress. Improved by consistent URL construction — query-string variation is a common silent cache-buster — long TTLs on immutable content, and origin shielding so a miss in twenty locations produces one origin request rather than twenty.
  • Request collapsing, so simultaneous misses on one object produce one upstream fetch.
  • Serving the right size. Delivering a rendition higher than the device can display is pure waste at exactly the scale where it matters, so client capability negotiation is a direct cost reduction.
  • Fewer, better-chosen renditions. The number of variants multiplies storage and transcoding, and beyond a point adds no perceptible quality.
  • Modern codecs, which reduce bytes for equivalent quality at the cost of encoding compute and device compatibility — a straightforward trade once the encoding cost is a fraction of the egress saved.
  • Keeping traffic inside a network boundary where the provider does not charge for it: co-locating services that exchange large volumes, and using private endpoints for object storage rather than routing through a public path.

What is ineffective

  • Application-level optimisation, which does not touch the payload.
  • Compressing already-compressed media, which achieves nothing and costs CPU.
  • Reducing the number of requests when the cost is bytes rather than requests.
  • Moving to a cheaper region, since egress pricing is largely uniform and the move costs more than it saves.

The cross-cutting one teams miss

Internal cross-zone and cross-region traffic. In a microservice architecture with services spread across availability zones, a single user request can cross zone boundaries many times, and each crossing is charged. Zone-aware routing — preferring a replica in the same zone — is frequently a large saving with no architectural change, and it improves latency at the same time.

The same applies to replication and backup traffic, which is invisible in application metrics and can be a substantial share of the bill.

The metric to run

Cost per thousand content views, tracked over time and split by content tier. It exposes whether the caching and encoding work is compounding, which total egress spend cannot show during growth.