cs-495 distributed systems fabián e. bustamante, winter 2004 introduction distributed systems goals...
TRANSCRIPT
CS-495 Distributed Systems
Fabián E. Bustamante, Winter 2004
Introduction
Distributed Systems
Goals of Distributed Systems
Hardware and Software Concepts
Client-Server Model
CS-495 Distributed Systems2
Distributed System
A distributed system is a collection of (1) independent computers that (2) appears to its users as a single coherent system.
e.g.NOW
Workflow information system
WWW
CS-495 Distributed Systems3
Goals
To make them worth the effort– Connecting users and resources
• make easy to access remote resources &• share them in a controlled way
– Transparency – hide the fact that resources are distributed– Openness – so that they can be
• Applications can be portable• Different implementations can interoperate• DS are flexible and extensible
– Scalability – world-wide connectivity• Scalable in
– Size - # of users/resources– Geographic span– Administratively
CS-495 Distributed Systems4
Transparency
Kinds of transparency
Degree of transparency
Transparency Description
AccessHide differences in data representation and how a resource is accessed
Location Hide where a resource is located
Migration Hide that a resource may move to another location
RelocationHide that a resource may be moved to another location while in use
ReplicationHide that a resource may be shared by several competitive users
ConcurrencyHide that a resource may be shared by several competitive users
Failure Hide the failure and recovery of a resource
Persistence Hide whether a (software) resource is in memory or on disk
CS-495 Distributed Systems5
Scalability
Impediments to scalability
Concept Example
Centralized services A single server for all users
Centralized data A single on-line telephone book
Centralized algorithmsDoing routing based on complete information
CS-495 Distributed Systems6
Scaling Techniques
Hiding communication latency – avoid waiting for responses to remote service request when possible– Asynchronous communication– Reduce overall communication
Distribution – split a component into parts & distribute them across the system
Replication– Increase availability– Helps balance the load– May hide communication latency
CS-495 Distributed Systems7
Hardware Concepts
Multiprocessors MulticomputersSingle address space
shared by all
CS-495 Distributed Systems8
Multiprocessors
Single address space shared by all– Coherency is easy but scalability a problem
Solution – cache – now coherency is an issue
CS-495 Distributed Systems9
Multiprocessors – switch-based
Competition for the bus is still an issue
Switch-based systems?– Crossbar switch & Omega switching network
CS-495 Distributed Systems10
Multicomputers
Easier to build – problem is interconnection– Homogenous – System Area Network
• Homogeneous nodes rack mounted and• Interconnected by a high-performance network (e.g. grid,
hypercube)
– Heterogeneous – both in the nodes and the interconnection network
• Problem – hiding heterogeneity is hard
CS-495 Distributed Systems11
Software Concepts
OS for multicomputers/multiprocessors can be divided in two categories– Distributed OS – tightly-coupled systems– Network OS – loosely-coupled systems
From a NOW, to get a distributed system you need middleware
System Description Main Goal
DOSTightly-coupled operating system for multi-processors and homogeneous multicomputers
Hide and manage hardware resources
NOSLoosely-coupled operating system for heterogeneous multicomputers (LAN and WAN)
Offer local services to remote clients
MiddlewareAdditional layer atop of NOS implementing general-purpose services
Provide distribution transparency
CS-495 Distributed Systems12
Uniprocessor Operating Systems
OS for distributed systems and uniprocessors are very much alike– They act as resource managers for the underlying hardware
– Provide a virtual machine that hide the intricacies of the underlying hardware
Part of enabling resource sharing is protecting apps from each other– Dual mode of operation – monolithic OSs
Microkernels– Pros and cons
CS-495 Distributed Systems13
Multiprocessors Operating Systems
From uniprocessors to multiprocessors – a natural step
Protect OS data structures against concurrent access to guarantee consistency– Semaphores– Monitors
CS-495 Distributed Systems14
Multicomputer Operating Systems
No shared memory – communication through message passing
You can – Exposed message passing to application – Hide it through distributed shared memory
CS-495 Distributed Systems15
Distributed Shared Memory
Since MP seems to be more difficult to program for
Distributed Shared Memory– AS divided into pages– Pages distributed among
machines
Performance improvements– Replicate read-only pages
– Replicate all pages
– Weaker than strict consistency
– Larger pages sizes → potential problem of false sharing
CPU 1 references page 10
Page 10 is read only and replication is used
CS-495 Distributed Systems16
Network Operating System
Various machines interconnected; users can access remote resources
No assumptions of– Homogeneous underlying hardware– Managed as a single system
Pros and Cons– Harder to use– Harder to manage– Very easy to scale
CS-495 Distributed Systems17
Middleware
Remember the definition of a distributed system– Distributed OS – not intended to handle independent
machines– Network OS – does not provide a view of a single coherent
system
Most distributed systems are built from NOS + middleware
CS-495 Distributed Systems18
Middleware Models and Services
To make development and integration simple – adopt a paradigm– Everything is a file
– Remote Procedure Calls
– Distributed Objects
– Distributed Documents
Services common to many middleware systems– Communication
– Naming
– Persistence
– Distributed Transaction
– Security
Middleware and openness
CS-495 Distributed Systems19
Comparison between Systems
Item
Distributed OS
Network OSMiddleware-based OSMultiproc. Multicomp.
a) Degree of transparency
b) Same OS on all nodes
c) Number of copies of OS
d) Basis for communication
e) Resource management
f) Scalability
g) Opennessa) High/Low
b) Yes/No
c) 1/N
d) Shared memory/messages/files/model specific
e) Global central/global distributed/per node
f) No/Yes/So-So
g) Closed/Open
CS-495 Distributed Systems20
Comparison between Systems
Item
Distributed OS
Network OSMiddleware-based OSMultiproc. Multicomp.
Degree of transparency Very High High Low High
Same OS on all nodes Yes Yes No No
Number of copies of OS 1 N N N
Basis for communication Shared memory Messages Files Model specific
Resource management Global, centralGlobal, distributed
Per node Per node
Scalability No Moderately Yes Varies
Openness Closed Closed Open Open
CS-495 Distributed Systems21
Client-Server Model
Clients and Servers as a model for distributed applications
Layering: general organization of an Internet search engine into 3 different layers
CS-495 Distributed Systems22
Multitiered Architectures
The three logical levels → many physical distributions and potentially multiple tiers
Alternative client-server organizations
CS-495 Distributed Systems23
Modern Architectures
Distribution can be – Vertical – what we have seen so far– Horizontal – distributing the clients and servers
themselves• Distributed web server.
• P2P system
CS-495 Distributed Systems24
Hints for Computer System DesignWhy it helps?/
Where it helps?
Functionality Speed Fault-tolerance
Completeness Separate normal & worst case
Safety first
Shed load
End-to-End End-to-End
Interface Do one thing well
Don’t generalize
Get it right
Don’t hide power
Use procedure arguments
Leave it to the client
Keep basic interface stable
Keep a place to stand
Make it fast
Split resources
Static analysis
Dynamic translation
End-to-End
Log updates
Make actions atomic
Implementation Plan to throw one away
Keep secrets
Use a good idea again
Divide and conquer
Cache answers
Use hints
Use brute force
Compute in background
Batch processing
Make actions atomic
Use hints