This is the second part of the four part series: How Your Website Comes Together. Servers are a little mysterious to most people but they don't have to be. They aren't any more complex than code if you know what you are looking at and what you are trying to do. There isn't a website online today that isn't hosted on some kind of server so it's good to know a bit about them.
Your server handles all of the background stuff that nobody really thinks about like the database and how well you can handle traffic. Knowing how each of these components work to make your website available online can help you prevent future issues just because you know what to look for.
Database
It seems like there's always something in the news about a data breach or a big company getting hacked. What they are usually referring to is a database. A database holds all of the user information for your website. That includes passwords, usernames, credit cards, social security numbers, and any other information a person can enter on your website.
That's why it's important to have things in place to protect your database. Your back-end code is your first line of defense. Once you get past that, there are a few other things you can do to protect your precious data.
Security
Servers can be used to put a lot of security in place to keep hackers out of your stuff. One thing you can do to help keep your website and data secure is to have a separate server for your database and your web app. Most of the time people try to save a little time and money by putting the database on the same server as the code for the web app. When you do this, it makes it easier for hackers to get everything they need because they only need to hack one server.
Keeping up to date with any new patches is also crucial to securing your site. When you see a new update for your server it's best to go ahead and do it. I know that updates can be iffy at times, but it's better to take that risk instead of taking the risk of getting hacked because people know about a particular weakness.
A simple but easy to overlook security precaution is to make sure the security controls on your database are enabled. Usually your database admin (DBA) will be the one worrying about these things, but it never hurts to know they exist. Security controls are typically enabled by default, it's just one of those things that's good to check.
Another thing that will help keep your servers secure is a good firewall. There are web application firewalls that prevent cross-scripting attacks and SQL injection attacks. There is probably already some kind of database firewall in place but having a web application firewall will prevent people from hacking your database through your website. Use firewalls to really restrict who has access to your servers.
Scaling up
To change gears a little, let's talk about how servers are used to scale your website. Each server has a limited amount of resources. The CPU and the RAM can only handle so much activity before they physically can't handle more. You have to anticipate how much traffic you expect over time and choose a server accordingly.
If you need to scale up your server, you have a few options. If your hosting package allows upgrades you shouldn't have any problems. You'll pay more for the extra resources but you shouldn't have to worry about any configuration changes. If you don't have the capability to upgrade, you might need a new server.
A "new" server could be your current server linked to other servers to share resources. You could install more processing power or partition your database. This is something that you as a web developer probably don't need to worry about much. But if you work in a smaller company or you work for yourself, it's good to know how to scale servers.
That's a brief overview of what servers are and how they work in the grand scheme of your website. There is so much that happens behind the scenes that it will blow your mind. And remember, a server is just a computer used to host websites. That's really all it is.
There are only two more parts left in this series! Now that you know about the front-end and back-end code and servers, it's time to dive a little deeper. In part three, you'll learn about the internet and how your website works within it.
Hey! You should follow me on Twitter because reasons: https://twitter.com/FlippedCoding
Top comments (2)
Thanks for the series, Milecia π
Would you add
series
tag in the post so the posts can be navigated easier? πSure thing!