Client Server Architecture
Client Server Architecture
Definition
Client-Server Architecture separates an application into two roles: the client (the application or user requesting a service) and the server (the DBMS process that manages and fulfills requests against the shared data). They communicate over a network or local protocol, typically via ODBC/JDBC over TCP. The server owns and centrally manages the data; clients send requests and receive results.
How It Works — A Request Over the Network
A student's laptop (the client) runs an application that sends the request:
sqlSELECT * FROM Marks WHERE StudentID = 101;
to a database server running on a separate machine. The server parses the query, checks security permissions, applies any necessary locking for concurrency control, executes the query against the stored data, and sends back only the resulting rows. The client never touches the raw data files directly.
Contrast With the Older File-Server Model
In an older file-server model, the entire data file is shipped across the network to the client, and client-side software processes it locally as if it owned the file outright. This causes heavy network traffic (whole files move, not just query results) and provides no centralized locking or integrity control, since each client processes the file independently. In client-server architecture, only the query travels to the server and only the result travels back — the server enforces all integrity, security, and concurrency control centrally, in one place.
Edge Cases and Pitfalls
- Network failure mid-transaction must be handled explicitly (retries, transaction rollback) since the client and server are physically separate and the connection can drop.
- Many concurrent clients all hitting the server directly means the server itself must manage locking and isolation carefully to avoid conflicts or performance collapse — this scaling pressure is exactly what motivates two-tier vs. three-tier design choices (2.9, 2.10).
- A "fat client" that embeds too much business logic blurs the client-server boundary and creates the exact problems addressed later by three-tier architecture.
Interview Takeaways
- Q: What is the key difference between file-server and client-server database architecture? In client-server, only queries and results cross the network and the server enforces all data logic/integrity centrally; in file-server, whole data files move across the network and clients process them locally with no central control.
- Q: What role does the server play that the file-server model lacks? Centralized enforcement of security, integrity constraints, and concurrency control (locking) for all clients at once.