It all started with a simple Slack message.
If you need a refresher, gross margin is a business metric that calculates what percentage of revenue you take home as profit. To calculate it, you subtract your costs (often abbreviated as COGS, short for costs of goods sold) from your revenue and divide it by your total revenue, et voilà, gross margin.
So, if your annual revenue is $10M and your COGS are $3M, your gross margin is 70%.
Gross margin plays an integral role in SaaS company valuations. It’s directly correlated to higher-level metrics like free cash flow margin, LTV:CAC, CAC Payback, and others, which function as barometers for how healthy the company is.
Elite SaaS companies post gross margins of 80% or more. In January 2022, when my CEO pinged me about gross margins, CloudZero was hovering around 50%.
We had a problem.
We were in a dilemma that should sound familiar to other startups, especially those in the SaaS space. We had a good product delivering real value to our customers and were in scaling mode.
We were also adjusting to a market climate that, for the first time in years, had begun to value profitability over growth. To cap it all off, we were prepping to raise our Series B — a round in which investors focus seriously on metric performance.
It wasn’t enough to strengthen our product to stay competitive in this market. We had to improve our business fundamentals, too. Gross margin was at the top of the list.
How Do You Strengthen Your Gross Margin?
There are only two things a company can do to strengthen its gross margin. Recalling that the formula is (Revenue – COGS) / Revenue, you can either increase your revenue or decrease your COGS.
Since there was already a lot of focus on increasing revenue, we also decided to spotlight COGS.
Now, our COGS breaks into a couple of different categories of cost. We’ve got our “support” costs — i.e., the customer success teams who bring FinOps expertise to our users.
Then, we’ve got our cloud costs — the cloud resources we consume to deliver a 100% serverless platform to our customers.
Cloud costs represented 76% of our COGS, with support filling out the remaining 24%. So, like Netflix, Twitter, Airbnb, and countless others, we decided to go after the big slice first: our cloud costs.
Fortunately, I Had Free Access To CloudZero
CloudZero exists for the express reason that companies get into dilemmas like ours. They spend too much on the cloud, their margins suffer, and when markets get tight, they feel the pain all the more.
So, we embarked on a yearlong project: Use CloudZero to raise CloudZero’s gross margin.
Step 1: Allocate our spend
Spend allocation is a crucial — and for many companies, excruciating — first step in getting your cloud costs under control. Perfect (or near-perfect) allocation shows you what business units you’re spending money on and how much you’re spending on each.
Allocation is vexing for most companies because they tend to do it solely with tags. Tagging is time-consuming and impossible to perfect.
It requires engineering effort, its frameworks must be correctly set ahead of time (problematic if you acquire/get acquired by a company with a different tagging framework), and it can’t handle shared or untaggable resources. That’s why CloudZero developed CostFormation, a code-driven cost allocation method that allocates 100% of cloud spending without additional tagging.
So, our first step was to have CostFormation break our cloud spending into three main categories: POCs (i.e., the free trial as part of our sales process), R&D, and Customers (i.e., the Direct COGS to deliver our service). Here’s what we found:
The dark blue segment — Direct COGS — was the only segment of our cloud costs that impacted our margins. Without first measuring that, it would be impossible to estimate the value of any potential savings project.
We then had to understand what was driving our Direct COGS. As with any cloud environment, not every COGS driver is equal: Different features contribute to it; specific customers impact it more than others; various features drive different cost levels.
Understanding how each contributed to our costs would make it possible to embark on meaningful savings projects. So, we set up Dimensions for Cost Per Feature, Customer, and Team.
Step 2: Optimize billing ingest
At a high level, CloudZero does two main things: 1. We ingest our customers’ billing data (invoices from AWS, Azure, GCP, Snowflake, Databricks, and other cloud vendors), and 2. We analyze it in a way that mirrors the structure of their business — and makes it actionable.
We wanted to focus on the spending impacting our gross margin, which was the cost of supporting our customers.
We allocated costs within that customer segment, breaking it into feature sub-components: Billing Ingest, Anomaly Detection, Embedded Dashboards, Web Applications, Resource Ingest, etc. Here’s what that looked like:
There’s a clear place to start: Billing Ingest, the process of ingesting 100% of our customers’ cloud spending. Looking at the metrics below the bar graph, Billing Ingest represented the highest Total Cost and posted the highest Cost of Change (in terms of dollar value).
By this point, we’ve taken a vast problem — improve our Gross Margin — and made it more and more specific:
Improve Gross Margin → Reduce COGS → Optimize Billing Ingest Feature
We got this far by leveraging CloudZero to highlight our top-line items. It took three clicks in the CloudZero platform to get to this point — a minute’s work.
Now it was time to start saving money.
What We Did: We realized we had been processing customer billing data inconsistently across customers — and in some cases, more often than was necessary.
So, we took a couple of our most expensive customers (analyzing at CostFormation’s Cost Per Customer level) and started only processing data when it would provide value to our end users.
The cost of our Billing Ingest feature, sorted by customer. Those colorized tags are Customer IDs (actual customer names hidden for privacy).
Ultimately, this reduced our data normalization work by about 3x. The change resulted in annualized savings of 1,098,000 — the best part was it took only two hours to implement. It was an engineering-led optimization we could perform with very little actual engineering work.
Step 3: Optimize our vendor contracts
$1,098,000 was great. But it wasn’t enough.
The next thing we looked at was our vendor contracts. Traditionally, if you want to save money in the cloud, the most accessible place to start is with committed use discounts. You commit to a certain usage level at the beginning of a 1- or 3-year stretch, and your cloud provider (AWS, Snowflake, etc.) gives you a discount.
We first ensured we used the most straightforward committed use discounts (Reserved Instances and Savings Plans). We then moved on to more complicated ones, figuring we’d probably start with the Amazon Enterprise Discount Program (EDP).
But after using AnyCost to ingest and sort our spending by vendor, we found that Snowflake had come to represent 63% of our cloud spend.
At this point, I sound like a broken record: Focus on the top line item first. Also, focus first on the areas which require the least disruption to the engineering roadmap — prevent cloud cost from getting in the way of engineering objectives.
Having used CloudZero to understand our unit costs, it was easy to forecast our likely future Snowflake spending and commit to more usage with Snowflake in exchange for a better rate. We ultimately got a much better deal, resulting in $145,000 of annual savings — with zero engineering effort invested.
Step 4: Engage Engineering
To this point, we had resisted engaging our engineering teams too much because they were swamped pushing out many other features (Budgets and AnyCost chief among them). But the most impactful savings come from engineering and architectural changes, not committed use discounts, and waste optimization. So, the next step was engaging our engineering team.
Knowing that Billing Ingest was still our most expensive feature:
- We engaged the engineering team responsible for Billing Ingest, explained the problem, and got them the data they needed to embark on an engineering-led optimization treasure hunt.
- Surprisingly, they zeroed in not on Billing Ingest but on our Anomaly Detection feature, which queries billing data in search of unusual spending activity (and was also quite expensive).
- Luckily, they had developed a tool to materialize data for end users that could easily be applied here for substantial savings.
This engineering-driven optimization immediately reduced the cost of Anomaly Detection to the tune of $219,000 on an annualized basis. All told, this took us less than a day of effort to apply that existing feature to this area once the CloudZero platform highlighted it for the engineerst.
Step 5: Monthly FinOps check-in
By this point, we’ve reduced our annual cloud costs by $1,462,000 and invested about 6 hours of actual engineering effort. Still, the savings projects have had little impact on day-to-day engineering activities. Of course, we’ve had several leadership meetings about how to solve the gross margin problem.
Still, we’re not where we want to be yet. So, we instituted a monthly CloudZero FinOps check-in — treating ourselves like a CloudZero customer.
Sure enough, with cost data laid out in an easy-to-understand way, engineers started to find some weirdness in how our Telemetry Streams feature was set up. One of our FinOps analysts logged an Insight (CloudZero speak for savings recommendation) about it, and in a day and a half of effort, our engineers cleaned it up.
Result: $67,000 in annualized savings. This was the combined result of customer success and engineering expertise — the kind of optimization an automated platform could never surface.
Step 6: Doing their own optimization hunts
As a result of these monthly reviews, our engineering culture started to shift. Members of our engineering teams got in the habit of logging into our system and doing their optimization hunts. Soon, one came to us with another recommendation. Here’s how he found it:
- As our customer base grew, the use of our web app exploded, with hundreds of new engineering users logging in from new organizations.
- Serving data to accommodate the new demand started to get expensive.
- As a serverless company, one of our first principles is to spin up resources as needed.
- Our engineer realized that instead of a one-size-fits-all method, we could predict what size resource a user’s request would warrant — and often spin up smaller-than-average resources, saving us lots of money.
After prototyping the idea successfully, we rolled it out across our customer ecosystem. Immediately, costs started dropping by an annualized total of $144,000.
Importantly, this resulted from a culture shift — the engineers who drive cost see the cost consequences of their decisions and take savings into their own hands. Automated savings could never replicate this effect — and, by shifting accountability away from engineers, could detract from a culture of cost accountability.
Grand Total: $1.7M In Annualized Savings In 2022, 10% Improvement In Gross Margin, And Stronger Unit Economics
We invested 54 hours of staff effort. We reduced our cloud costs by $1.7M.
Even more encouragingly: 88% ($1.498M) of these savings came from our engineers. Not from rightsizing or RI management but from CloudZero cost intelligence combined with our engineers’ understanding of the platform and its underlying code.
Returning to our initial business goal, we made a 10% improvement in our gross margin last year by managing our cloud costs more effectively.
Looking ahead to 2023 and beyond, we understand how much cloud spending we’ll need to onboard to reach our quarterly and yearly goals. Our unit economics knowledge lets us estimate margins for customers based on their cloud spending and strategize accordingly.
So, would CloudZero have been a worthwhile investment?
If CloudZero were a CloudZero customer, our yearly cloud bill would warrant about a $50,000/year contract. It cost us about $17,000 in engineering hours to find these savings. Subtracting a $67,000 project cost (CloudZero platform cost plus engineering cost) from $1.7M of savings gives about $1.6M of project profit — a 24x return on CloudZero investment.
Had we been considering CloudZero as a vendor, it would have been a no-brainer.
… And You Can, Too
This is what we do for our customers every day. We ingest 100% of their cloud spend, organize it in a context that mirrors their business, send it to the engineering teams responsible for the relevant business units, and make it explorable and actionable.
Ultimately, engineering-led optimization leads to higher engineering engagement and greater cost savings than an automated approach.
It’s not just about giving your cloud bill a haircut. It’s about strengthening your organization: Finding savings to boost critical metrics, setting and fulfilling business objectives, shoring up your business fundamentals, and changing your culture for the better.