InterviewKata
Software architecture · Case study 06 · Cost and economics

37signals leaves the cloud

In October 2022 the company behind Basecamp and HEY announced it was leaving Amazon Web Services. It had spent $3.2 million on cloud in 2022. It bought its own servers, put them in racks it already rented, moved seven applications out during 2023 without growing its operations team, and by 2024 had cut the bill to $1.3 million, all of it file storage still under contract. It is the clearest public example of the rent-or-buy decision from Module 33a, and of the conditions that make buying win.

Real caseAnalysed from David Heinemeier Hansson's posts on 37signals' cloud exit (2022 to 2024), linked under Sources. All figures are theirs; the lab's defaults use them and say so.

1. The situation

37signals runs Basecamp, HEY (an email service) and several older applications: a mid-sized software business with a long history and a steady, predictable load. By 2022 it was spending $3.2 million a year on cloud. Just under a million of that was storing about 8 petabytes of files in Amazon S3, replicated across regions; about $2.3 million was everything else: application, cache, database and search servers, much of it as managed database (RDS) and search (OpenSearch) services. For HEY alone, database and search cost over half a million dollars a year.

The company already rented eight racks across two data centres from a hosting provider (Deft), at about $60,000 a month, with space to spare.

2. What mattered

3. The options

OptionGoodBad
Stay, optimiseNo migration; reserved-instance discountsStill renting at cloud margins for capacity that never varies
Buy servers for compute and databasesAbout $600,000 of hardware against $2.3 million a year; fits in existing racksCapacity must be planned and bought ahead; hardware failures are yours
Buy storage tooThe remaining S3 bill is over $1 million a yearS3 was under a four-year commitment until summer 2025, so it had to wait

4. The decision

Decision: Leave the cloud: compute and databases in 2023, file storage when
  its contract ends (2025)

Context: $3.2m cloud spend in 2022 ($2.3m compute/databases/search, ~$0.9m S3).
  Steady load. Eight racks already rented in two data centres, with spare space.
Decision: Buy ~4,000 vCPUs of Dell servers (2,000 per data centre, for
  performance and redundancy), deploy with our own tool (Kamal), run managed
  services (databases, search) ourselves. Move S3 data to our own storage arrays
  when the four-year S3 commitment expires.
Consequences:
  + Projected ~$1.5m a year saved on compute alone; faster hardware
  + Same deployment tool on any machines
  - We buy capacity ahead of need; no instant scale-up
  - We operate databases and search that AWS operated for us
  - Savings arrive only as one-year and four-year commitments run out
Revisit: if load becomes highly irregular, or a new product's growth is
  unknowable (the HEY launch case)

5. How it works: where the money went

The yearly spend, step by step, from the posts. Box text shows the annual run rate of each part.

6. The numbers

DHH's February 2023 estimate: $600,000 of hardware over a conservative five years is $120,000 a year; with the racks' $720,000 a year for power, space and bandwidth, $840,000 a year in total, against $2.3 million in the cloud. Try the same comparison with different facts.

Five-year totals. Defaults are 37signals' figures: $2.3 million a year of cloud compute, $600,000 of hardware, racks at $720,000 a year, no extra staff (their ops team stayed the same). Assumed: an extra engineer costs $200,000 a year; spiky load means buying hardware for a peak three times the average.

7. What happened

The applications were out of the cloud by mid-2023. The bill didn't drop at once, because compute and databases were on one-year commitments: by September 2023 monthly cloud spend excluding S3 was down from about $180,000 to under $80,000. The hardware ended up costing about $700,000 and was paid back by savings during the second half of 2023. In 2024, the first clean year, the cloud bill was $1.3 million against the original $3.2 million run rate, and all of it was S3, still under its four-year contract until summer 2025. For storage they planned two data centres of Pure Storage flash arrays (18 PB in total), for about one year's S3 bill, again fitting in the existing racks. The projected total: well over $10 million saved over five years, with the same operations team.

DHH is explicit about the limits: the comparison is "never fully apples-to-apples", someone without existing racks must rent them, and the cloud still makes sense very early on or with enormous swings in load.

8. Lessons

9. Your turn

  1. Do the math (15 min). Take your largest steady workload. What does it cost a year in the cloud? What would the hardware and space cost over five years?
  2. Find the commitments (5 min). Which reserved instances, savings plans or contracts would keep you paying after a move, and until when?
  3. Name what would flip it (5 min). Which fact (load shape, team, racks) would make staying in the cloud right for you?
Say it in the interview
  • "Should we move off the cloud to save money?" Compare five-year costs for the steady part of the load: hardware, space and power, and any extra people, against the cloud bill and its commitments. It pays when load is stable and you can run it with your existing team; keep the cloud for spiky or unpredictable work.

10. Check yourself

Which facts made buying servers pay off so quickly for 37signals?

Steady load removes the value of elasticity; existing racks removed most of the extra running cost.

Why didn't the cloud bill fall the moment the apps moved out?

Compute was on one-year commitments; S3 on a four-year contract until summer 2025.

By DHH's own account, when does the cloud still make sense?

Unknown or highly variable demand is what elasticity is for, as with HEY's launch.

11. Sources and further reading

SourceWhy
Why we're leaving the cloud (October 2022)The reasoning: steady load, cloud premiums, when the cloud makes sense.
We stand to save $7m over five years from our cloud exit (February 2023)The 2022 bill, the hardware order and the five-year math.
Our cloud exit has already yielded $1m/year in savings (September 2023)Monthly spend falling as commitments end; payback.
Our cloud-exit savings will now top ten million over five years (October 2024)The 2024 bill, the hardware's final cost, the S3 plan.
Leaving the cloud (37signals)Index of every post, including the FAQ and the Kamal tool.