The question of a server always comes up when you want to launch your own blog, website or online shop - but what is it, really?
A server is a computer
In hosting ads, servers are cabinets packed with blinking lights and cables disappearing somewhere at the back. By definition, though, a server can be any computer with the right software and an Internet connection. An "ordinary" home computer can work as a server too - just a less powerful one than the specialised machines in a server room.
Hardware of a hosting server
Now that we know a server is basically a computer we already know, let's look inside. Unlike a home computer, a server for a website or a web application (so-called hosting) has some parts that are much more powerful (RAM, for example) and some it does not have at all, because it does not need them (like a graphics card). Hosting offers usually list these parameters:
- Processor (CPU) - affects how fast the software of your blog, website or shop starts and runs,
- Memory (RAM) - how much room the running software has, for example how much data a program can work on "at once",
- Disk space - room for the files of the software and for things like photos, documents and so on,
- Database - room for the structured data the software needs. It usually holds all the text you see on the blog, website or shop,
- SLA - the service level guarantee: how much of the time (say, in a year) the hosting company promises the server will be available. An SLA of 99%, for example, can mean the server is down for as long as 87 hours a year, over 3.5 days. A high SLA is standard today, but it is worth keeping in mind. Especially with suspiciously cheap offers.
- Bandwidth - just like your home Internet plan, a server is connected through a link with limited capacity. Today it should not be a problem even with many visitors online, but if you plan to let people download big files, take it into account.
Remember that shared hosting means many customers share the resources of one physical machine, so if another site puts a heavy load on "your" machine, it can slow your site down. This happens especially on poorly managed servers.
Hardware of a VPS
For more demanding applications, shared hosting may not be enough. Then you can choose a VPS (virtual private server). It costs more, but gives you more options. As with hosting, you get a part of a physical server's resources, but this part is guaranteed, so other customers do not indirectly affect your application.
The hardware parameters are practically the same as with hosting. The only difference is the database. You usually have to take care of it yourself (install it on the server), so its size and speed depend on the server's CPU, RAM and disk space. There are also offers that run the database alone on a separate machine, cloud-style.
The good news: a VPS stopped being a luxury long ago. The simplest virtual servers cost little more than decent shared hosting, often just a few dollars or euros a month. The catch is elsewhere - with a VPS, system updates, backups and security are your job. If you have no time or appetite for that, regular hosting with a control panel can be the more sensible choice.
Hardware of a dedicated server
If you need something even faster, with even more control over the machine and its resources, you will come across dedicated servers. Unlike hosting or a VPS, you get the whole physical machine. The price jumps again, well above a VPS, but you get much better parameters and more options. It is an offer for advanced users.
With cloud solutions growing so fast, this option loses at larger scale. Still, there are old applications and systems that would be painful or simply not worth moving to the cloud.
Hardware in the cloud
Today the most popular choice is the cloud. The cloud is really a set of different services (hosting, VPS, dedicated servers, databases, storage), so it beats the offers above. The difference between a typical server for a website and the cloud is that the cloud sells individual parameters as separate services. So if your application needs a huge amount of space for files (say, you share video files with your customers) but does not need a fast CPU or much RAM, you can pick a modest service to host the site and add a very capable file storage service on top. It can cost much less than a VPS or a dedicated server. Keep in mind, though, that such a setup forces a slightly different architecture on your application.
If you are building an application whose load will vary (big jumps in the number of visitors online, for example), the cloud is worth choosing. An application with the right architecture scales easily there, so you avoid big fixed costs and stay more stable when new challenges come.
In another article you can read more about what the cloud is.
A server is a program
A computer with the right hardware is not all it takes to call it a server. It needs the right software, which decides how it works (how stable and how fast). There are many options, but the most popular is the so-called LAMP stack:
- Linux - the operating system,
- Apache - the server program that accepts and handles requests. You can change its settings in an .htaccess file,
- MySQL - the database program that stores data and lets you work on it (read it, change it and so on),
- PHP - the scripting language the website or shop (the web application) is written in.
This set of technologies is the most widespread - it is cheap and available everywhere. If it is cheap, is it worse than other, much more expensive solutions? No - though of course it depends on what you expect from it.
The programs above - the Apache server and the MySQL (MariaDB) database - are the ones you will meet most often. Related options you may come across are the Nginx and LiteSpeed servers, and the PostgreSQL, SQLite (a special one: the whole database lives in a single file) or MongoDB databases.
When choosing a server, check what software it has. Hosting plans usually offer a wide range of technologies, so getting your site running should be no problem. Often, though, the software comes in one specific version. If you want to move an old site or install an unusual application, make sure the server's software is compatible, so you avoid extra costs, for example for adapting an old site to a new version of PHP or MySQL.
Access to the server
As the owner of a website or shop, you should have access to your server. With shared hosting, that usually means FTP (access to the site's files, much like a network drive) and phpMyAdmin (access to the database). With a VPS and above, you also get the server console, so access to the operating system and everything in it. That is especially handy when you need to do something unusual that the server panel does not offer (installing or configuring any software you like).
How is it built?
Servers resemble home computers, but their build is a bit different, to get the most of the qualities described above.
They can be standalone units: very powerful computers with a strong processor, lots of RAM and big, fast drives. These are the closest to a home computer, and hosting companies sell them as dedicated servers.
More often, though, it pays off (price versus performance) to build one computer with processors and RAM (a compute server), another with lots of drives (a disk array) and yet another specialised in databases (a database server). Several such computer-servers can then be joined into one big, expensive, but powerful machine. That is what lets hosting companies offer shared hosting and VPS plans.
Whether it is a standalone unit or a machine made of specialised computers, to be called a server it has to be connected to the Internet, for example through fibre. That is how you can connect to it from home or work and read this article, check your email or watch your favourite series 🙂
A server without a server?
Cloud offers more and more often mention serverless. It is a bit of a marketing shortcut: the servers are still there, you just do not have to look after them. You upload only your code, the provider runs it whenever someone needs it, and you pay for what actually ran. Edge works in a similar spirit - the code or the files of a site are kept in many places around the world, close to the visitor, so the page loads faster.
Sometimes you do not need an application server at all. Take the bwrite.pl tools: the server only sends the files of the page, and all the calculations happen in your browser. That is why nothing you type ever reaches the server.