What is client-server?
Client-server is a way computers share work. One side asks. The other side answers.
- The client asks for something. It is the customer.
- The server has the thing and sends it. It is the shop.
Think of a restaurant. You order food. The kitchen makes it and brings it to you. You are the client. The kitchen is the server.
What is a web server?
A web server is one kind of server. It stores website files and sends them to people who ask. The client is your web browser, such as Chrome or Firefox.
Other client-server examples
- Email: your mail app (client) talks to a mail server.
- Files: an FTP program (client) talks to a file server.
- Databases: a website (client) asks a database server for information.
- Games: your game (client) talks to the game server.
So a web server is client-server, but not all client-server is a web server.
How a web page loads
- You type an address in your browser.
- The browser finds the server's IP address through DNS. DNS is the internet's phone book.
- The browser sends a request. A request is a polite question: "May I have this page?"
- The web server finds the files. If the page needs data, it may ask a database server.
- The server sends back a response with the page.
- Your browser shows the page.
Comparing the two
| Client-server | Web server | |
|---|---|---|
| What it is | A general design | A specific type of server |
| Client | Any program | A web browser |
| Language used | Many | HTTP and HTTPS |
| Example | Email, games, databases | Apache, Nginx, IIS |
HTTP is the set of rules browsers and web servers use to talk. HTTPS is the safe version of it.
Tip: When you buy hosting, you are renting a server so that your site can always answer visitors.
Quick recap
- Client-server means one side asks and the other answers.
- A web server is one kind of server that sends websites.
- Your browser is the client.
- Email, files and databases also use client-server.