Outcome
By the end of this lesson, you will be able to say which kinds of data movement are usually free and which are charged, and estimate a simple data transfer cost.
| Prerequisites | L1, I.1 L4 |
| Time | 7 minutes |
1. Concept
Every time data leaves one place for another, it crosses a boundary. Whether you pay depends on which boundary it crosses.
Two words help. Ingress is data coming into the cloud. Egress is data going out of it.
The general rule
Data in is usually free. Data out is usually charged per GB.
Providers want your data inside their cloud, so bringing it in is generally free. Sending it out, to your customers’ phones and browsers or to another provider, is charged by the gigabyte.
The boundaries, from free to charged
| Where the data goes | Usually |
|---|---|
| Into the cloud from the internet | Free |
| Between two resources in the same zone | Free |
| Between two zones in the same region | Charged by some providers |
| Between two regions of the same provider | Charged |
| Out to the internet, or to another provider | Charged, and usually the most expensive |
Each provider has its own rules and exceptions, so treat the table as a guide and check the provider’s data transfer pricing page for the details.
The gateway charge people miss
Private machines often reach the internet through a NAT gateway: a shared exit door that lets private machines send requests out without being reachable from outside. On the major providers, a NAT gateway is charged by the hour and also for every gigabyte that passes through it. So data going out through one can be charged twice: once by the gateway, and once as egress.
Why it surprises people
Data transfer is easy to ignore. Nobody “rents” it on purpose; it happens as a side effect of how a system is built. A website serving large videos, a backup copied to another region every night, or two services in different zones that talk constantly can each produce a large transfer line on the bill.
2. Worked example
A company stores 1,000 GB of product videos in the cloud. Customers download 5,000 GB of video a month. The company also copies the 1,000 GB to a second region every month for safety. Illustrative prices:
| Movement | Amount | Illustrative price | Monthly cost |
|---|---|---|---|
| Uploading the videos into the cloud | 1,000 GB | Free | $0 |
| Customers downloading videos | 5,000 GB | $0.09 per GB | $450 |
| Copying to a second region | 1,000 GB | $0.02 per GB | $20 |
| Total transfer | $470 |
Storing those 1,000 GB at an illustrative $0.02 per GB-month costs only $20 a month. Sending the videos out costs over twenty times more. For anything that serves large files to the public, the transfer line can be bigger than the storage line.
3. Hands-on (5 min: no account needed)
1. Open the AWS EC2 on-demand pricing page: aws.amazon.com/ec2/pricing/on-demand2. Scroll to the "Data Transfer" section.3. Find the price for "Data Transfer IN to Amazon EC2 from Internet".4. Find the price per GB for data transfer OUT to the internet, for the first band of usage.5. Find the price for data transfer between two AWS regions.Write the three numbers in order. You will see the pattern from this lesson: in is free, between regions is charged, out to the internet is charged more.
4. Knowledge check
Q1
Which data movement is usually free?
A. Data sent from the cloud to customers on the internet
B. Data copied between two regions
C. Data sent to a different cloud provider
D. Data uploaded into the cloud from the internet
Show answer
Correct: D. Ingress is usually free. Out to the internet, between regions and to another provider are all usually charged.
Q2
What does “egress” mean?
A. Data going out of the cloud
B. Data stored for more than a month
C. Data coming into the cloud
D. Data deleted from a disk
Show answer
Correct: A. Egress is data leaving. Ingress is data arriving. Egress is the direction that is usually charged.
Q3
Customers download 2,000 GB a month at an illustrative $0.09 per GB. What is the monthly transfer cost?
A. $18
B. $1,800
C. $180
D. $90
Show answer
Correct: C. $0.09 x 2,000 = $180. Unit price times amount moved.
5. Apply
When you see a large data transfer line on a bill, ask where the data went: out to the internet, to another region, or across zones? Then ask why. The answer is usually a design choice, such as serving files from far away or copying data more often than needed, and design choices can be changed.
Related lessons
- L2, Why the meter does not stop when nobody is using it
- L4, Why the same machine costs more in some regions (next)
- I.2 L3: Network: paying to move data