← All patterns
Foundations · Architecture pattern

Client–Server

Separate the client experience from authoritative server decisions.

The problem

A booking UI can display availability, but the server must decide whether a reservation can commit.

When it fits

Several clients need a shared authority for validation, data access and business operations.

The whole architecture

Architecture diagram

Several clients use a server-side authority that validates requests before accessing shared data.

Blue arrows are requests and data calls; responses return to the caller.

100%

Scroll to pan. Select a component for its role.

client server architectureSeveral clients use a server-side authority that validates requests before accessing shared data. Blue arrows are requests and data calls; responses return to the caller.ClientsTrusted server boundaryAuthorityweb → entry: API requestmobile → entry: API requestentry → app-a: routeentry → app-b: routeapp-a → sql: validate / commitapp-b → sql: validate / commitAPI requestAPI requestrouteroutevalidate / commitvalidate / commitClient-side validation helps usability but cannot enforce the server invariant.Web clientPresentation and inputA mobile client uses the same authoritative operation contract.Mobile clientSame API contractRouting does not replace authoritative server validation.API entry pointAuthentication / routingInstances can process requests under the same server contract.App instance ABusiness validationShared durable state permits consistent authoritative decisions.App instance BBusiness validationA timeout does not prove a write failed; use an operation identity where needed.Authoritative SQLAtomic business writesThe client should reconcile an ambiguous response with the server.Request contractTimeouts, operation IDs and known outcomes

Select a component, or focus it and press Enter, to read its role.

Walk through the design

Follow one operation

Select a step to highlight its participants. This conceptual walkthrough is separate from challenge scoring.

Arrows show request and data-access relationships. Responses return to the caller.

ClientActive in this stepServer APIActive in this stepBusiness rulesWaitingData storeWaiting
Step 1 of 3

Submit an intent

Client sends a reservation request through a defined API.

Trade-offs to make explicit

  • A clear server contract supports many clients; network latency and availability become part of the experience.
  • Client validation improves feedback, while server validation protects invariants against stale or modified requests.

Failure modes to plan for

  • A lost reply leaves the client uncertain whether a write committed. Use stable operation identities when retrying.
  • A server bottleneck needs capacity and failure handling; adding clients does not increase server capacity.
Before you build

Explain your decision

After a reservation request times out, how will the client discover whether it succeeded?

Use Plan & estimate inside practice to record your assumptions and trade-offs.

Connect concept to practice

Related challenges

Browse challenges →

These links open the original challenges. Existing round unlocks, completions and points apply.

The great ticket rush

Practice authoritative reservation writes and capacity along the client/app/SQL path.

Open challenge →

One transfer, two attempts

Practice stable operation identities when a reply is lost.

Open challenge →

Further reading

MDN · Client-server overview ↗

Original PractiseGrid explanations and conceptual diagrams, with primary references for further study. Dedicated scored exercises can be added as coverage grows.