Bandwidth, Egress and the Cost of Moving Data
Data in is usually free, data out usually is not. Transfer direction is the variable that turns a predictable bill into a surprising one.
Compute and storage costs are easy to reason about: you chose a size, you pay for it. Data transfer is different, because it scales with behaviour rather than with a decision you made once.
The directions and how they are treated
- Inbound from the internet. Usually free.
- Outbound to the internet. Usually billed, and usually the most expensive category.
- Between regions. Usually billed in both directions.
- Between zones in one region. Sometimes billed, often at a lower rate.
- Within a zone on private addresses. Usually free or close to it.
The asymmetry is deliberate. Getting data in is easy; getting it out costs money, which is one of the practical realities of cloud architecture.
Where egress accumulates unnoticed
- Serving media directly. Images and video from your own server are pure egress on every request.
- Cross-region backups. A nightly copy to another region is billed every night.
- Chatty architectures. Services in different regions talking constantly pay for every exchange.
- Database replication across regions. Continuous and proportional to write volume.
- Log shipping to an external service. Verbose logging becomes a transfer bill.
Bandwidth allowances
Smaller providers often bundle a generous monthly transfer allowance with each server and charge only beyond it. That model is easier to predict and is one reason providers such as Hetzner and DigitalOcean are popular for content-heavy workloads.
Check whether allowances pool across servers, since that materially changes the maths for a multi-server estate.
Reducing egress
- Put a CDN in front of static assets so repeat requests are served from the edge.
- Compress responses; text compresses well and the saving is immediate.
- Keep services that talk to each other in the same region, and use private addressing.
- Set sensible cache headers so clients stop re-downloading unchanged files.
- Review log verbosity before shipping everything off-platform.
Estimating before you build
Multiply average response size by expected requests per month. A one-megabyte page served a million times is a terabyte of egress, which on most providers is a meaningful line item. Doing that arithmetic before launch is considerably more pleasant than doing it afterwards.
Cloud accounts on OldCloudShop
Ten providers, every configuration and the starting price for each.
Continue in the library
Other entries covering account structure, billing, security and provider infrastructure.