How to code your way to manageable cloud costs

Cloud computing graphics.
(Image credit: Shutterstock / Blackboard)

Global spending on public cloud services is set to increase by a sizeable 20.4% in 2024, according to Gartner, with much of the cost directly related to increased utilisation. This won’t be a surprise for anyone managing an IT budget and finding they’re attributing more money to keeping cloud services online.

They’re not without solutions though. The big players are all introducing cloud pricing calculators, while FinOps is gaining attention among those taming runaway costs. But here’s the issue: although cloud calculators and FinOps can be helpful for addressing infrastructure, they don’t go far enough in tackling the applications. As such, IT teams using these tools are still unable to focus on the key contributor of cloud costs – inefficient code.

A simple way to look at it is that cloud is an extension of your code, and because inefficient code in the cloud makes you fork out large amounts of money straightaway, turning the tide should be a priority.

Dan McConnell

Senior Vice President of Product Management and Enablement at Hitachi Vantara.

Cloud changes the planning cycle

With on-premise infrastructure setups, managing utilization would usually mean looking at the code that lives directly on the server. The more data and features you add, the faster you get to around the 70-80% usage amount – the point at which many IT managers start to think about adding more server capacity.

However, purchasing, provisioning and connecting a server in an on-premise data centre can take up to six months. It isn’t an overnight job. So, in the meantime, teams might try to make tweaks to the existing servers to reduce usage, boost performance, and give some breathing room until the new hardware is online.

When deploying code in the cloud, it’s very different. That’s because the cloud’s ability to automatically scale means you never get to the 70 or 80% capacity level. And because the meticulous level of expansion planning isn’t required in the same way as in an on-premise situation, the impetus to tweak and enhance your code to gain more headroom isn’t as great.

Where you might have worked hard to regain 20-30% of capacity on premise, that procedure never happens in the cloud. As such, your cloud services bill gets higher and higher.

The case for cost SLOs

All this requires us to rethink the way we approach the cloud, code and costs. The common misconception is that cloud is infrastructure when in fact it’s code. And not enough developers think about how much their code costs in production. Usually, they will prioritize the parameters that exist in service level objectives (SLOs) such as CPU and memory consumption, latency, and response times. Usually, cost isn’t regarded as an SLO. I would argue that has to change.

If cost is set as a deliverable from the very beginning, it sets the tone for optimisations that will make cloud costs more affordable – while also unlocking other benefits at the same time. Every execution adds a cost, but what if those costs could be minimised? For example, let’s say an online transaction usually takes two seconds to complete. If you could introduce a line of code that could reduce that two seconds down to 500 milliseconds, you can save 75% while also improving customer satisfaction.

It’s a phenomenon called cost-conscious coding and it couldn’t come to prominence at a better time. While cloud costs increase, AI is becoming more capable, helping developers create code faster than before. According to McKinsey, AI can cut the time it takes to write new code in half. Therefore, it will be possible to become more efficient and cost effective with code rendered in the cloud, while the people hours to create the code in the first place will be heavily reduced.

Make cost-conscious coding make sense

If you want to manage your cost as an SLO, a good place to start is by defining, measuring, calibrating, and recalibrating it. What do you want the parameters to be and how will you track progress? Cost-conscious coding is an iterative process so you will continually discover new ways to improve performance.

That said, it’s also worth noting that your returns will ultimately stabilize. There will be a point when the law of diminishing returns kicks in, and results will also vary from business to business. Cost-conscious coding therefore should be aware of the effort being put in and the expected outcomes. The results should always justify the initial effort or it will be a wasted exercise, no matter how much AI helped write the code.

If you’ve noticed your cloud costs ballooning recently, cost-conscious coding is definitely worth exploring. It sits well within the broader philosophy of setting cost as an SLO and when there’s such an expectation in place, it’s much more likely that developers will start to address it. Even if your costs aren’t going up now, if you’re planning to grow, there’s a likelihood that they will at some point. Cost-conscious coding is an activity that prepares for the future and can potentially use emerging technologies to make it happen.

We've featured the best cloud storage.

This article was produced as part of TechRadarPro's Expert Insights channel where we feature the best and brightest minds in the technology industry today. The views expressed here are those of the author and are not necessarily those of TechRadarPro or Future plc. If you are interested in contributing find out more here: https://www.techradar.com/news/submit-your-story-to-techradar-pro

Dan McConnell is the Senior Vice President of Product Management and Enablement at Hitachi Vantara.

Read more
A profile of a human brain against a digital background.
Navigating the rising costs of AI inference in the era of large-scale applications
Image of someone clicking a cloud icon.
Five ways to save time and money with your IT in 2025
Digital clouds against a blue background.
Navigating the growing complexities of the cloud
Cloud computing graphics.
Cloud repatriation – how to balance repatriation effectively and securely
Data center racks with cables and servers
The tipping point for AI and Managed Cloud
A graphic showing someone on a tablet working through a supply chain.
Optimizing supply chains to reduce consumer costs
Latest in Pro
Epson EcoTank ET-4850 next to a TechRadar badge that reads Big Savings
I found the best printer deal you won't see in the Amazon Spring Sale and it's got a massive $150 saving
NVIDIA RTX PRO 6000 Blackwell Server Edition
Nvidia's most expensive Blackwell card gets massive price cut but it is not the RTX 5090
Microsoft Copiot Studio deep reasoning and agent flows
Microsoft reveals OpenAI-powered Copilot AI agents to bosot your work research and data analysis
Group of people meeting
Inflexible work policies are pushing tech workers to quit
Data leak
Top home hardware firm data leak could see millions of customers affected
Representational image depecting cybersecurity protection
Third-party security issues could be the biggest threat facing your business
Latest in News
Buzz Lightyear Space Ranger Spin Rennovations
Disney’s giving a classic Buzz Lightyear ride a tech overhaul – here's everything you need to know
Hisense U8 series TV on wall in living room
Hisense announces 2025 mini-LED TV lineup, with screen sizes up to 100 inches – and a surprising smart TV switch
Nintendo Music teaser art
Nintendo Music expands its library with songs from Kirby and the Forgotten Land and Tetris
Opera AI Tabs
Opera's new AI feature brings order to your browser tab chaos
An image of Pro-Ject's Flatten it closed and opened
Pro-Ject’s new vinyl flattener will fix any warped LPs you inadvertently buy on Record Store Day
The iPhone 16 Pro on a grey background
iPhone 17 Pro tipped to get 8K video recording – but I want these 3 video features instead