CodingNic

Introduction to Backend Development

Client-Server Architecture

Introduction to Backend Development 10 min read

Client-Server Architecture

Objectives

By the end of this lesson, you should be able to:

  • Explain what a client and a server are, in the networking sense
  • Describe the basic client-server request cycle
  • Explain why a server can serve many clients at once

💡 Why this matters: Client-server architecture is the model nearly every website, mobile app, and API in this course runs on. Everything from “installing Express” to “designing a REST API” only makes sense once this model is clear.

Client and Server

A client is anything that initiates a request, a web browser, a mobile app, another server, even a command-line tool like curl. A server is a program (usually running continuously, waiting) that listens for requests and sends back responses.

This isn’t about physical hardware specifically, “server” refers to the role a program plays: always listening, always ready to respond. The same physical machine could run both a client and a server, what matters is which role a given program is playing in a specific interaction.

The Basic Cycle

The core interaction is simple, repeated constantly across the entire internet:

text
1. Client sends a request  ("give me the homepage", "log this user in", "add this to the cart")
2. Server receives the request, does whatever work is needed
3. Server sends back a response
4. Client does something with that response (renders a page, shows an error, etc.)

Loading a single web page can trigger dozens of these request-response cycles, one for the HTML, more for images, stylesheets, fonts, and any data the page needs to fetch afterward.

One Server, Many Clients

A single backend server is built to handle requests from many different clients at once, potentially thousands or millions, depending on the application. This is one of the central design challenges of backend development: a server has to respond correctly and quickly, even while many unrelated clients are all making requests at the same time. Node.js’s architecture, covered later in this course, is specifically built around handling exactly this kind of concurrent load efficiently.

Where This Course Fits

Throughout this course, you’ll build the server side of this relationship. Your Express application will be the thing sitting and waiting for requests, whether those requests come from a real web browser, a mobile app, another backend service, or a tool like Postman used for testing during development.

Try It

  1. Explain, in your own words, the difference between a client and a server, without referring to specific hardware.
  2. Think of a single action you take in an app (like refreshing a social media feed) and describe it as a request-response cycle.
  3. Explain why a backend server needs to be designed to handle many clients simultaneously, rather than one client at a time.

Recap

  • A client initiates requests, a server listens for them and sends back responses, these are roles, not specific hardware.
  • The core interaction is a repeating cycle: request, processing, response.
  • A real backend server has to handle many clients making requests concurrently, not just one at a time.

Next lesson: HTTP and HTTPS, the actual protocol clients and servers use to communicate.