Web Development Core Concepts - What is Client-Server model?


Welcome back to web technology core concepts at Learning Journal. In the earlier session, I said, a website is a collection of one or more web pages. So, a website could be as simple as a single HTML page, Right? If you have a web page, you can create a website and run it on your local machine. However, no one else on the planet will be able to access your website until you take it to the Internet, Right?
So let's talk about taking your website to the Internet. I have this simple web page. This page is my website. It is not that great, but this is what I have.
How can I take this website to Internet? What do I need? Just think about it. Tell me at least one logical thing. Yes, you are right. The first thing that I need is a computer with an Internet connection. We all have such computers. But unfortunately, that is not enough to make my website available over the Internet. I need at least one more thing. A web server
I am sure you are wondering with some questions.

  1. What is a web server?
  2. Why do we need them?

The Web Server

Let us try to understand the need for a web server and then we will try to define a web server.
Suppose I have a single page website on my laptop. I saved it at the following location C:\myfirstpage.html. Now I want to make it available to the Internet. So I connected my laptop to the Internet. As soon as I connect my laptop to the Internet, my Internet service provider will assign a unique IP address to my computer. On the other side, you are sitting somewhere on this planet with another computer. You also connected your machine to the Internet. Technically, there is a connection between our computers and both of them have two different unique IP addresses, Right? You should be able to start a browser on your laptop and type my website's address. And there comes a series of problems. The first problem is this.
What is the address of my website?
Well, it could be the IP address of my laptop and the file name. Something like, the one shown below.
http://10.2.0.1/myfirstpage.html
Let's assume that the first problem is solved. Now you can type this address into the web browser. The browser will look at the IP address. The IP address is like a telephone number. If the browser knows the IP address, it can send some data to the computer with that address, Right? So the browser sends a request to my computer asking for the myfirstpage.html file. That request reaches to my computer. And here comes the next problem.
No one is there to listen to that request. It is same as a guest is knocking at my door, but there is no one in the house to listen and respond. So, we need to have a software that keeps listening and responding to such requests. That's what the web server is.
So at the fundamental level, we can think of a web server as a piece of software that listens and responds to the end users over the Internet. It may not be the most appropriate definition for a web server, but this is what a web server means at a high level.


Clients and Servers

So the website works using a client-server model. In this model, as the name suggests there are two actors.

  1. Client
  2. Server

The client sends a request, and the server returns an appropriate response. In case of our example, the browser is the client. It sends a request for the myfirstpage.html page. The web server is the server. It listens for the request and returns the myfirstpage.html page to the browser.
Great! The example gives you a high-level idea of how a website works, and we also talked about the client-server architecture. We will talk a little more about a web server in an upcoming video. See you again in the next video.
Thank you for watching Learning Journal. Keep learning and keep growing.


You will also like: