Download Distributed System Architectures - Advanced Operating Systems - Lecture Slides and more Slides Advanced Operating Systems in PDF only on Docsity!
CS 620 Advanced Operating Systems
Lecture 4 ā Distributed System
Architectures
Architectures
⢠We distinguish between software
architectures (how are software
module/components structured) and system
architectures in which how the placement of
the modules/components on several
(distributed) machines is the main issue.
⢠In the rest of this lecture we will examine
several different system architectures.
Clients and Servers
General interaction between a client and a server.
Clients and Servers
Example C source code for a simple file server structured as a
client-server application is given in the following three slides.
An Example Client and Server (2)
A sample server - typically with infinite loop.
An Example Client and Server (3)
A client using the server to copy a file.
1-27 b
Client-Server Architectures
Alternative client-server organizations (a) ā (e).
Multitiered Architectures
⢠The concept of client-server can be extended
by having the server machine act as a client
for another server (e.g. first server is the web
server, second is the database server).
This gives us a three-tiered architecture.
The complete generalization of client-server is a
multitiered architecture.
Client-Server Clusters
⢠A single server can easily become overloaded.
⢠One solution is to replicate the server and use
a single machine as a front end to redirect
client requests.
⢠This can lead to the front end becoming a
bottleneck.
Web Server Cluster
An example of horizontal distribution of a Web service.
Client-Server Design Issues
When a client wants a service S it broadcasts an I
need S and the server supplying S responds with
its location.
So now the client knows the address.
This first broadcast and reply can be used to
eliminate duplicate servers (if desired) and
different services accidentally using the same
number.
Another method is to use a name server that has a mapping from service names to locations (and ports).
Client-Server Design Issues
At startup servers tell the name server their location.
Is the name server a bottleneck?
We can replicate it and keep it consistent (horizontal distribution).
Blocking vs. non-blocking.
Synchronous vs. asynchronous.
Send and receive synchronous is often called rendezvous.
Asynchronous send: Do not wait for the message to be received, return control immediately.
How can you re-use the message variable?
Client-Server Design Issues
How can this be useful?
Wait system call (until message available).
Test system call (has message arrived).
Conditional receive (receive or announce no message yet).
Interrupt.
None of these is perfect.
Timeouts
If we have blocking primitives, send or receive could wait forever.
Some systems/languages offer timeouts.
Client-Server Design Issues
⢠Buffered vs. unbuffered.
If unbuffered , the receiver tells where to put the
message.
This doesn't work if an asynchronous send is done before the receive (where does the kernel put the message?).