Client-server architecture
- 1 What is the client-server architecture?
- 2 What is a client?
- 3 What is a server?
- 4 Four main categories of client-server computing
- 5 Relational database management system
- 6 TCP vs. UDP
- 7 How are data transmitted between the client and server?
- 8 A minimal HTTPS client using Python
- 9 Major software for this class
- 10 References
1 What is the client-server architecture?
- Distributed application framework
- Divides tasks between servers and clients
- Servers and clients communicate through computer networks such as
- a Local Area Network (LAN),
- a Wide Area Network (WAN), or
- the Internet
- Typically uses
- the Transmission Control Protocol (TCP) or
- the User Datagram Protocol (UDP)
2 What is a client?
Is it a computer? Well, we need a computer to run any computer programs for client-server computing.
A client is a process running on a computer.
It makes requests to the server and presents responses from the server to the user.
The most typical client is a web browser such as Firefox. We typically use a web browser to run web client applications written in JavaScript.
3 What is a server?
Again, a server is a process running on a computer.
Depending on the application design, both the client and server can run on a single computer.
The server receives and responds to requests from the client.
The most typical server is a web server such as Apache. Server applications running on a web server can be written in many different languages including Python, Node.js, and PHP.
4 Four main categories of client-server computing
4.1 One-tier architecture
- A program running on a single computer
- Standalone application
- Does not require any network traffic
4.2 Two-tier architecture
- Client and server tiers
- Requires a network protocol to link both tiers
- User Interface (UI) code on the client tier
- Domain logic and data on the server tier
4.3 Three-tier architecture
- Presentation, application, and data tiers
- Requires a network protocol to link all tiers
- UI code on the presentation tier
- Service and data processing on the application tier
- Data Input/Output (IO) on the data tier
4.4 N-tier (multitier) architecture
- Divides an application into multiple logical layers and physical tiers with different responsibilities
- Improves scalability
- Adds latency because of increased network traffic
- Supports different network topologies
5 Relational database management system
A Relational Database Management System (RDBMS) is used to input, manage, and output data.
It sits behind the server tier and provides data to the server.
It uses a standardized programming language for RDBMS called the Structured Query Language (SQL).
A spatial RDBMS provides spatial capabilities on top of its back-end RDBMS.
6 TCP vs. UDP
Transmission Control Protocol (TCP)
- Connection-oriented
- Built-in error checking
- Larger overhead
- Reliable and ideal for sensitive data transmissions
User Datagram Protocol (UDP)
- Connectionless
- No error checking
- No overhead
- Ideal for time-sensitive real-time communications
Most web applications using the Hypertext Transfer Protocol (HTTP) transport data over TCP. HTTP/3 uses QUIC + UDP.
7 How are data transmitted between the client and server?
- The Internet Protocol (IP) address of the target server is identified by the Domain Name System (DNS).
- Let’s try nslookup.exe.
- Request data packets are routed from the client to the target server through multiple intermediate servers on Content Delivery Networks (CDNs).
- Let’s try tracert.exe.
- The server sends response data packets to the client in the same way, but it already knows the IP address of the requesting client because it is a part of the request data packet.
8 A minimal HTTPS client using Python
import http.client
conn = http.client.HTTPSConnection("here.isnew.info")
conn.request("GET", "/")
res = conn.getresponse()
data = res.read()
conn.close()
print(data)
9 Major software for this class
- Python for server-side programming
- SQLite for RDBMS
- SpatiaLite for the spatial extension of SQLite