To Cloud or Not to Cloud

Recently, there was an article circulating about how 37signals is migrating away from the cloud. This can seem counter-intuitive when there is so much information touting the benefits of running in AWS, Azure, GCP, etc. However, the decision to run in the cloud or on your own hardware is a complex one. Let’s break down the pros and cons:

The Case for Cloud Computing

There’s a reason that cloud computing is so popular. It’s fast, nearly infinite scale, and has high availability.

Fast Delivery

In the cloud, you can quickly spin up servers and services without all the hassle of ordering hardware, getting it racked and powered up, configured, keeping it patched, etc. With just a few clicks of the mouse, or some lines of Terraform, you can have an application up and running before lunch!

Want a MySQL database with full replication across multiple geographic regions? Click click!

Need storage for your vast image library? Tap tap tap!

When time to market is critical, running in the cloud is a great way to go.

(Almost) Infinite Scale

You just launched a new marketing campaign and it’s gone viral on social media. People love your product and are flooding your website with requests to buy your product or service. But that single server that was handling hundreds of requests a day isn’t ready to handle hundreds of requests a minute.

What do you do?

Spin up another one, and another, and another, until you’ve distributed the load to a manageable level. In the cloud, you can do this with just a few clicks. You can even arrange for it to happen automatically with auto-scaling rules!

In the cloud you’re not constrained by the amount of physical hardware you happen to have on hand. You just rent more from your cloud provider when you need it. While there are some quotas and limits, most of the time, it can feel like you have an unlimited amount of computers to throw at a problem or handle a burst in traffic.

Highly Available

Software has bugs, networks fail, hard drives crash. Such is the life of computing. The cloud providers have built in the redundancy and have the staff to make sure you don’t have to worry about such “trivialities”. Cloud providers usually guarantee between 99.9% and 99.99% uptime, depending on the service, with an actual uptime usually much higher than that. This means that they allow at most 1.5 minutes of downtime each day.

What this means is that your strategies for dealing with outages can be more relaxed. Yes, you should check error codes and decide what to do. But nearly every issue I’ve seen when running in the cloud was a result of something I did. Very rarely was it an outage in AWS. Running in the cloud allows you focus your efforts on your software and spend less time worrying about issues with the cloud services you utilize.

A Storm is Brewing

Running in the cloud isn’t all rainbows and unicorns in the sky. As with most things in life, all these wonderful benefits have a cost.

Costs Run Amok

The ease and speed with which you can spin things up in the cloud can get expensive. Each time you start something in the cloud, there’s usually a cost associated with it. Each hour you run a server, every megabyte you move in and out has a charge. It’s easy to become complacent when you see these costs listed as a fraction of a penny. But those fractions can really add up to some serious money if you’re using a lot of them.

Constraining your cloud spend takes discipline and effort. In some organizations, a dedicated person is assigned to monitor the cost of what teams are spending in the cloud.

Vendor Lock-In

Many of the services provided by the cloud providers have proprietary APIs. This means that if you want to move to another cloud provider, or even on to your own hardware, you’re going to have to rewrite some software. Even if you have reasonable abstractions in place, systems tend to evolve to expect certain behaviors from the cloud provider that may not be true when running against a different service.

You may not plan to ever move out of your current cloud provider, but if you do, it’s not as easy as just picking up your code and re-deploying it.

Laziness

The effectively infinite scale of cloud providers can lead you to take shortcuts. Need more servers to handle the incoming traffic? Just spin ‘em up! What? Maybe I should optimize my code? I don’t have time for that!

Catch that error thrown from the SQS call? Yeah, that’ll never happen. We have widgets to create!

When everything is so reliable and you can spin up more servers at a moments notice, it’s easy to become complacent. The hard work of making your application run at it’s best becomes less important, and bad habits can develop. You may get away with it in the short term, but when things do finally fail, you’ll wish you had taken just a bit more time to make your code more resilient.

DIY Computing to the Rescue?

Does that mean running your own data centers is the right choice? It depends. There are a few benefits to having control over your infrastructure:

  • Costs are more predictable. You know how many servers you have and can forecast how many more you’re likely to need. There might even be some tax savings associated with having your own hardware (check with your CPA)
  • You’re forced to be more deliberate about your architecture choices. When you’re constrained by the number of servers, you have to be more diligent about optimizing your code and handling exceptions.
  • You have full control of your destiny. If a cloud provider has an outage, there’s nothing you can do but wait for them to repair the problem. If you run your own hardware, there are fewer things that you cannot influence.

That said, you still have all the problems that cloud computing was invented to solve. You’ll need people to maintain the hardware. You will need subject matter experts, such as a DBA, to keep up with the care and feeding of your services.

The Answer: It Depends

So what should you do? There’s no right answer.

If you’re just starting up and you don’t really know if it will gain traction or what the scale of the demand will be. Running in the cloud makes a lot of sense.

If you’re more established, it’s murkier. From a cost point of view, it’s easy for cloud costs to spiral out of control and you might need to pay people to monitor and keep it in check. Running your own hardware limits the cost of the servers, but you have the expense of paying people to maintain them.

Is time to market more important than stable costs? Do you have the staff (or are willing to hire them) that knows how to maintain the servers and services you need? Do you need to be data center or cloud provider agnostic?

These are just some of the questions to consider when you decide if you should run in the cloud or not (or maybe even a little in both?)

Whatever you decide, it’s the right decision for you.

Question: Why did you decide to run your code in the cloud (or not)?