(Pictured above: Google’s first home built server)
I’m somewhat more experienced than most undergrads when it comes to web infrastructure, hosting etc. For short background, I’ve been hosting various servers in my house, in my basement, even in my bedroom, at various times throughout high school and now, in college.
In this article I outline the the pros and cons of three approaches to hosting your software infrastructure.
- Option 1: Completely managed hosting, e.g. Amazon Web Services
- Option 2: Managed but mostly up to you hosting e.g. Digital Ocean
- Option 3: Host it yourself e.g. Have your own servers on-premises
Let’s start with Option 1:
AWS, or Amazon Web Services, has become the de facto standard for completely managed cloud-based computing. The way it works is similar to how other clouds work, but with one very important distinction, or at least, option that is available to you (Lambdas): You only pay for what you use.
If you have an application that is only occasionally used, you only get charged for the time it is actively in use. For example if you write a small web application that will only get used during the school year, then you only pay for the time that students are actively accessing that app.
This is a major draw for startups that get a lot of traffic, but only for small periods of time. This is very different from other cloud providers that charge a flat rate for the entire month.
The other major difference is that you do not have control over your servers, and you don’t own the servers that you rent from Amazon. If what you care about is focusing on business, and don’t want to get involved in the nitty-gritty of managing servers, then this is a great choice. Even students can afford AWS now.
“Managed” but mostly up to you hosting e.g. Digital Ocean.
Digital Ocean is a very popular cloud hosting provider. They have several locations in Europe, as well as in the US. They’re also affordable for CS students.
They have an excellent interface, and are very easy to set up. You can spin up a whole server with a single click, and it’s very easy to do backups, and other maintenance tasks. They also have a very good security model: Nothing is open for you to start with, the firewall is totally up to you and you have to know what you’re doing. Once you spin up a server, any old person can’t just SSH directly into your server. Instead, you have to configure SSH carefully. This encourages you to do the proper research before just opening ports to the world.
However, unlike some of the options in AWS (such as Beanstalk), you do have more control over your server. You can SSH into it from your computer, and modify it at a low level, there’s nothing else there, really.
So how much control do you have?
Well, on AWS Beanstalk, if you want to make major changes, e.g. you want to change how the load balancer works, then you have to contact their support to do that for you, if it’s even possible.
With Digital Ocean, you have to build the load balancer yourself! However, then, you can change all the little things, such as the owner of a file, or the permissions of a folder.
In general, you have just enough control to manage your own server, but not enough control to set it up completely from scratch. That tends to be the sweet spot for most web-based applications. So if you want to use Digital Ocean, great! Just don’t try to host something like a custom kernel server. Digital Ocean is not very good for that, out of the box.
Host it yourself e.g. Have your own servers on-premises.
This is the one I am the most familiar with. As I said, I’ve been running my own servers since high school. The first thing you need is a physical machine. I’m a fan of Dell servers, but there are other, more expensive options. Certainly, cost may be a factor here, if you’re on a student budget like me.
Next, you’ll need to install an operating system on it. Linux is a good choice for most web applications. For Ubuntu, the LAMP stack is easily installable with a nice quick installer option.
Once you have your server, if you don’t want to go with a pre-made LAMP stack, you’ll need to install Apache, MySQL (or MariaDB), and PHP (or your own choice of language) These are the three main elements of a web stack.
When setting up your database, there are several options. If you do a lot of writing (as opposed to reading from the tables), then a database like MariaDB or PostgreSQL may be a good choice.
If you do a lot of reading (e.g. you have a lot of incoming data that needs to be saved), then something like MongoDB paired with Redis may be a good choice. The obvious downside of this option is that you have to maintain the server, and you have to keep it updated.
If you’re comfortable doing that, then this is a good option. It gives the most freedom, but also requires the most maintenance.
If you’re just starting out, I recommend Digital Ocean. I’ve used it for dozens of projects. It’s very easy to use, and it’s relatively inexpensive on a student’s stipend.
If you need more control over your servers, then have your own servers on-premises is the best option. However, you’re going to have to do a lot of maintenance.
This is the option I recommend for most scale-up developers. Once you get used to having your own servers, it’s hard to go back to a managed provider.