Presentation is loading. Please wait.

Presentation is loading. Please wait.

IS 651: Distributed Systems Midterm

Similar presentations


Presentation on theme: "IS 651: Distributed Systems Midterm"— Presentation transcript:

1 IS 651: Distributed Systems Midterm
Sisi Duan Assistant Professor Information Systems

2 HW3 Q1. Why E1->E10 and E8||E9?
Definition (->): We define e->e’ if… Logical ordering: e->e’ if e->e’ for any process I Messages: send (m) -> receive (m) for any message m Transitivity: e->e’‘ if e->e’ and e’->e’’

3 HW3 Q3.B. Sequential consistency does not admit a scalable implementation because it requires a total ordering of all operations in the system.  Q3.E. Sequential consistency is sufficient to guarantee that an airline never overbooks its seats when multiple clients reserve seats on the same airplane.

4 HW3 Q3.C. Obeying all causal orderings is sufficient to guarantee convergence of state maintained by multiple replicas.  Q3.D. Causal consistency is sufficient to guarantee that an airline never overbooks its seats when multiple clients reserve seats on the same airplane.  Q3.A. Sequential consistency guarantees causal ordering.  In shared memory scenario, I think it’s true. But this is not always true.

5 Causal order vs Total order in the broadcast scenario
[Lamport, Comm. ACM 1978] [Lamport, Distrib. Comput. 1986] Causal order If the broadcast of message m1 "happens before" or "causally precedes" the broadcast of message m2, then no correct process delivers m2 before it delivers m1. m1 “Chase charges 10%!” m2 “That is outrageous!”

6 Causal order vs Total order in the broadcast scenario
Causal order Chase: “Charge 10%” Outrageous! $100 $90 Chase: “Charge 10%” Outrageous! $100 $90 $100

7 Causal order vs Total order in the broadcast scenario
Causal order Chase: “Charge 10%” Outrageous! $100 $100 $90 Chase: “Charge 10%” Outrageous! $100 $90 $90 $100

8 Causal order vs Total order in the broadcast scenario
Causal order Total order Chase: “Charge 10%” Client 1: “Deposit $100” Outrageous! $100 $90 $190 Client 1: “Deposit $100” Chase: “Charge 10%” Outrageous! $100 $200 $180 $100

9 Causal order vs Total order in the broadcast scenario
Causal order Total order Chase: “Charge 10%” Outrageous! $100 $100 $90 Chase: “Charge 10%” Outrageous! $100 $100 $90 $100

10 Causal order vs Total order in the broadcast scenario
Causal order Total order Chase: “Charge 10%” Client 1: “Deposit $100” Outrageous! $100 $90 $190 Chase: “Charge 10%” Client 1: “Deposit $100” Outrageous! $100 $90 $190 $100

11 Midterm 25% of the score Oct 17, in-class, 2.5 hours
Covers slides 1(intro)-6(consistency) Closed-book One A4 page cheat sheet (front and back) – You prepare it. Turn in the cheat sheet (with your name) at the end of the exam

12 Midterm Multiple choices Short answers/diagrams
Similar with class exercises Short answers/diagrams Similar with homework No programming questions. But I may ask concepts. Advice Explanation can help you get partial credit even your answer is not correct. Be brief, but not too simple.

13 What we have discussed so far
Distributed systems overview Web technologies Distributed communication Time and synchronization Mutual exclusion Distributed File systems Consistency

14 What we have discussed so far
Distributed systems overview Web technologies Distributed communication Time and synchronization Mutual exclusion Distributed File systems Consistency

15 Distributed Systems Overview
What is a distributed system? Who? What? How? What are the architecture and design philosophy? Scalability Reliability Performance Openness

16 Distributed Systems Overview
Distributed systems goals Raise the level of abstraction, provide location transparency, scalability, availability, modularity Distributed systems challenges Interfaces, scalability, consistency, fault tolerance, security

17 Distributed Systems Overview
Network layers P2P Onion Routing

18 Distributed Systems Overview

19 What we have discussed so far
Distributed systems overview Web technologies Distributed communication Time and synchronization Mutual exclusion Distributed File systems Consistency

20 Web Technology Client-Server Model

21 Web Technology: 3-tier architecture
What is good/bad about this architecture? + Modularity, better reliability/scalability - poor latency

22 Web Technology Real Architecture Why so many layers? De-coupling
Performance Scalability Security

23 Web Service Usually more complicated Coordination is challenging
Services from multiple providers Coordination is challenging

24 Web Service Load balancing Content-aware distribution
Always distribute the same request for the same document to the same server

25 What we have discussed so far
Distributed systems overview Web technologies Distributed communication Time and synchronization Mutual exclusion Distributed File systems Consistency

26 Distributed Communication
Sockets Remote Procedure Call Distributed Shared Memory

27 Distributed Communication
TCP vs UDP

28 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind((hostname, port)) sock.listen(1) conn,addr = sock.accept() server_addr=(hostname,portnum) sock.connect(server_addr) sock.sendall(msg) buf = conn.recv(8092) sock.close()

29 Distributed Communication
Socket interface

30 Distributed Communication
Remote Procedure Call (RPC)

31 Distributed Communication
RPC XML/RPC SOAP RPC-style Document-style Both use XML Advantages? Disadvantages?

32 What we have discussed so far
Distributed systems overview Web technologies Distributed communication Time and synchronization Mutual exclusion Distributed File systems Consistency

33 Time and Synchronization
Why? Synchronizing real clocks Cristian’s algorithm The Berkeley Algorithm Network Time Protocol (NTP) Logical clocks Lamport logical clocks Vector clocks

34 Time and Synchronization
Synchronizing real clocks Christian’s algorithm Berkerley algorithm NTP Never perfect

35 Time and Synchronization
Lamport clock L(e1) = 1 (pitcher throws ball to home) L(e2) = 2 (ball arrives at home) L(e3) = 3 (batter hits ball to pitcher) L(e4) = 4 (batter runs to first base) L(e5) = 1 (runner runs to home) L(e6) = 4 (ball arrives at pitcher) L(e7) = 5 (pitcher throws ball to first base) L(e8) = 5 (runner arrives at home) L(e9) = 6 (ball arrives at first base) L(e10) = 7 (batter arrives at first base)

36 Time and Synchronization
Vector Clock

37 What we have discussed so far
Distributed systems overview Web technologies Distributed communication Time and synchronization Mutual exclusion Distributed File systems Consistency

38 Mutual Exclusion What’s mutual exclusion? Why? Goals? While true:
Perform local operations Acquire() Execute critical section Release()

39 Mutual Exclusion Centralized Solution Ring based Solution
While true: Perform local operations Acquire() Execute critical section Release() Mutual Exclusion Centralized Solution Ring based Solution Shared priority queue Majority voting

40 What we have discussed so far
Distributed systems overview Web technologies Distributed communication Time and synchronization Mutual exclusion Distributed File systems Consistency

41 GFS Architecture Client retrieves metadata from master
Read/Write data flows between client and chunkserver Minimizing the master’s involvement in read/write operations alleviates the single-master bottleneck

42 Distributed File Systems

43 What we have discussed so far
Distributed systems overview Web technologies Distributed communication Time and synchronization Mutual exclusion Distributed File systems Consistency

44 Consistency Shared memory Consistency model Rules
”contract” between memory system and programmer

45

46 Consistency Models Strict consistency Sequential consistency
Causal consistency Eventual consistency

47


Download ppt "IS 651: Distributed Systems Midterm"

Similar presentations


Ads by Google