How To Reduce Your AWS Data Transfer Costs
Is a significant portion of your AWS bill attributed to data transfer costs? These are costs that you pay for moving data between different AWS services and regions, as well as transferring data to and from the Internet. If you frequently transfer large volumes of data across AWS, it’s likely you’re racking up data transfer costs left and right.
Nobody likes overpaying for cloud services. However, AWS’s odd pricing structure for data transfers can make it difficult to understand where exactly you’re wasting money. That’s why in this article, we’ll uncover the various “sweet spots” in AWS data transfer pricing that you can take advantage of to save on your next monthly bill. You’ll also learn best practices and general strategies to reduce your AWS data transfer costs.
AWS Best Practices for Reducing Data Transfer Costs
First, let’s focus on things you can do within your AWS configurations and workflows. These involve thinking through data transfer routes, using CloudFront, and learning your way around AWS’s cost management tools.
Optimizing Data Transfer Routes
Since data transfer costs involve, well, transferring data, let’s be smart with when and where we’re doing our transfers. As a general rule, AWS typically doesn’t charge for inbound transfers, and does charge for outbound transfers. For internal transfers within AWS, charges depend on the source and destination:
- Within same Availability Zone (AZ): Free!
- Within same Region, different AZ: May incur charges.
- Across Regions: Definitely incurs charges.
So, if you can get away with it, limit your data transfers to as close to the source as possible. If you can stay within the same AZ, do so. Otherwise, if you can stay within the same Region, do so.
EC2 is one such service that follows these rules to a tee:
- Within same Availability Zone (AZ): Free!
- Within same Region, different AZ: $0.01/GB for both inbound and outbound transfers, unless transferred between certain services like S3, SQS, DDB, or other EC2 instances (check EC2 pricing page for full list).
- Across Regions: $0.02/GB.
As a concrete example, this means that a 5 TB (~5,120 GB) worth of monthly intra-Region (different AZ) transfers between EC2 and another service will cost you around $102.40.
If you do have to go cross-Region, the source Region matters. For instance, transfers from US East (N. Virginia) to Africa (Cape Town) cost $0.02 per GB:
However, data transfers from Asia Pacific (Tokyo) to Africa (Cape Town) are 4.5 times as expensive:
So if you can get out of operating in expensive Regions, it probably makes sense to do so. Instead of having to host copies of your content or service natively in every Region, you could use CloudFront, which we’ll talk about in the next section.
Use CDN or Content Delivery Network Like Amazon CloudFront
A content delivery network (CDN) is a network of servers at “edge locations” all over the world. A CDN caches your content at these locations, which helps reduce the overall latency clients experience when making requests. It’s a must for optimizing website or application performance, and AWS offers this service via Amazon CloudFront.
CloudFront is great because it’s another sweet spot in the AWS pricing model: transfers between popular AWS services (like EC2 and S3) to CloudFront won’t cost you a dime. That’s $0.00 per GB!
Do note that while it doesn’t cost anything to transfer data to CloudFront, you’ll still incur DTO costs for two particular data transfer paths:
- Transfers from CloudFront to the Internet
- Transfers from CloudFront back to your origin (i.e. the user requests data via POST)
However, overall, using CloudFront means you can operate in fewer Regions, and usually leads to fewer costs. In addition, you might be able to cut back on your origin servers as well, as these don’t need to be as powerful if your content is served primarily from CloudFront caches. For more on this, see our CloudFront pricing and optimization guide.
Utilize In-House AWS Cost Tools
AWS offers over 200 services. Some of them are designed to help you understand your costs and save money!
For instance, take AWS Trusted Advisor. This tool analyzes your AWS infrastructure and provides best practice recommendations on everything from performance to security, including cost optimization. As the following screenshot shows, Trusted Advisor can directly show you potential monthly savings by applying their recommendations.
Secondly, Billing Management services such as AWS Cost Explorer and Cost and Usage Reports (CUR) can be very powerful in understanding your spend. Learning these tools takes some upfront investment, but it’s definitely worth it in the long run to be able to create custom cost visualizations. For an in-depth guide, check out our piece on using AWS Cost Explorer and the CUR to analyze EC2 Data Transfer costs.
Finally, while not an official service, the AWS Pricing Calculator is your friend. Before you run a large data transfer, plug those numbers into the calculator and try it out with different scenarios to find the most cost-effective method.
General Strategies to Reduce AWS Data Transfer Costs
By now, you’ve learned some things you can do in the world of AWS to reduce data transfer costs. Now, let’s step back and consider some more general strategies.
If you think about it, data transfer costs really just boil down to two things: volume and frequency. Transfer less, or less frequently, and you’ll end up paying less. So naturally, we simply need to figure out how to modify our workflows to reduce either volume or frequency (or both!).
The smaller your data, the smaller your transfer volume. Generally, it’s always possible to compress your data one way or another, since data is often redundant. Compressing data can often reduce file sizes by 50% or more, which can lead to significant savings.
There are a couple ways you can implement compression when working with AWS. Remember how transferring data to CloudFront is free, but transfers out of CloudFront (i.e. from CloudFront to Internet) can still cost you? To save on these expenses, you can enable automatic compression in CloudFront. This reduces the volume of data transferred between CloudFront and your users, and lowers costs.
Another possibility: S3. While S3 doesn’t natively support data compression, there are workarounds for this. One common setup is to author a Lambda function that compresses objects before uploading them to an S3 bucket. For instance, this AWS blog post uses this approach to compress and archive satellite imagery.
The less frequently you have to transfer data, the less you pay. Instead of having every request hit your backend infrastructure, you want to store frequently accessed data in caches, which are located closer to your users. With caching, you avoid having to deliver the same data multiple times.
We’ve actually already talked about caching in this article when we introduced CloudFront. It’s technically a CDN, but can be thought of as a caching layer. When users request content from your website or application, CloudFront can serve that data to them directly if it exists in the closest CloudFront edge location. An added benefit to this is that it protects your original server from overloading.
For lower-level caching, consider AWS ElastiCache. This is an application-level optimization that utilizes in-memory caches to reduce the number of requests to your data stores. While ElastiCache comes with its own set of costs, this can still lower your overall costs in the long run due to reduced data transfers between your applications and databases.
Last, but certainly not least, you have to learn how to properly monitor your AWS costs. For starters, the AWS Cost Explorer is a good way to obtain a quick overview of costs. However, we highly recommend going a step further by enabling the CUR in your account, so head over to our complete guide teaching you how to do that.
Third-party tools can also give you incredible insight into your costs. A tool like CloudForecast delivers cost reports to you daily, complete with aesthetic cost visualizations. No more worrying about learning your way around the CUR!
It’s a mistake to just eat up your data transfer costs and assume you can’t do anything to lower them. The truth is, you absolutely can by taking advantage of areas in AWS data transfer pricing. We’ve covered a wealth of strategies you can use in this post, from optimizing your data routes to implementing compression and caching for operations involving heavy transfers. Pair these strategies with a cost monitoring tool like CloudForecast and you’re well on your way to huge AWS savings.
Manage, track, and report your AWS spending in seconds — not hours
CloudForecast’s focused daily AWS cost monitoring reports to help busy engineering teams understand their AWS costs, rapidly respond to any overspends, and promote opportunities to save costs.
Monitor & Manage AWS Cost in Seconds — Not Hours
CloudForecast makes the tedious work of AWS cost monitoring less tedious.
More from CloudForecast
AWS cost management is easy with CloudForecast
We would love to learn more about the problems you are facing around AWS cost. Connect with us directly and we’ll schedule a time to chat!