How Does a Website Work?

Have you ever been curious, as a website owner, about how websites work?

Why does your website magically appear in front of your screen after you put the ‘www.examplewebsite.com‘?

How is your website accessible whenever and wherever you’re connected to the internet?

To make a website work, it requires different parts to work too. Like in a car, when you press gas, the car moves. Sounds so simple, right? But in reality, there are a lot of things happening under the hood that make the car go forward.

Websites are no different. The moment you hit ‘enter’ (or ‘return’ for MacBook users), the website shows up in a split second. Between that split second is a process to complete your request in accessing your website.

In this article, we will flesh out the big picture to help you understand how websites work. In this way, it gives you clarity on what is the role of each part that completes the process to help your website run smoothly.

Client

To start by helping you understand the entire process, let’s talk about the client’s side first. Client computers are computers who consume information.

If you want to access Facebook, you head to your browser and type in “www.facebook.com.” The Facebook page presents right in front of your browser. You want to access the Facebook website because you want to consume information from them. You surfed around Facebook and check to see what’s up with your friends and family – either check on their status, or look at the photos you took last night.

Searching on the internet is also the same. When you search “best coffee in New York”, or “weather tomorrow in Chicago,” your browser then presents a series of information that might be helpful to your search. This is also an example of how you consume information.

Client computers come from different types or sizes. This could be your desktop, laptop or even your smartphones. Any computer or device that consumes information is a client computer.

Server

A server computer, or simply server, serves information. When a client computer consumes info, that information comes from somewhere. Server computers are the computers who deliver that information to the client.

Servers can also be like any other desktop computers you know. But often, big servers can be a large interconnected pieces of hardware that hold tons of information. These servers are always on standby 24/7, waiting for request of information from client computers.

Some servers can be as small as a desktop computer, while others are massive, like this Facebook data center in Prineville, Oregon. Picture courtesy from Business Insider.

In another sense, a server is also where you store your website files. These files comprise codes, media files, and other assets that made up your website. When a client requests a specific information (or webpage), the server would send the relevant codes and files that make up that information that the client wants to see.

Servers can be located around the world. To use a server, you need to rent a space from a hosting service. Once you rent a server, you can then store your website files. The files are there waiting for a request from a client. The client can then access your website anytime, everywhere with the help of the internet.

Client-Server Request Response Cycle

Now that you know what is a client and server, let’s look at their roles on how a website work.

Consider this following scenario:

When you go to a restaurant, you’ll take a seat and a waiter hands the menu. You look at the options for a while. Once you are ready to order, the waiter will take it from you. Then, he passes the order to the kitchen.

The kitchen then looks at your order and then prepares your food. Once the food is ready, the waiter gets it from the kitchen and then serve it to you. Bon appétit!

This seemingly simple example is how websites work. When you, the client, want to access an information, you are making a “request”. In the example above, that’s where you are ordering food from the menu.

The waiter, that’s your browser, will then send your request to the server. The server will then look up the information that you are requesting and then pull it up, then serve it to you. This action that the server took is called “response”. The server was responding to your request.

The kitchen, which was the server in this case, prepared your food and then have the waiter serve it to you.

Going back in the example above, when you type in “facebook.com”, you’re telling your browser to “hey, please get me the facebook.com web page”. Then the browser tells your server “my client wants to get the facebook.com web page“. The server would hand over that webpage to your browser and then the browser delivers it to you. That’s the reason Facebook is right in front of your screen when you type in its web address in the browser the moment you hit enter.

When this cycle of requesting and responding took place, this is what the nerds called ‘Client-Server Request Response Cycle’.

A perfect diagram of a client-server request-response cycle. Photo courtesy from Davis Gitonga.

In today’s age, this cycle goes over and over a million times at any second. Within the world wide web, information flows through as long as a client is requesting it and servers responding it. The internet is the channel where information flows through.

Conclusion

As a website owner, it pays to wonder how websites work. Knowing the moving parts will help you understand why some pieces needs to be in place.

When you know what’s happening behind the scenes, you can make informed decisions. In case your web developer comes up to you and discuss servers and clients, you know what he’s talking about.

For instance, if your car has problems, you know too well you need a mechanic to fix it. But, it’s worth to understand where the problem came from. This cuts the time in checking your car into finally fixing it because you know where your mechanic will look at.

Like getting a website, when you know where the problem is, it helps your web developer to fix your website in no time. This will help keeping your website up and running.

Is website confusing you? Let me handle it!

Websites and tech are my thing. I help small business owners to develop their website and optimize it, making it more visible and working.