Introduction to Distributed Systems - CECS -...
Transcript of Introduction to Distributed Systems - CECS -...
Introduction to Distributed Systems
Other matters:
● review of the Bakery Algorithm:
why can’t we simply keep track of the last ticket taken and the next ticvket to be
called?
Ref: [Coulouris&al Ch 1, 2]
● motivations; domains for DS; examples; the Internet as a DS
● trends: mobile & ubiquitous computing
● design criteria and phenomena; scalability and desired transparencies
● architectural models: roles, patterns
● fundamental models: the interaction model and timing issues
● overview of future DS topics
(diagrams from Coulouris et all Distributed Systems)
COMP2310 Lecture 22: Distributed Systems 2014 ◭◭ ◭ • ◮ ◮◮ × 1
Motivations of Distribution
● system only exists within an existing physically distributed space
■ email system, devices in a large aeroplane, wireless sensor networks, mobile
networks, online social networks
● possible high performance due to potential high degree of parallel computing
● possible high reliability due to redundancy of the hardware and/or software
● possible scalability
● integration of a large number of heterogeneous nodes/devices tailored to specific
needs
● what to distribute:
■ state (e.g. distributed databases and games)
■ function: distributed methods on central data
■ state and function (e.g. client/server systems)
■ none: pure replication (e.g. content delivery services)
COMP2310 Lecture 22: Distributed Systems 2014 ◭◭ ◭ • ◮ ◮◮ × 2
Some Domains for Distributed Systems
��������������� ���!!������$#$��!����������*���+��+��������������&��#�����������#�
� ����������������� ���������!��������������������#���������&����&������,�����������)��&��#-�"������&�����.������$
����������������������������
�������#�!��#��! �����������!����������!�� ��� #������������������$#$�/� 0 ���"���&�
���� ��� ������������!��������������������������������!��������#���������
��������� � �������#��1��� ����������#���1����!����,�����������������#
��������������������� 2+������� ���������#������!��!������1����-�2��#���.����2��#��������
����� 0���2�����������������#���������#�����������������������)��������������
�������������������� ���������������#�����!�������������3 �&��������������� ��!��
([Coulouris&al Fig 1.1])
COMP2310 Lecture 22: Distributed Systems 2014 ◭◭ ◭ • ◮ ◮◮ × 3
Distributed Systems ExamplesFinancial Trading System ([Coulouris&al Fig 1.2])
● a distributed event-based system: engines
react to to any detected events
● e.g. if A’s (B’s) price moves up (down) by
0.5% within 1 min. interval then: sell A, buy B
● timeliness of data and reaction speed all
important!
● ref: The Microsecond Market
● more sophisticated trading algorithms exist
(Alg. Trading; Quantitative Analytics)
require large-scale parallel processing!
Cloud Computing ([Coulouris&al Fig
1.5])
● distributed systems as a utility
● computational and storage
infrastructure-as-a-service:
OS virtualization a key
technology: physical host
could be anywhere!
● applications-as-a-service: e.g.
web emailCOMP2310 Lecture 22: Distributed Systems 2014 ◭◭ ◭ • ◮ ◮◮ × 4
The Modern Internet
● typical portion ([Coulouris&al Fig 1.3])
��������
5�+
���&������!� ���-
���&����
�������������&
���1��-
☎
���)��&����&-
☎
☎
☎
● intranet: sub-networks within a single organization, typically protected by firewalls
● firewalls operate by selective filtering for certain kinds of traffic – how? (hint: TCP)
● backbone: high-bandwidth link (e.g. satellite, fiber-optic cable) linking intranets
● % of world’s computers that are web servers peaked at 25% (2001);
now 20% (due to mobile computing)
COMP2310 Lecture 22: Distributed Systems 2014 ◭◭ ◭ • ◮ ◮◮ × 5
Trends: Ubiquitous and Mobile Computing● portable devices in a distributed system ([Coulouris&al Fig 1.4])
● ubiquitous computing: computing devices everywhere (embedded, worn)■ only useful when they can communicate with each other!■ need for spontaneous interoperation■ need for service discovery: associate device to local services
● trends in distributed systems■ emergence of pervasive networking technology (e.g. wireless)■ emergence of ubiquitous computing coupled with mobility■ increasing demand for multimedia; view of distributed systems as a utility
COMP2310 Lecture 22: Distributed Systems 2014 ◭◭ ◭ • ◮ ◮◮ × 6
Distributed System Design Criteria
● aim to achieve decoupling/high degree of local autonomy
■ cooperation rather than central control
● desire consistency, availability and partitionability
● scalability: for n users (or devices), cost should be O(n), data access O(log(n))
● desire transparency in a number of criteria ([Coulouris&al sect 1.5.7])
������� ����������� ������� ����� �� ������ ��������� �� �� ������� ����� � �������
�����������
����������������������������������������������� .��/���0��.�� �����/����/������
�����.��0��������1����2������./��/���� ������"� ����3�
�����������������������������4����������������������������������������/���
���������.��/������������������.����/���
����������������������������������������������������������������� ����������
������������� �����������.��/���0��.�� �����/�����������������������������
������������
�������������������������/�������������������������.���������� �����������
�������������������/������0� �������/����������/�� .���������.��������������
�� ���������������������.��/���4������������������ �������.��/���������
.��/�������������/����������������������������
�������������������������.��/���������������������� �������4������������
����� �4����
�����������������������.��/��������� ���������������2��� �������.��/����/����
���/�������������������/�������������������/���
COMP2310 Lecture 22: Distributed Systems 2014 ◭◭ ◭ • ◮ ◮◮ × 7
Distributed Systems Phenomena
● communication between components is purely by messages
● high degree of concurrency!
● missing or imprecise time-base (no global clock)
■ are there causal relationships between events?
● unpredictable delays (communication)
● independent failures (as we increase size of system)
■ likelihood of individual failures increase
■ likelihood of complete failure decreases (in case of a good design)
strategies: detection, recovery (try again), tolerance (restart, replication)
● heterogeneity: e.g. data format, vendors (need for standards, middleware, VMs)
● need for openness (extensibility) and quality of service assurance (e.g. meet
deadlines)
COMP2310 Lecture 22: Distributed Systems 2014 ◭◭ ◭ • ◮ ◮◮ × 8
Distributed Systems Quiz
● Q1 A concurrent system is always distributed (T/F)
● Q2 The communication model of distributed systems includes shared memory
access (T/F)
● Q3 In the context of distributed system, transparency means:
1. Each component must show its data to others if asked
2. Each component must declare what protocol it uses to the others
3. Each component can see the associated properties of the others
4. Each component need not be aware of the associated properties of the others
● Q4 A broadcast communication protocol between N processes requires N*N
individual messages. Is this considered scalable?
COMP2310 Lecture 22: Distributed Systems 2014 ◭◭ ◭ • ◮ ◮◮ × 9
Architectural Models
● identify the key entities that are communicating in the system
● what communication paradigms are used
■ interprocess communication (e.g. message passing, sockets)
■ remote invocation (e.g. RPC, Java RMI)
■ indirect: senders don’t need to know who they are talking to, receivers do not
need to exist at same time
◆ e.g. group messaging, publish-subscribe, message queues
● what are their roles?
● how are they placed in the physical infrastructure
■ crucial in determining performance (also reliability and security)
■ strategies:
◆ mapping of services to multiple servers (e.g. ANU-wide LDAP servers)
◆ caching: replication of data closer to clients (e.g. ANU proxy cache)
◆ mobile code and agents: push services closer to clients (e.g. web applets) –
better response (danger? Java plugin in IE )
COMP2310 Lecture 22: Distributed Systems 2014 ◭◭ ◭ • ◮ ◮◮ × 10
Architectural Models: Roles and Responsibilities
Client-Server ([Coulouris&al Fig 2.3])
● clients interact with a (distant) server to
access its shared resources
● there may be multiple servers (e.g. search
engines), or servers may access other
servers (e.g. web proxy)
■ better scalability
Peer-to-Peer ([Coulouris&al Fig 2.4a])
● all processes play similar roles
● run the same program and
● scales better: user’s resources
can be used to support service
● pitfalls! (e.g. Skype)
COMP2310 Lecture 22: Distributed Systems 2014 ◭◭ ◭ • ◮ ◮◮ × 11
Architectural Patterns● layering (vertical ordering)
■ applications (client) and services (server)
■ middleware: provide useful building blocks for inter-operable software
components◆ provide convenient programming model, mask heterogeneity
■ platform: operating system, computer & network hardware● tiered architecture: complimentary to layering
■ consists of organizing functionality of a
given layer and placing on appropriate
servers
■ presentation logic: user interface for
application
■ application logic: detailed
application-specific processing
■ data logic: for persistent storage of data
(e.g. DBMS)
Two- and Three-tier architectures (⇒)
([Coulouris&al Fig 2.8])
COMP2310 Lecture 22: Distributed Systems 2014 ◭◭ ◭ • ◮ ◮◮ × 12
Fundamental Models for Distributed Systems
● contain essential ingredients of system, making explicit all relevant assumptions
● purpose: make generalizations on what is possible and impossible, determine ifguarantees of desirable properties are met
● interaction model:
■ each process has a private state■ overall state determined by the transmission of messages■ two models for time:
◆ synchronous: clock drift, time to execute execute a local step of a processand message transmission are within known time bounds
★ clock drift: rate of local clock deviating from perfect reference clock (withGPS, can reduce to ≈ 1µs)
★ message transmission time affected by latency (time for 1st packet toarrive), bandwidth (rate of transmission of packets), network congestionand processor loads
◆ asynchronous: no bounds on the above; only logical message ordering★ the Internet typifies this model
■ which kind of DS model is FSP? What is its drawback for DS?
COMP2310 Lecture 22: Distributed Systems 2014 ◭◭ ◭ • ◮ ◮◮ × 13
Asynchronous Interaction Model
([Coulouris&al Fig 2.13])
����
�����'�
����
�����'�
%� ��
)
*
+
,-
.
/
0�1����������
��
������� �������
���$
�������������� ��������� �� ��
�������
�������
��
��
● X sends m1 before Y receives m1
● Y receives m1 before sending m2
● Z sends m3 to X concurrently to X receiving m2 from Y
COMP2310 Lecture 22: Distributed Systems 2014 ◭◭ ◭ • ◮ ◮◮ × 14
Overview of Future DS Topics
● networks
● distributed time and states
■ snapshot algorithm
● distributed properties
■ mutual exclusion
■ termination
■ consensus
● transactions
■ construction of composite atomic actions
■ how does a database management system allow multiple concurrent queries
● replication and resilience
Note: sone changes to remaining course schedule
COMP2310 Lecture 22: Distributed Systems 2014 ◭◭ ◭ • ◮ ◮◮ × 15