For companies that build or deploy web software, a project sooner or later reaches the point where someone has to choose a server. Interestingly, this is sometimes a surprise. Not for the developers, of course, but for the client, because this extra cost is often missing from their budget when the project is planned. What is even more striking is that sometimes the client does not know why they need a server in the first place, let alone a domain. If that sounds like you, this text is for you.

I decided to put all these terms in one place for people who do not deal with IT (and even less with web software) every day, but do not want to be caught off guard when talking to a software house. I will try to explain every term very simply, sometimes accepting considerable simplifications (which my colleagues in the industry will certainly point out), so that the topic is easy to grasp for everyone interested. 

So let's start.

What is the difference between a server and a domain?

Despite appearances, server is a fairly broad term. Depending on the context, it can mean the application that "powers" a website (Apache 2 or NGINX), but also the place where our application will be made available to users. In a big simplification, it is a publicly accessible (or access-restricted) computer connected to the Internet, on which the finished project runs. As always, though, the devil is in the details, and it does not have to be a computer at all, but we will get to that later. What matters most for us is that it is a machine we have to pay for so that someone can use the application through a web browser or, possibly, a mobile device. It makes no difference whether the application is built for a general public or for one company's internal use.

Now imagine that the server is a library full of books and we want people to come and read them. Great: we have paid for access to the building (the library), filled it with books (the software) and are waiting for readers (users). But right now this library has a very ugly address, perhaps a string of numbers giving its geographic coordinates (a big simplification, but an IP address is the analogy). Would any reader try to find a building by its coordinates? Probably only a geocaching enthusiast (or a hacker). So we need a proper address that is easier for everyone to remember. And that brings us to the term domain.

A domain is nothing more than a nicely sounding text address used to find the particular server with our application. For example, if someone told you "hey, go to 91.185.189.246, you will definitely find this system useful!", you would tap your forehead or assume it is some kind of scam (especially since opening that address directly gets you nowhere). But if someone said "go to feedybacky.com", it would probably sound a lot more palatable, right? "feedybacky.com" is exactly an example of a domain that points to the IP address I gave earlier, which leads to the server hosting the application. This happens through so-called DNS servers, which is a somewhat different topic that I do not want to get into here, although I recommend this diagram, which explains it very well.

Of course, domains are not entirely simple either, as shown by the fact that typing the IP address above did not take you where you wanted to go. Virtual hosts, redirects and subdomains also come into play, but I think we will stop here, because this text is only meant to signal the topic and explain it briefly. It is worth mentioning that a domain is bought separately and renewed every year (note: renewal is usually more expensive than the initial purchase), and to point the address at your server, you have to do it with your domain provider. If you would like more on this topic, let me know in the comments.

To sum up this part: a web application almost always needs a server, while a domain is very often used but not required. Usually some domain (though not as nice sounding) comes with the server, and sometimes you can use the application through the bare IP address. Still, if you are building a business card website or an application you want to conquer the world with, you will not avoid buying a domain.

Why do I need a test server?

Sometimes you may come across the term "test server" or "development server", which developers ask for. Sometimes there is even more than one. Why would anyone need them?

Moving an application that has so far run on specially prepared developer computers, over which they have full control, to a production server is usually a critical moment when it turns out that something is not the way we dreamed it would be. I am leaving aside cases where the server is not prepared for the technology the software was written in, because that is usually a matter of miscommunication between you and the IT team. Servers, by design, are configured a bit differently and more "rigidly", and sometimes something needs polishing, a parameter has to change, or you have to talk something over with the administrator, and so on. In short, there will be a period when nothing works and nobody knows exactly why.

The second, more important point is that you will certainly want to get your application early for testing. To do that, it has to be published somewhere. That is what test servers are for. They are a fully fledged copy of the application, but with sample data, where you can "break" things as much as you like and test the software both functionally and for stability on the machine. It is recommended that such a server be as similar as possible (even identical) to the one the application will run on in production, so that we get as few surprises later as possible. Often you can buy one server and create two separate spaces on it, one for the test version and the other for the final one.

In large projects, more of these servers may be needed. On them you test different settings, or one is used purely to verify features and another, for example, to check how individual components integrate.

Hosting, virtual servers, VPS, dedicated servers, clouds

You already know you need a server. Great, you have the money and decide to buy a suitable service. But which one is suitable?

Servers are not all equal, and we have now arrived at what I mentioned earlier: a server does not have to be a physical computer. What is more, it usually is not. The market offers many server services at different prices, and a person who knows little about the subject can get dizzy trying to work out what they actually need. That is why, before we describe the individual types of services, I recommend that you discuss the server with your IT team BEFORE the project starts. Without this step you may not only buy the wrong server and waste money, but the software house (if it has no administrators to support it) may also struggle to use the purchased "machine" properly. Not to mention that developers choose the technology for building the software not only for the project, but also for the server it will run on. 

The first thing you need to know is that servers are either virtual or physical. As for the latter, you are probably right to expect that the server is an actual computer (a very powerful one) dedicated entirely to you. A more popular solution, though (if only because of the price), is a virtual machine: a part of one physical computer set aside for you, with a virtualized system running thanks to special software. And we will start with these virtual units.

The most popular and cheapest kind of hosting is a service called, well, hosting (or web hosting). With it you get a certain amount of space, access to the file system and databases, and a panel for managing settings and, possibly, a console. The advantage here is price and simplicity. This is the hosting that is most popular among non-technical people as well as developers working on simple projects, because standard software simply gives the fewest problems on it. If you want to set up a business card website on WordPress, this option is really all you need. The problem starts when the software installed on such a server is not enough for you. Very often it is PHP, MySQL, email and not much else. True, some providers offer much more and support you with harder issues. But you have to remember that with this type of service you should expect limitations (which are known before you buy the hosting, so it is no surprise) or additional costs.

For more demanding needs there are solutions called VPS for short, or Virtual Private Server in full. It is really an extended version of the hosting described above, with one very important difference: you usually get full access to a virtual machine, including root privileges (that is, the main Linux user). You still have to keep in mind that you are dealing with a non-physical system running on another machine, but it is your system. The advantage, of course, is much more freedom, in fact complete freedom. We are not limited in terms of the software we install on such a server (apart from special cases that break the law), and besides PHP we can add servers for Node.js, Python, Ruby and so on. The choice is yours. But this, apart from the higher price, can also be a drawback: we have to take care of everything ourselves and know how to install and configure each component. That is not always easy, especially when securing the server is involved. Here, too, the provider's staff will usually help us, but expect that a VPS takes more work.

For this reason, most VPS services are something in between the two forms discussed so far. For example, you do not have full control over the server (experienced administrators on the provider's side have it), but at your request they will install and configure all the necessary components or deliver a server with pre-installed packages. Most importantly, though, these are still virtual machines, which are fairly easy to manage and cheaper, but also slower than the next option.

That option is physical machines, known as dedicated hosting (a "dedicated server" for short). Here we really do have a computer to ourselves, which immediately raises the cost and slightly lengthens the time to start the service (it is not available right away, but, say, after 24 hours), because such a machine simply has to be installed in a data center. In terms of parameters, until recently this was the best solution, since only you use the resources of such a server. And since, as I mentioned, these are quite powerful machines, you can expect your software to run fast. As for configuration access, it does not differ much from a VPS: you can (and usually do) have full root access to the console, plus help from administrators when needed. The difference is that, for example, adding RAM to the server (which rarely happens) is not so simple, because the administrators really have to install that RAM physically. Although, unlike with many VPS plans, it is usually possible here.

At this point you may be wondering why not go all the way, buy a physical machine for the office and have not only software but also hardware control over a dedicated server. There are specific cases where this is done, but contrary to appearances it brings more problems than benefits. Looking after a physical server really means looking after it: reacting when the power goes out (or in case of fire), replacing worn components yourself, providing network infrastructure and secure access from outside (even if the server will serve software only for the company's internal needs, developers uploading fixes should at least have access from outside, not to mention the option of remote work), buying a public IP address, and so on. Believe me, hosting companies have all of this down cold, with properly prepared backup mechanisms and even the right building conditions. They also ensure the security of your data, because they are simply specialists in their trade. Apart from a few cases, or a wish to tinker yourself, there is no point in building a full server room of your own.

One more form of servers remains, very popular in recent years and also coming in various shapes: the cloud (cloud computing). In short, this means we are not buying access to a specific server (virtual or physical), but to a whole infrastructure within which we can use services such as hosting, virtual machines, database engines, disk space and so on. All of this sits on the provider's huge server farms (for example Amazon, Google or Microsoft), and our software is dynamically switched between them, so we pay for the machine's actual running time. In consequence, it is hard to calculate how much we will actually pay per month (despite the calculators the companies provide), because the amount varies. You also have to get used to the rules of the given infrastructure and its specific naming. So where are the advantages, you may ask. Well, this infrastructure gives us the best performance and stability of all those listed (at least in the average case). Thanks to the server farms and their internal management mechanisms, the cloud naturally gives us server replication, so-called load balancing (distributing the load when there are many users), flexibility, a temporary increase in power for a service that is currently in high demand, and practically unlimited disk space. Yes, all of this usually costs somewhat more per month than a dedicated server (especially since someone has to design the infrastructure properly and maintain it), but in return we get all these mechanisms that improve performance and the ability to restore the service, which is worth considering for really large services. Remember, though, that those services must be properly prepared to be placed in the cloud.

Summary

There is no single good answer to the question "which server should I buy", because everything depends on the size of the software we are building, our budget and the technology used. Sometimes there is no need to go beyond ordinary web hosting, and sometimes cloud technologies are worth a look. Above all, though, I hope you now understand how a server differs from a domain and when you need one and/or the other. That was the goal of this text: just to point out the most important features of each solution, so that you can find your way around the terms and know roughly what this is about.

At the same time, I encourage my colleagues in IT to add to the text in the comments and point out any mistakes. It is always better to have the full picture.

Best regards, Jakub Rojek