The Small Business Case for Cloud

Cloud in blue sky
Photo by Alex Machado / Unsplash

I keep thinking about comments online lately around the cost of cloud computing services vastly outweighing running your own hardware. I've long believed that hosting a small scale service in the cloud is cheaper than hosting it on-premise, but things change and it's always worth reevaluating.

The "Example" Business

Hopefully this is representative of a standard startup stack. We have a few separate websites, a console program to run out-of-process and scheduled jobs, a database, file storage, and an in-memory cache service. Double all of that for a staging/test environment. Load increases during working hours but is relatively calm afterwards. Like any SaaS, uptime is critical.

Azure

Other cloud providers should have equivalents or something very close. Azure is what I'm most familiar with so that's what I'll use here. Our service uses:

  • 3 app service plans for websites
  • 1 app service plan for console program
  • Azure SQL database
  • Azure Blob Storage
  • 1 VM for Redis

Double all of those, running at lower tiers, for the test environment. With a little load based autoscaling and a capacity reservation for the SQL server we spend roughly $3,000 - $4,000 per month with Azure. Assuming the high end of that range, we're looking at $48,000 annually.

Running a service in Azure gives us a lot of benefits outside of just "run my code". Here's a few:

  • Backup and restore that just works
  • Scaling out/in/up/down in button clicks, with the exact cost
  • The time to try something new is low – you can go from thinking about Redis to having a completely configured highly available multi-node Redis cluster in about 60 seconds
  • Infrastructure security questionnaires from customers are quick & easy to answer
  • Easy dashboarding for service metrics
  • Configurable high availability

On Premise

Data center servers
Photo by Taylor Vick / Unsplash

First, a disclaimer: I've never had experience building an on-premise "data center". For comparison sake I'm going to lump together all of the services, assuming that we can break them apart into virtual machines and/or containers as needed. Since we can't scale automatically we'll need to plan for the worst to make sure we have headroom. At peak we'll say we use 34 CPU cores, 3 TB of disk storage, and 100 GB of RAM at minimum. We'll need to add additional overhead to allow room for growth and for reserve capacity in case of hardware failure.

  • $2,000 for 2 1U barebones rack mounted server
  • $3,000 for CPUs
  • $200 for 3 TB SSDs
  • $320 for 128 GB RAM

Altogether let's call that roughly $6,000 to get 2 physical servers that exceeds the resources we use in Azure. Unfortunately those servers are just expensive paperweights right now. In order to get them running we're going to have to invest in a little infrastructure! Let's assume we're going to put these in our physical office location.

  • Power: We will need battery backups to prevent immediate downtime for main power outages. We'll also need a generator to power our servers until main power comes back (whenever that will be). Assuming we won't have someone sitting in the server room 24x7 we'll want to spend a little more to make sure failovers are automated as much as possible. Let's call this another $2,000 - $4,000.
  • Internet Access: We'll need a business line and a backup business line. Let's call that $400/mo, or $4,800 annually.
  • Networking: We'll need a business class router and firewall. $500.
  • Cooling: Servers generate heat that needs dissipated. With just 2 1U servers a single AC unit should be fine. $500.
  • Power, again: We need to pay for the electricity we consume.  Assuming 700 watts on average between all of our appliances, Indiana's relatively low $0.17/kWh average price, and a 720 hour month that comes to about $85/mo, or $1000 annually.

$10,000 up front for the year in infrastructure – assuming you have the space and knowledge to get all of this selected and installed correctly the first time. You'll likely need to hire specialists (e.g. an electrician) to get it done safely.

Next up: physical security. Having great network security means nothing if someone can just walk into your office, pull the disks out of the server, and walk away. You'll need to implement locks at least on the door of the server room, probably on the rack as well, and add security cameras (along with their associated expenses).

Then you'll want to think about business continuity in case something catastrophic happens to your office. At the very least that means backing up data to an offsite location. Or that could mean rebuilding your whole infrastructure again in a 2nd location – or colocating some hardware in a data center. To keep things simple let's assume that we'll just replicate everything in the main office. That brings our total to around $32,000 for the first year.

Now that we have our full environment it's time to actually use it. You'll need to hire someone who can manage at least:

  • Operating system and software updates
  • Hardware failures and upgrades
  • Networking
  • Web server setup
  • Virtualization
  • Backup management
  • SQL Server
  • Software licenses
  • Monitoring software

and you're going to rely on this person to do all of this with security in mind. Will this person be on call 24x7 for emergencies?

Comparison

We ended up at $48,000 for cloud hosting annually versus an estimated $32,000 in initial costs + a full time employee for an on-premise setup.

At this scale for a business, to me, sticking to cloud hosting is a no-brainer – at least unless we find someone willing to donate their time for free to manage the infrastructure. Even if all of the hardware was free it would still be cheaper to run it in a cloud than to hire someone. Once that math changes will be the time to look at switching.

Digression

For personal projects where you don't have as strict of requirements for availability the math suddenly flips the other way. Hosting personal projects in the cloud will be slower and more expensive. Spending the time to learning how to manage infrastructure on your personal scale is not only fun™ but may help you later.