Podcast about DevSecOps

#59 - Migration Off The Cloud: To Leave or Not to Leave?

A cheaper server quote can leave out staffing, spare capacity and the services a cloud bill already covers.

18 min read

Is the grass greener outside the cloud? This episode dives into the trend of companies (notably Hey and Dropbox) migrating away from cloud services. Why are they leaving, and who would benefit from such a move? We also scrutinize the common belief that public clouds are overly expensive. Join us as we dissect various cloud cost optimization tools and techniques.

Discuss the episode or ask us anything on LinkedIn


The bill went up, and someone forwarded you the cloud exit post

Your cloud bill has grown for three quarters straight, and somebody in finance noticed. Now there’s a link to DHH’s Why we’re leaving the cloud in your inbox with “thoughts?” above it. By Friday you’re expected to produce a number: what would it cost to buy the servers instead?

That number is easy to produce and usually wrong, because it compares the two things that are easiest to count. A virtual machine with eight cores and 32 GB of RAM against a box with eight cores and 32 GB of RAM. Priced that way the box wins, and it isn’t close. The box doesn’t come with the person who racks it and keeps it running. You buy a second box so the first one can fail, plus idle capacity so a test environment has somewhere to run. And when an auditor asks in March for evidence that the infrastructure underneath is controlled, that evidence comes with the cloud bill, not with the hardware. Evidence for your own controls stays your job either way.

The companies in the headlines are worth reading properly rather than as a slogan, because their numbers are public and their decisions are narrower than the summary. And the money that’s easiest to save isn’t in a migration at all. It’s in the bill you already have.

The exits in the headlines are partial

Start with what those exits actually were, because “leaving” is doing a lot of work in the headlines.

Does anyone leave the cloud completely?

Neither 37signals nor Dropbox had fully exited by January 2024. Both moved the predictable majority and kept a remainder, and the two remainders aren’t alike. 37signals kept its customer files in S3. Dropbox said it would carry on with Amazon “where it makes sense for our users, particularly globally”, including an expanded AWS relationship in Germany so European business customers who ask for it can have their data stored there.

37signals published its arithmetic, which is why it’s the useful example. The February 2023 post that set out the plan put 2022 cloud spend at $3.2m. Just under $1m of that went on storing 8 PB of files in S3, with its own exit due in 2024. Against that it budgeted about $600,000 of Dell hardware over five years and about $60,000 a month for eight dedicated racks: “a total of $840,000/year for everything”. Mind the boundaries on that figure. It is amortized hardware, racks, power and bandwidth, and it leaves the S3 spend out. The $7m over five years everyone quotes is measured against $2.3m of non-S3 spend rather than the full $3.2m. By September 2023 spend excluding S3 was down about 60%, from around $180,000 a month to under $80,000.

Read it as a shape, not a verdict: the compute moved, the storage stayed, and the hardware lives in somebody else’s building on somebody else’s power.

Money is the motive we’d put first in both, and in neither case is it the only one. Dropbox’s Magic Pocket write-up calls performance “one of our key product differentiators” and puts “better unit economics” beside it. 37signals’ December 2023 FAQ points at “the larger values, beyond just cost”, “things like independence and loyalty to the original ethos of the internet”. Still, if renting a car cost the same as owning one, most people would keep renting. The sums change when the rental is six figures a month. At that size you have an option that doesn’t involve a loading dock: you tell the provider how much compute, storage and bandwidth you’ll commit to. They quote a rate well under the public one, and you stop paying list price. Software bought through AWS Marketplace arrives on the same AWS bill, and eligible purchases draw that commitment down. That is part of why so much third-party software is sold there. What qualifies depends on the product and on your agreement.

Owning hardware is a bet on a predictable workload

Negotiating a rate works because your usage is known. So does buying hardware, and that’s the real qualifier.

Who is a cloud exit actually for?

Teams whose workload has stopped changing shape, and who have the people to run machines.

For small teams without hardware operations experience, we’d start in the cloud. You pay as you go, take what you need, and shrink the bill in a bad quarter without having sold anything. Then you grow, the bill grows, and somewhere past the point where it hurts you acquire leverage: you’re too big to lose, so you get a rate. Further along, if the workload has settled into something you can draw on a napkin, buying it becomes arithmetic rather than a gamble.

Dropbox is the canonical version. Its 2018 S-1 puts it plainly: “During 2015 and 2016, we migrated the vast majority of user content to our own custom-built infrastructure.” The company had been built on S3. Its own account of the Magic Pocket launch in March 2016 describes the custom hardware and software that replaced it, by then serving over 90% of user data. When storage at that volume is the product, the unit economics of storage are the business, and nobody else’s margin belongs in them.

There’s a less flattering pattern underneath the same decision. Companies start hunting infrastructure cost when the balance sheet gets tight, rather than while things are going well. If a dollar of compute returns ten dollars of revenue, nobody counts the dollars. Counting begins when growth slows, or when a company goes public and has to show a margin every quarter.

That isn’t an argument against owning machines. It’s an argument for naming who operates the hardware three years out, before the quote gets signed.

The costs that never make it into the comparison

Those operating costs are where the line items nobody put in the spreadsheet turn up.

What does the hardware quote leave out?

The people, the spare capacity, and the week you lose to one server that won’t boot.

We run physical servers in one of our day jobs, so this isn’t theoretical. Machines bought in different years from the same manufacturer behave differently, carry different firmware settings, and need their own handling. Racking takes time, configuring disks and RAID takes time, and it has to be right the first time. Storage becomes a running argument rather than a line item: how much is left, how fast is it, what happens when a team needs 20 TB next month. One of us once spent a week working out why a single bare metal server wouldn’t boot, over something small. That week wasn’t spent shipping anything.

Capacity is the part that quietly doubles the quote. A service that uses ten cores doesn’t run on ten cores of hardware, because one machine has to be able to fail. Disks get replicated for the same reason. Non-production is worse. In the cloud you can give every merge request its own environment and tear it down an hour later. On fixed hardware that capacity has to exist all year whether or not anyone is testing. Teams size the purchase against production, then find that integration testing has nowhere to live.

Then there’s everything the provider absorbs that never appears on either side of the comparison.

The honest counter-argument comes from 37signals, and it has receipts. The February plan promised the move would come “Without changing the size of our ops team”. The September follow-up said it had: “our ops team stayed the same, for example.” That is a real result, from a team that had run its own infrastructure before. They kept a colocation partner for the building and the power, and left 8 PB of files in S3 while they went. It settles what their team could do, not what yours can, and the gap between those two is the decision.

You’re comparing a hyperscaler against a VPS

The headline comparison has a second flaw, and it’s the one that makes the cloud look overpriced.

Why does the cloud look expensive?

Because most comparisons price it as a virtual machine rental, which is the thing it’s worst value at.

Rent a virtual machine from a VPS provider and you get a virtual machine. Compared like for like, you’re right, the hyperscaler costs more. What arrives with it is a catalogue you’d otherwise build: identity and fine-grained permissions, event plumbing, managed databases, key management. AWS KMS charges $1 per key per month, prorated hourly, and you can delete the key when you’re done. Doing key custody properly yourself means hardware security modules and the people who operate them, which is a capital project rather than a line item.

Compliance tells the same story from the audit side. When a customer asks for evidence that the infrastructure under your product is controlled, AWS Artifact gives you the SOC, ISO and PCI reports on demand, at no charge. Those reports cover the provider’s controls, not yours, so the evidence for what you run on top is still yours to produce. On Fargate you have no access to the underlying instance at all. That sounds like a limitation until an auditor asks who patches it, and the shared responsibility model answers for you.

So, is the cloud expensive? Measured as compute per hour, yes. Measured as total cost of ownership, including the salaries of the people who’d be doing all of the above, we’d say it comes out cheaper for most teams. The smaller the team, the surer we’d be of that. The one thing the cloud won’t do is stop you overspending. Providers can recommend savings, but your team has to act on them. Trusted Advisor has emailed opt-in weekly status updates with savings estimates since December 2013, and the deleting is still yours to do.

Work the bill before you price the racks

Which makes the comparison you were asked for premature. Find out what the same workload costs when somebody actually works the bill.

Where do you look first when a bill is too high?

At what you’re already running on demand and could commit to, because it needs no code change and no migration.

Reserve the things that don’t move. Savings Plans cover EC2, Fargate and Lambda at up to 66% off on demand in exchange for a one or three year commitment. Reserved Instances do the same for the expensive stationary services, with RDS quoting up to 69% in steady state. This is console work. The utilization and coverage reports show what you’ve been running, and the recommendations page proposes what to buy.

The objection is always commitment, and it deserves a straight answer: a reservation is binding. You can’t cancel a reserved DB instance, and you owe the contracted payments throughout the term, whether or not you use the reservation. On RDS the discount only lands on usage matching the reservation’s Region, DB engine and instance class type.

So buy for the databases whose next year you’re surest about, leave the rest on demand, and come back when the pattern holds. Savings Plans make that easy, since the commitment is dollars per hour: pick the spend you’d still be making in a quiet month, and raise it later. No upfront suits what you’re reasonably confident about, all upfront the handful certain to still be running in three years.

What this does need is conversation. Someone has to say which workloads are permanent and which are a pilot nobody switched off, and that someone doesn’t work in finance.

Nobody owns it, so nobody deletes it

Those conversations turn up the second category on their own, usually in the form of a shrug.

Which resources leak money quietly?

The ones a developer created on a Tuesday for a good reason that expired a year ago.

We’ve written the same small automation for several clients. A function finds EC2 instances without the required tags, posts the list to Slack, and terminates whatever nobody claims by the deadline. The tag requirement does the real work, because an instance with an owner is an instance somebody can be asked about. Detached EBS volumes go the same way. Backups take two passes. Amazon Data Lifecycle Manager expires snapshots and AMIs on a policy rather than on somebody’s memory. It can’t manage snapshots or AMIs created by any other means. So the pile from before you turned it on needs its own clean-up.

Audit logs answer the question that stops people deleting anything: is anyone using this? Check the coverage before you trust the silence. CloudTrail doesn’t record S3 object-level data events unless you turn them on for that bucket. An empty result then means nothing was watching rather than nobody was reading. With the logging in place, you get a conversation instead of a guess. Tags turn the same data into an answer about who spends what, and 10% off the biggest spender beats 90% off something small.

Traffic hides under names that don’t look like network decisions. Name the path before you price it. Traffic between your instances across availability zones is charged a cent a gigabyte on each side. Managed services follow their own rules, and some charge nothing: RDS doesn’t bill for Multi-AZ replication or for same-Region read replicas. Anything your instances send out through a NAT gateway is charged per gigabyte on top of the hourly rate. S3 and DynamoDB traffic belongs on a gateway endpoint instead, where there’s no charge at all. Storage has its own version, where objects nobody reads sit in the class you pay most for. Leave anything that needs developers to change code until last, because that’s the one that needs their roadmap.

Compare days, not months

None of that triage works without numbers you can compare, and the default view makes comparison harder than it needs to be.

Why does your bill look worse in March?

Because March has 31 days and February has 28 or 29. Divide each month’s cost by its own day count before you compare the two.

Every April somebody panics about a March bill that grew while usage stayed flat. On identical daily usage, March comes out about 10.7% above a 28-day February, and about 6.9% above a leap year’s 29 days. Normalize first, and then month over month tells you about your estate instead of about the calendar. We got tired enough of doing this by hand to write a small tool for it, which pulls the last three months from the AWS cost APIs. The spreadsheet it writes sets monthly totals beside normalized daily costs, and highlights what grew and what shrank. It also breaks the top services down by API operation, so you can see which calls spend the money. Annotate the sheet, export it as PDF, send it to whoever asked about the bill.

Granularity improved right before this recording. On 16 November 2023 Cost Explorer added resource-level data for every service at daily granularity, where it used to be EC2 only. Check the limits before you build a process on it. You have to turn it on, the resource view covers the last 14 days, and the console shows the top 5,000 resources per service. The Cost and Usage Report is still the full record. It does mean the old workaround, tagging a bucket with its own name to find out what that bucket costs, is on the way out.

Make it a rhythm rather than a fire drill: a monthly read of the normalized numbers, a forecast, and an alert for anything that moves suddenly.

A cost spike is sometimes a security incident

That alert earns its keep in a way the finance team doesn’t expect.

Can the bill tell you that you’ve been breached?

Sometimes, as a second signal rather than a first one. Unexpected billable usage can reveal some compromises, and the ones that move money are the ones you’ll see: data leaving the account, compute you didn’t start.

S3 charges for data transferred out, so somebody pulling a few hundred gigabytes from a bucket that normally serves little traffic puts a visible step in your S3 line. The same holds for EC2-Other, where NAT gateway processing lands: a sudden climb in outbound data is either a job nobody told you about or something worse. A mining cluster started on someone else’s credentials shows up the same way, as compute nobody asked for.

Late is the word to keep, and quiet is the other one. Reconnaissance through IAM and STS can leave no additional usage charge, because calls to those two services are free. That isn’t a general rule: S3 bills per LIST request, so somebody walking a large bucket does add usage you could spot. AWS Cost Anomaly Detection has been free since it went generally available in December 2020, and it learns your spending pattern and alerts on departures from it. It also runs on Cost Explorer data, so it can take up to 24 hours to detect an anomaly after the usage happens. That beats finding out on an invoice, and it doesn’t replace the logs and detection tooling that watch the activity itself. Sometimes the alert is a developer who has no idea what they switched on, and you want to catch that early too.

If it turns out to be unauthorized activity, AWS’s guidance on compromised accounts walks through the remediation. Take the disputed charges to AWS Support once the account is secure.

What this means for teams

Three conditions make a partial exit a real option. The workload has settled into a shape you could draw on a napkin. Someone has priced what replaces every managed service you’d give up, and what it costs to operate: 37signals moved off Aurora, RDS and OpenSearch, and storage was the whole reason Dropbox went. And you have people who have run hardware before. Where all three hold, the published arithmetic is detailed enough to copy the method from. For everyone else the money is in the bill you already have. A week of work there is a fair comparison against a project that will own your roadmap for a year.

Four things worth doing this week:

  • Normalize your last three months to a daily cost and look at the trend. If it’s flat, the growth you were called about is the calendar.
  • Buy one reservation, on partial coverage. Pick the database you’re most certain about, take the no upfront option, and leave everything else on demand until the pattern is clear.
  • Turn on cost anomaly detection and route the alert to a person, not a shared mailbox nobody reads.
  • Add the missing lines to the hardware quote before anyone presents it. Failover capacity, non-production capacity, on-call, racking time, and whoever produces the infrastructure control evidence you download from your provider today.

Common questions, answered

How do I compare AWS costs against buying our own servers?

Build both sides as a five-year total cost of ownership, with the people in it. The hardware side is the machines, the failover machines, idle non-production capacity, colocation, power, bandwidth, racking time, and the salaries of whoever does that and carries the pager. Add what you’d be rebuilding: key management, identity, managed databases, the provider’s compliance reports you download today. Price the cloud side after optimization, with reservations on the stable workloads and the waste deleted. Comparing an optimized rack against an unoptimized cloud bill is how teams talk themselves into a year of migration for a saving they could have had in a fortnight.

Are RDS reserved DB instances too risky if our workload might change?

Cover only the databases you’re sure of, and leave the rest on demand. An RDS reserved DB instance is a one or three year commitment you can’t cancel. You owe the contracted payments for the whole term whether or not you use it. The discount applies only to usage matching the reservation’s Region, DB engine and instance class type. Your exposure is the coverage you bought, not the number of purchases you split it into.

What should I do when the AWS bill suddenly spikes?

Treat it as a possible security incident before a billing question. Find the service and usage type that moved, then check whether the usage is yours. A jump in S3 data transfer out or NAT gateway processing can be somebody pulling data out of your account. If it’s unauthorized, follow AWS’s compromised-account guidance, rotate the credentials, and raise the disputed charges with AWS Support. If it’s legitimate, you’ve found an optimization target. Either way, turn on cost anomaly detection: it takes up to a day to spot the next one, which still beats the invoice.

Resources

Since we recorded

On 5 March 2024 AWS began waiving data transfer out charges for customers moving all their data off AWS, on request and reviewed per account. 37signals kept publishing numbers, and by October 2024 the bill was down from the original $3.2m run rate to $1.3m, all of it S3. In March 2025 it reported almost 6 PB still to move out of S3 onto Pure Storage arrays already racked in its two data centers, with the S3 contract’s 30 June 2025 expiry as the departure date. We came back to the leaving question from the European side in Episode 79, Going local, and to the cost and lock-in trade-off in Episode 90, K8s vs managed services.