Search⌘ K
AI Features

Client-Server Architecture

Explore the fundamentals of client-server architecture, including its core components, synchronous communication, protocols like HTTP and REST, plus common resilience patterns. Understand how load balancers, circuit breakers, and caching improve scalability and fault tolerance in modern applications. Gain insights into multi-tier systems and practical trade-offs in designing reliable distributed systems.

While the previous lesson explored how event-driven architecture decouples producers and consumers through asynchronous event propagation, most systems still rely on a synchronous entry point where a client directly addresses a server and waits for a response. Client-server architecture is the foundational pattern governing this direct request-response exchange. This lesson walks through its core components, communication protocols, trade-offs, and the modern resilience patterns that make it production-ready.

Core components of client-server architecture

Three components define every client-server interaction: the client, the server, and the network connecting them.

  • Client: The entity that initiates requests. Browsers, mobile apps, CLI tools, and IoT devices all act as clients by sending structured messages to a known server endpoint.

  • Server: The entity that listens for incoming requests, executes business logic, accesses data stores, and returns responses. A server can itself act as a client to another server, forming multi-tier architectures.

  • Network: The communication medium governed by protocols that define how data is serialized, transmitted, and interpreted between client and server.

Overview of the client-server architecture
Overview of the client-server architecture

The client serializes a request into a structured format, transmits it over the network, and the server deserializes the payload, processes the logic, and returns a structured response. Unlike event-driven architecture’s fire-and-forget model, where the producer does not wait for a consumer’s acknowledgment, the client in a client-server interaction is blocked (or awaits) until the server responds. This creates a tight coupling in the interaction itself.

Servers that maintain no session state between requests are called stateless servers, and this statelessness simplifies horizontal scaling because any server instance can handle any request without needing shared memory.

The following diagram illustrates this synchronous request-response cycle from client to server and back.

Synchronous request-response cycle showing tight temporal coupling between client and server
Synchronous request-response cycle showing tight temporal coupling between client and server
...