COS Cost Optimization Solution
Tags: cos, reducecost, storage, compression
Published: 2022-11-03 03:22:19

As more and more enterprises move their businesses to the cloud, they are increasingly aware of cloud costs. Business development brings massive storage needs in the cloud. How to optimize costs to ease the burden on the business?

Before going any further into cost optimization, let's make it clear how Tencent Cloud’s Cloud Object Storage (COS) is billed first. Specifically, storage, traffic, request, data retrieval, and management fees are charged when you use COS, where the first two billable items account for the majority of costs. The following describes the COS cost optimization solution from five aspects:

1.Selecting a proper storage class
2.Regularly analyzing the data access mode through inventory and access log features
3.Transitioning data through lifecycle and batch operations
4.Reducing storage size through file compression
5.Reviewing costs

**•Selecting a proper storage class**
Selecting a storage class suitable for your business greatly optimizes storage costs. COS provides multiple storage classes to meet different requirements for performance, data durability, and business availability. The STANDARD storage class is costly but promises the lowest read latency, while STANDARD_IA, ARCHIVE, and DEEP ARCHIVE are more economical but incur data retrieval fees during download.

**•Regularly analyzing the data access mode through inventory and access log features**
Analyzing the data access mode helps make informed decisions about storage class selection. COS offers inventory and access log features for recording file metadata and access requests respectively, which are then stored in your buckets. COS also provides COS Select capabilities to search for file content. If you have generated too many inventory files or log records, you can also purchase an EMR cluster to set up the Presto component for data analysis.

**•Transitioning data through lifecycle and batch operations**
The data access mode changes dynamically as the business develops. Most data records are accessed less frequently as they grow old. Therefore, it is advisable to adjust the data storage class based on the access frequency for cost optimization. COS has lifecycle capabilities to help you change the storage class regularly. In particular, you can leverage inventory and access log features to analyze the data access mode and then create lifecycle transition rules accordingly.

For certain businesses, it is enough to transition batch files to a colder storage class at one time without specified rules (such as prefixes or tags). This is where COSBatch comes into play. You can use its batch copy feature to change the data storage class or add object tags to set lifecycle rules for object deletion. Below are detailed directions:

1.Export the list of files to be processed and convert it into the CSV format.
2.Create a COSBatch task and import the file list.
3.Execute the task and wait for it to complete.

**•Reducing storage size through file compression**
COS allows you to compress image data to reduce the storage size and costs. Currently, the following compression formats are supported:  
  
**1.Guetzli compression**: It is visually lossless. By taking advantage of human eyes' insensitivity to specific color gamuts and details, it discards specific details to reduce the image size by 35–50% without changing the quality.

**2.TPG compression**: It is designed by Tencent to compress JPG, PNG, GIF, and WebP images with a compression ratio of over 35%.

**3.HEIF compression**: It compresses JPG, PNG, GIF, and WebP images on iOS with a compression ratio of over 45%.

**•Reviewing costs**
Cost optimization needs to be incorporated into the entire business process. Besides planning costs during cloudification, you also need to review costs from time to time afterwards. Planning a proper cloud storage architecture helps reduce storage costs. In addition, you can download your bills at the Tencent Cloud Billing Center to view and analyze your cloud storage usage details before targeted optimization.

COS has always been oriented towards data storage performance and security, service cost-effectiveness, cost reduction, and efficiency improvement. It will continue to create and polish more storage products and scenario-specific solutions with the most economical storage services in the industry at large.

Read more at:[https://www.tencentcloud.com/dynamic/blogs/sample-article/100380](https://www.tencentcloud.com/dynamic/blogs/sample-article/100380)