article

Explain Servers to a 5 Year Old

Kids eating pizza and pasta

Kids eating pizza and pasta by Shutterstock

What are servers?

If you Google “what are servers” a wiki page will pop up and have this to say:

In computing, a server is a computer program or a device that provides functionality for other programs or devices, called "clients".

The client is typically another computer but can refer to the person using the other computer as well.

How do servers help us?

Servers are used to handle requests from the client. They do this through APIs.

What does API stand for? “Application Program Interface” (API)

What are APIs?

A quick Google search will give us another wiki stating that:

An application programming interface is a computing interface which defines interactions between multiple software intermediaries. It defines the kinds of calls or requests that can be made, how to make them, the data formats that should be used, the conventions to follow, etc.

You may also hear people refer to APIs as the individual routes that your server has defined.

All of this may seem confusing now but let's try to tie it together with something we are already familiar with.

Let's explain servers to a five year old

Severs are like restaurants.

So you go to the Italian restaurant one day. When you hit the door you are now the client. You are now ready to make requests. Your first request is to be seated.

If the restaurant is busy you may end up waiting a long time to be seated. At some point you may get up and leave because you are tired of waiting. If this happens in computing, your server has just timed out. Not good. That would be an error, a 408 status code.

But let's look at what would happen if you were seated in a timely manner. In computing, your first request was successful. To be more specific you just made a GET request and the server has responded by returning a table to you. The status code for this success is 200.

Once you are seated you begin to make more request. The waiter is the person that will help you to make your request from here on out. They are going to take your orders to the kitchen and you will then after some time get your food and beverage and whatever else you request.

If you order a hamburger at the Italian restaurant, what do you expect the response to be? Your waiter would probably say, “I apologize, we don't have that.” In computers that would be equivalent to a 404 status code meaning “not found”.

But if you order spaghetti and 10 minutes later the waiter brings you a big pile of spaghetti, you would call that a success! And once again, in computers that is equal to a status code of 200.

If you want more sauce on your spaghetti, you tell the waiter and they will take your plate to the back where they would add more sauce to your dish. The waiter would then return the plate to you with more sauce. In computing this type of request is called a PUT. It too was a success and has a status code of 200.

At the end of your meal the waiter brings you a bill of $22.50. You then give the waiter a $50 bill. They take your bill to the back, get you change, bring you your change, and say, “thank you for dining with us; have a good night!” In computing this would be a successful POST with a status code of what…you guessed it — 200.

Here I have briefly explained how a server works and a few status codes that one can expect when dealing with servers.

Now... does that make sense?

Please comment, encourage, share your thoughts. I wrote this for my students that have no knowledge or background in computer science. It seemed to help.

Computer Science
Servers
Programming
Information Technology
APIs
Application Programming Interface