What is client-server architecture for beginners?

What is client-server architecture for beginners?

Posted on 21 Oct 20223 min read

Table of contents

Every day, billions of users are surfing the internet. It is one of the most powerful tools we use to search, communicate, work and entertain.

In case you don’t know, the internet is an extensive network of interconnected computers and devices which transmit information via the TCP/IP protocol.

The devices on the internet are either clients, servers, or both. In this article, we will explain the client-server architecture to understand how the internet works under the hood.

Let’s order some pizza

After a week of hard work, you decided to reward yourself by going to your favorite restaurant, everything looks great, and you called the waiter to order some pizza.

The waiter sends your order to the kitchen to prepare it for you.

After some minutes of waiting, your order is ready. Now you can enjoy your pizza, Yummy.

Let's play a game meme

Back to reality, what’s the relationship between pizza and client-server architecture? let me explain: In this case, you were the client, and your role is to send requests via waiters to the server which is the kitchen. The server will process your request and sends you back a response.

How does client-server work?

Let's play a game meme

So, technically speaking, the client-server architecture is a computing model in which:

  • The client requests resources and services from the server.
  • The server delivers, hosts, and manages resources and services requested by the client.

A network is constructed by computers called hosts, every device can act as a client, a server, or both. We determine its role via the installed software.

Servers need web server software such as Ngnix, Apache, or IIS to provide web hosting services. The same thing applies to email servers, FTP servers, and clouds ... Every destination you visit online is hosted on a server located on a network inside the Internet.

On the other hand, clients have software that gives them the ability to request and display returned information by the server. For example web browsers, email applications, FTP clients ...

The client and the server use protocols to exchange data between them in a standardized way.

Hmm, A protocol?

To exchange data, computers and devices need a common language and rules to communicate. In real-world networks, this common language is defined by protocols.

A network protocol is a set of rules and standards that determine how data will be transmitted between different devices in an easy, reliable, and secure way.

Here are some examples of network protocols:

  • HTTP: Hyper Text Transfer Protocol, used to share data (text, image, multimedia ...) over the World Wide Web.
  • FTP: File Transfer Protocol, used to share files between hosts.
  • SMTP: Simple mail transport Protocol, used to send and notify incoming emails.
  • DHCP: Dynamic Host Configuration Protocol, used by network administrators to assign IP addresses in a network automatically.
  • DNS: Domain Name System, used to map host names or domains to IP addresses.

In other words, a protocol defines the grammar, rules, and how data should be transported.

The ideal architecture

Every technology or architecture in our field has pros, cons, and usage rules. The same thing applies to the client-server architecture.

It’s true that this architecture is widely used, but there are other architectures that solve specific problems in some situations.

One of those architectures is peer-to-peer in which every host can act like a client and a server at the same time using a persistent connection among peers.

Conclusion

The client-server architecture is a computing model in which the server hosts and delivers resources and services to be consumed by clients.

In this article we learned how this architecture works, and we have seen some examples of network known protocols.

In the end, I am glad to see you here and I hope you learned something new. If you have any questions, remarks or additional information, feel free to contact me.

Have a nice day ^_^

References & Resources