OffTheBricks
Menu

Your Web Server is a Restaurant

How to explain to anybody, the details behind the technology that powers the Internet

Audience

We've all been there, on one side or the other. Anytime you need to explain something to someone who doesn't have that base knowledge, you need to establish some common context. Same if you're on the other side learning something new, it's much more helpful for the explanation to be based off of something that you already know. The purpose of this article is to explain the inner workings of the technology that returns websites to us, in the context of your average restaurant. Whether you need to explain, or need or want it explaining, read on and see why a web server is pretty much the same as a restaurant.

The First Connection

First thing though, what is the purpose of a web server? A web server's job is to send your phone or computer, the details at the website that you're trying to view. You make a request, and the content is delivered. Sound familiar yet? It's the same as a server or waiter at a restaurant.

You're at a the restaurant of the Internet, and are browsing the menu. You make your decision on what you'd like to eat, and you place your order with the server. The server takes down your request, and later brings back your food. In this comparison the server is the web server, and the food is the website you ordered. There are plenty of food and drink options, so a server needs to be prepared for all options.

There's More to This I'm Sure

You're right of course; just like a restaurant, the Internet is not quite as simple as placing an order which magically gets created.

Just like a restaurant, a web server is composed of different technology components, which are like the staff. Just like food, your order may be made up of a number of different ingredients, and side dishes. At the restaurant your waiter takes the order, but then the cook needs to prepare the dish. Depending on how complex the meals, you may have different types of cooks, staff, cleaners, and of course ingredients.

The first order when you sit down is probably a round of drinks. Whether it's juice, water, or alchohol, the waiter will probably make their first stop with the bartender. The web server equivalent is that the drinks are the images and structure of the web page. They're simple files and pretty quick and easy to get.

Next the appetizers complement the drinks to fill out your experience. These orders are a bit more complicated, and require more ingredients and some cooks. Appetizers are like web site user profiles, location data, and menus to make the web site match your needs. The web server probably had to do some calculations and processing to get these ready, the same as a cook making an appetizer.

The main course of the meal takes the most time, but it's the last piece to go with everything else. From a web site, this is the real content that you wanted; like a video, or an article, or even the results of a web search. This request probably required some database access, which is like the head chef or other specialty chef. Just like a kitchen, this is a choke point that causes a web server to take longer to prepare than other orders. If a restaurant kitchen is busy, preparing the main will take even longer than normal; some kitchens and web servers have different arrangements, that allow them to respond to busy periods better than others.

Speaking of kitchens, let's talk about the equipment. Kitchens have stoves, fridges, pots, pans, and cooking tools. A web server has equipment too, and just like a real kitchen, there are different tools and brands for each job. Web server's have software and programs that help put everything together. Depending on the content being served (food), a different program (stove) might do a better job than another. Just like stoves, some software is more expensive, but might do a better job serving content (food), and might even do it a bit faster, or have better technicians (customer service).

In the case of the food as well, sometimes the kitchen has run out of an ingredient or they don't have your special request; in those cases the restaurant server's "I'm sorry", is the same as a web server's "404 page not found" error.

What About the Other Side?

We've talked about serving and food choices, but what about before you even sit down with a menu? Just like with web sites, some restaurants are busier than others. These busier restaurants have hosts that greet the guests first, and determine where you sit. A web site is similar in that a web server is not always your first point of contact. Busy sites will have load balancers, which are like restaurant hosts. The load balancer looks at how busy each web server is, and then places you in a section that has capacity; the same as with hosts at a restaurant. Also like a restaurant, the host does not always have a complete picture of how busy a web server or waiter is; some restaurants and web servers have better systems for this than others. Some web servers are completely unprepared for surges in popularity, and have to put limits on the number of guests at a time; others are less prepared and just crash completely, leaving waiting customers frustrated and disappointed.

Some restaurants even need to have bouncers and security. Bouncers are like firewalls for web servers; they take a look at incoming clients, and determine whether they should be allowed in to place orders. Security staff are like anti-virus software; they take a look at what did come in, and make sure they're not up to no good.

Unsung Heros

It's easy for sure, but let's not forget those often overlooked and under appreciated cleaners, and maintenance staff.

The dishwashers clean the dishes so that new orders can be fulfilled; web servers have memory routines that make sure old data is purged to make way for new orders. Without clean pots, pans, plates, and glasses, there'd be no room for new orders, and the same is true with web server memory.

Cleaners keep the floor clean and the equipment free of mold and greese. Without a clean kitchen, stoves won't cook as well, and hidden food will attract mold and infestation. Get too out of hand, and the food inspector shuts you down.

Web servers also need to stay clean. Old versions of code, unused programs, 10-year-old data of no use to anybody, all contribute to an unheathly web server. Without regular cleaning, a web server can become too messy to be properly maintained by technical staff; in this state one unexpected problem, like a food inspector, can bring the whole web site to a close.

Then there's the all important maintenance staff. If a fridge or stove stops working, the kitchen closes or works at reduced capacity. Proper maintenance prevents something from breaking in the first place, but when things go wrong technicians are asked to come fix things asap! In the web server it's the same story. Applications and other programs are the tools for providing the service; they need updates and configuration changes to remain secure and compatible. Sometimes they need to be completely replaced and new and improved options become available. Of course when things break, web server technical staff are called upon to fix things quick.

Unsung But Maybe Not a Hero?

Probably not many consider them heros, but managers play an important role in a restaurant as well.

Managers ensure that staff are properly trained, and replaced when there's turn-over. They make sure that the fridges, freezers, and cupboards are stocked, and that maintenance takes place when the restaurant is less busy or closed. Web servers are no different, and require management in nearly the same ways. Web sites need fresh content to serve, otherwise the site feels stale and outdated. Maintenance of web server software and hardware better not happen while I'm trying to binge watch! The people and software that make a web server work, had better know what they're doing, and work together as a team. Like it or not, managers are an important piece in the machine.

Things in Common

I hope you can see that a restaurant and a web server have quite a few things in common. Like most things technical, they only seem complicated if you're missing context. Once something's relatable, it can become just like anything else. If you don't believe me or agree, that's ok. I will hit you with this last one though, which is going to be pretty hard to deny...

Restaurants and web servers both need electricity to keep the lights on.