Getty Images


3 best practices for Amazon S3 cost optimization

Everything a business runs in the cloud costs money, and AWS S3 storage is no exception. Smart AWS users understand how to adjust S3 storage levels to control costs.

To be smart about cloud spending, organizations need to know how AWS calculates storage costs and where they can reduce expenses without seeing a decline in performance.

A company should begin this evaluation with a simple question: Do we even need to keep all the information that is being stored? For some companies, being able to recreate the information/documents is easier -- for both management and control purposes -- than to manage potentially millions of almost duplicate items.

For audio, images, code, documents and other objects that an organization needs to keep, Amazon Simple Storage Service (Amazon S3) gives the user the ability to determine the level of performance required for particular data. This same capability also gives an organization a certain level of control over its cloud storage costs.

In this tip, learn how to optimize Amazon S3 costs by revaluating manual processes, examining transfer costs and tracking storage utilization.

What to store -- and where to store it

A good place to start with S3 cost optimization is to understand the range of options available. For example, S3 buckets used for web server content need fairly performant disk, what's often called hot storage. A company will also have older data that must be kept for policy, legal or financial reasons -- even though these documents are rarely accessed. It would be extremely wasteful to place this older data on the same storage as high-priority data.

Think of AWS storage as a spectrum. As a user moves from the hot end of the spectrum through the tiers to cooler storage, the price drops significantly. Bear in mind that colder storage means longer access times.

To make the point, S3 Glacier archival storage is not at all performant, but it is exceedingly cheap. The snag? It can be up to 12 hours to retrieve that data and at a cost for retrieval that's above and beyond the basic pricing. The next level up is measured in minutes, but that costs more.

The cost of S3 is dependent on several variables. There's the storage type (S3 Standard, for example), the number of requests, the disk space consumed and network ingress and egress.

Three ways to optimize S3 costs

So how can all these items be consumed with a view to value for the money being spent? A good starting point is to look at the AWS regions. Different regions have different costs and can make a noticeable difference depending on region. More storage means more cost. When looking to optimize S3 costs, follow these three best practices:

1. Avoid manual processes.

It may sound obvious, but enterprises need to manage all the collected data. AWS offers a feature called S3 Intelligent Tiering, which can transparently manage the tiering aspect. This automates data management between tiers. Importantly, the administrator would need to select the Intelligent Tiering option at the time of creation.

Intelligent Tiering works only with storage objects bigger than 128 kilobytes. Intelligent Tiering also does not include the lower levels of S3 Glacier archival storage. Even if you skip Intelligent Tiering, it's important to have proper processes in place to remove unused objects from the S3 system.

For example, you will reduce your costs when you clear documents or images that are no longer required -- after any legal hold has expired.

Let's look at an example, using basic numbers to keep everything easily comprehensible. For storage alone, counting neither I/O costs nor API requests:

               20480 GB x $0.0230000000 USD = $471.04 USD (20 TB for storage)

Of that 20 TB, let's say 5 TB per month is active data and 15 TB is older data that hasn't been used. If that 15 TB were intelligently transferred via Intelligent Tiering to the S3 Infrequent Access tier, the cost tumbles:

5120 GB x $0.0230000000 USD = $117.76 USD (5 TB of hot storage)

15,360 GB x $0.01 USD = $153.60 USD (S3 One Zone-IA storage cost)

The total cost for the tiered model comes in at $271.36 per month, a savings of $199.68 every month, or roughly $2,400 per year.

2. Mind the transfer cost

An organization that uses AWS for infrastructure does not pay for transfer costs between the infrastructure and S3. Also, there will be no charge to transfer to another S3 or AWS system within the same region. Once it leaves the S3 region, costs start to mount. Be sure to keep track of what and why data is transferring in and out of the environment.

3. Access utilization features

AWS wants to sell you as much storage as you can use, but it also wants you to understand how you consume that storage. The S3 Storage Lens feature can assess current utilization of an account's S3 storage; the base level of this service is available for free.

Once you gain a solid understanding of the many storage classes and options available to you, S3 cost optimization becomes a less daunting task. And lower S3 costs can be a key part of a broader strategy to manage AWS spending.

Dig Deeper on Cloud infrastructure design and management

Data Center