How to Optimize the Cost of Your Cloud Resources
The Nature of the Cloud
It might be a revelation for people with little to no technical background that cloud services provided by Microsoft, Amazon, Google or any other cloud provider rely on the same old-school hardware components: servers, storage systems, network switches, and power supplies. All of them have their capital purchase cost and an operational one to keep them running. The combination of these expenditures, directly and indirectly, impacts the price. Cloud services that process data and use a lot of CPU power or have high memory consumption cost more than ones that store or transmit information. That is a very rough approximation as the formula for service price usually includes multiple factors, such as resource location, its promotion by the vendor and others. Nevertheless, it can serve as a starting point for understanding a cloud pricing model.
Another subtle aspect is that most cloud services cost you money only when you use them. For example, when your virtual machine is running in a cloud, you pay according to its pricing. However, if you shut it down, you will continue paying only for its storage volume, which is insignificant compared to the full price. Taking a closer look, you may think of disposable environments, which are added to your bill only when they exist. As cloud infrastructure is much more flexible than an on-premise one, you can spin up the most complex environments in a matter of minutes and decommission them even faster. That makes a perfect fit for test environments, automation, and DevOps practices.
Efficient Approaches to Cloud Resource Utilization
From a technical perspective, it’s essential to know and apply key methods of efficient cloud resource utilization. They might be as simple as manually scaling down VMs with low load. Or you may find them as intelligent as implementing autoscaling and using reserved instances when appropriate.
Before performing any changes, it would be wise to asses, or even better to establish, continuous monitoring of your cloud resource utilization. Why is it essential? Let’s assume that you have some servers, databases, or a website in your cloud environments. Some of those resources might have a high or moderate workload, and others might have an excessive amount of underutilized compute, memory or storage resources that you are still paying for. You must scale your infrastructure according to the workload to avoid unnecessary expenses.
What if the workload in your application or service is not steady and you want to have some spare capacity to deal with traffic spikes? Various cloud services allow you to scale them on the fly and pay only for what you consume. That’s when autoscaling comes into play. Autoscaling is a technology that allows you to automatically provision additional resources and decommission excessive ones based on different performance metrics of your application. Instead of manually increasing and decreasing the size of resource instances (vertical scaling) or their number (horizontal scaling), you can configure the cloud to do that automatically for you.
There is another option to reduce costs on infrastructure components with a relatively stable workload. Most cloud providers offer reserved instances that can cost you 30% less in the long run. There is a high probability that the core parts of your cloud infrastructure will function in the long-term, so you can choose to pay for them in advance for 1+ years, and, in exchange for that, the cloud provider will offer you a substantial discount.
Importance of Cloud Architecture Design
Experienced cloud architects usually say that there are no perfect designs but only ones that satisfy most of the requirements. From an architectural point of view, a broad spectrum of design decisions can affect the expenditures on cloud services, so here we will overview only the basic ones.
When designing your application or service, you are hardly limited to only one type of cloud service to use for your subsystems. You can choose from two, three, or more service types with similar functionality. Some of them are expensive; others are relatively cheap. It would be right to determine which types of services are relevant in your case. Moreover, you can replace advanced and more expensive “ready-to-use” services with a combination of more low-level resources to match your specific needs.
In addition to core building blocks, there are many support services that can help you to minimize the utilization of your expensive resource. For example, consider a Content Delivery Network (CDN). Instead of running costly high-performance web services, you can offload static content to a cheaper CDN, scale down the web tier due to decreased traffic, and reduce your overall price.
Serverless computing technologies such as Azure Functions or AWS Lambdas can offer you the most precise pricing model where you pay only for the time when your code is executed. Although it is a relatively new approach that might require additional investment of time and effort to learn and apply, it is the most beneficial in terms of flexibility.
Alternative Financial Management: Prioritizing Revenue
Business owners are usually interested in measurable results, such as revenue increase, achieved by a specific solution rather than the underlying technology itself. Despite the business’s favor of numbers, considering them without context can be misconceiving.
One of the popular business approaches in the pursuit of the desired financial goals is to focus on cutting expenses. On one hand, it sounds reasonable, as doing so can help to increase your margin. On the other hand, you can achieve the same results by increasing revenue. To illustrate the point, consider the following example.
Engineers may consider provisioning of a relatively expensive cloud service as a way to improve user experience. If they make a decision focusing on the service cost solely, they might miss the opportunity of increasing the customer base and accelerating revenue growth. As a result, cost optimization could be counterproductive.
Another example is making similar decisions without precise calculation of ROI. In some cases, it is better to continue running your application or service on an outdated architecture because your investment into migrating them to new, more cost-efficient services might never be repaid.
Cloud resources cost optimization is a challenging task. To achieve substantial results, it is essential to evaluate your cloud infrastructure from each perspective described above and choose the optimization methods that will create business value in your individual case.