Is cloud cheaper than on-premise?
Carlos Morales • 2022-09-24
Almost everybody says that one of the main reasons to move into the cloud is because it is cheaper than running an on-premise data center. Well, I am here to say no, this is not always the case. I would like to share our experience on the topic and where to focus to make it true.
The Total cost of ownership
Lately, the term total cost of ownership (TCO) became very popular, this is the ongoing cost to maintain and upgrade a system over the application’s lifetime. Some say this can be up to 75 percent of their total IT budget, just to maintain and run existing systems and infrastructure seems a little bit excessive. And every time somebody mentions the TCO, they immediately remind us this cost does not bring direct business value and how great would be to spend it on what “really matters” or in innovation.
The TCO is reduced in the cloud, especially in managed services like Serverless architectures. The more abstraction, the less cost of ownership. True, but this does not imply the total cost disappears or it is always cheaper than an on-premise installation. Do not get me wrong, there are many reasons why the cloud is very interesting which I appreciate. But one of those reasons is not cost-saving, at least without a proper architecture.
What is Our experience?
Let me share our own experience moving data centers to the cloud. In my current company, we have many data centers across continents. One of the common regulatory requirements in the finance industry is the client data must remain in the territory to which the clients belong, this led to building and running of many data centers. Just in Singapore, we had nine data centers. Because of several reasons (expensive real-state, client acceptance to the cloud, etc.) we decided to close down those nine data centers and move into the public cloud, more specifically to AWS (although this does not apply exclusively to AWS).
Once we moved to the cloud, many people were surprised that the total cost was higher in the cloud. Sadly, I cannot bring quantities or concrete numbers without agreeing on it with legal. Anyway, these numbers are not relevant, but the fact that running the same application in the cloud was more expensive than on-premise. The realization of this was for many like a collapse of a myth.
For many, the could is always cheaper than on-premise, we proved that to be wrong
Tasks to make cloud cheaper
The cost of running on the cloud is very complex and multifaceted. In our case, one of the main problems was lack of elasticity. This is not a simple task to fix, sometimes it requires re-thinking the architecture and re-implementing parts of the application.
Without proper architecture, the cloud can be more expensive. In most cases, this is not mentioned.
These are the most important lessons learned to consider to make the public cloud cheaper:
Elasticity
In your own data center, provisioning more resources takes weeks (buying, installing, configuring, etc.), this is the reason why on-premise infrastructures are not elastic. As a result, you want to oversize the infrastructure to absorb peaks of work. Most of the time your resources are oversized. Teams get used to this setup, they do not focus on performance and tend to keep services running all the time within big machines.
One of the greatest features of the cloud is you do not need to provision for the high demand peaks. The required storage and process capacity can grow dynamically and the most important: it can release resources when they are not needed. But this requires applications can grow and shrink dynamically.
When designing an application apply autoscaling, this is how the application can automatically and dynamically match resources to meet the demand. Focus on horizontal scale and remember stateless services usually win.
Best practice: Adapt the architecture as needed to meet new challenges and new demands.
Design for releasing resources when they are not needed
Cost or limit controls
Elasticity without proper monitoring can be even more dangerous than non-elastic applications. Imagine a service with an infinite loop, in a non-elastic environment the CPU goes to 100% and it becomes unusable. In an elastic environment, the servers may start scaling out (asking for more servers) and since the cloud providers practically have no limits, without proper monitoring and controls this can become very expensive very quickly.
As a concrete example, this YouTube video explains a real case of how a startup racked up a 72K USD bill in just 2 hours on a serverless service.
Best practice: Whenever it is possible, always define rules to limit the costs.
Infrastructure as Code
Follow guidelines
All main cloud providers offer best practices on cost saving, read and follow them. For example, AWS Well-Architected Framework includes a Cost Optimization Pillar with a list of design principles focused on reducing the total cost. Similarly, GCP Google Cloud Architecture Framework also lists some design recommendations for Cost optimization.
These providers also have cloud solution architects, which can help with cost savings.
Best practice: Apply cloud guidelines on cost optimization and ask for guidance from experienced architects.
Conclusions
The answer to the question “is cloud cheaper than on-premise?” is it depends, as always.
Without a proper architecture, the costs are higher in the cloud that on-premise.
After a proper architecture, cloud costs are lower than on-premise.
When transitioning from on-premise to the cloud, consider carefully how this is done.
Update 03.10.2022
One week after writing this blog entry, the Wall Street Journal newspaper created a YouTube video on the topic: Cloud Computing Isn’t as Cost Effective as Hoped. So What’s Next?. Apparently, there are more companies with similar experiences. The Video focuses on removing duplicity on multiple cloud providers, this was not our case though. In my humble opinion, they miss the most important point: the cloud requires rethinking/redesigning some applications’ architecture to be cheaper.