1 CS6320 – Performance L. Grewe 2 The Servlet Interface Java provides the interface Servlet Java provides the interface Servlet Specific Servlets implement.

Slides:



Advertisements
Similar presentations
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 7: Consistency 4/13/20151Distributed Systems - COMP 655.
Advertisements

Replication. Topics r Why Replication? r System Model r Consistency Models r One approach to consistency management and dealing with failures.
Consistency and Replication Chapter 7 Part II Replica Management & Consistency Protocols.
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Consistency Steve Ko Computer Sciences and Engineering University at Buffalo.
Consistency and Replication Chapter Introduction: replication and scalability 6.2 Data-Centric Consistency Models 6.3 Client-Centric Consistency.
Consistency and Replication Chapter Topics Reasons for Replication Models of Consistency –Data-centric consistency models: strict, linearizable,
Consistency and Replication
Consistency and Replication Chapter 6. Object Replication (1) Organization of a distributed remote object shared by two different clients.
Replication and Consistency Chapter 6. Data-Centric Consistency Models The general organization of a logical data store, physically distributed and replicated.
Consistency Models Based on Tanenbaum/van Steen’s “Distributed Systems”, Ch. 6, section 6.2.
Consistency and Replication. Replication of data Why? To enhance reliability To improve performance in a large scale system Replicas must be consistent.
Computer Science Lecture 14, page 1 CS677: Distributed OS Consistency and Replication Today: –Introduction –Consistency models Data-centric consistency.
Distributed Systems1 Chapter 8: Replication and Consistency  Replication: A key to providing good performance, high availability and fault tolerance in.
Consistency And Replication
Consistency and Replication
Distributed Systems Fall 2010 Replication Fall 20105DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Distributed Systems Spring 2009
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Computer Science Lecture 14, page 1 CS677: Distributed OS Consistency and Replication Today: –Introduction –Consistency models Data-centric consistency.
Computer Science Lecture 16, page 1 CS677: Distributed OS Last Class: Web Caching Use web caching as an illustrative example Distribution protocols –Invalidate.
Consistency and Replication Chapter 6. Reasons for Replication Data replication is a common technique in distributed systems. There are two reasons for.
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Computer Science Lecture 14, page 1 CS677: Distributed OS Consistency and Replication Introduction Consistency models –Data-centric consistency models.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Consistency.
Computer Science Lecture 16, page 1 CS677: Distributed OS Last Class:Consistency Semantics Consistency models –Data-centric consistency models –Client-centric.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms.
Consistency & Replication Chapter No. 6
Consistency and Replication Chapter Concepts Reasons for Replication Reliability Earthquake, flood Misoperation Performance Place copies of data.
Consistency and Replication CSCI 4780/6780. Chapter Outline Why replication? –Relations to reliability and scalability How to maintain consistency of.
Consistency and Replication
Consistency And Replication
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Consistency.
CS 5204 (FALL 2005)1 Leases: An Efficient Fault Tolerant Mechanism for Distributed File Cache Consistency Gray and Cheriton By Farid Merchant Date: 9/21/05.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms –Bully algorithm.
Consistency and Replication Chapter 6. Release Consistency (1) A valid event sequence for release consistency. Use acquire/release operations to denote.
Consistency and Replication. Replication of data Why? To enhance reliability To improve performance in a large scale system Replicas must be consistent.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Consistency and Replication Distributed Software Systems.
第5讲 一致性与复制 §5.1 副本管理 Replica Management §5.2 一致性模型 Consistency Models
Computer Science Lecture 13, page 1 CS677: Distributed OS Last Class: Canonical Problems Distributed synchronization and mutual exclusion Distributed Transactions.
Consistency and Replication Chapter 6 Presenter: Yang Jie RTMM Lab Kyung Hee University.
Replication (1). Topics r Why Replication? r System Model r Consistency Models – How do we reason about the consistency of the “global state”? m Data-centric.
Distributed Systems CS Consistency and Replication – Part IV Lecture 21, Nov 10, 2014 Mohammad Hammoud.
Computer Science Lecture 14, page 1 CS677: Distributed OS Last Class: Concurrency Control Concurrency control –Two phase locks –Time stamps Intro to Replication.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Distributed Systems Replication. Why Replication Replication is Maintenance of copies at multiple sites Enhancing Services by replicating data Performance.
Consistency and Replication Chapter 6. Topics Reasons for Replication Models of Consistency –Data-centric consistency models –Client-centric consistency.
Distributed Systems CS Consistency and Replication – Part I Lecture 10, September 30, 2013 Mohammad Hammoud.
Replication (1). Topics r Why Replication? r System Model r Consistency Models r One approach to consistency management and dealing with failures.
Consistency and Replication. Outline Introduction (what’s it all about) Data-centric consistency Client-centric consistency Replica management Consistency.
Distributed Systems CS Consistency and Replication – Part IV Lecture 13, Oct 23, 2013 Mohammad Hammoud.
Chapter 7: Consistency & Replication IV - REPLICATION MANAGEMENT By Jyothsna Natarajan Instructor: Prof. Yanqing Zhang Course: Advanced Operating Systems.
Hwajung Lee.  Improves reliability  Improves availability ( What good is a reliable system if it is not available?)  Replication must be transparent.
Consistency and Replication Chapter 6 Presenter: Yang Jie RTMM Lab Kyung Hee University.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Consistency and Replication CSCI 6900/4900. FIFO Consistency Relaxes the constraints of the causal consistency “Writes done by a single process are seen.
OS2 –Sem 1, Rasool Jalili Consistency and Replication Chapter 6.
Consistency and Replication (1). Topics Why Replication? Consistency Models – How do we reason about the consistency of the “global state”? u Data-centric.
CS6320 – Performance L. Grewe.
Distributed Shared Memory
Consistency and Replication
Consistency and Replication
Consistency Models.
7.1. CONSISTENCY AND REPLICATION INTRODUCTION
Consistency and Replication
Consistency and Replication
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Distributed Systems CS
Replication Chapter 7.
Consistency and Replication
Presentation transcript:

1 CS6320 – Performance L. Grewe

2 The Servlet Interface Java provides the interface Servlet Java provides the interface Servlet Specific Servlets implement this interface Specific Servlets implement this interface Whenever the Web server is asked to invoke a specific Servlet, it activates the method service() of an instance of this Servlet Whenever the Web server is asked to invoke a specific Servlet, it activates the method service() of an instance of this Servlet service(request,response) MyServlet (HTTP) request (HTTP) response

CS677: Distributed OS Consistency and Replication Today: Today: IntroductionIntroduction Consistency modelsConsistency models Data-centric consistency models Data-centric consistency models Client-centric consistency models Client-centric consistency models Thoughts for the mid-termThoughts for the mid-term

CS677: Distributed OS Why replicate? Data replication: common technique in distributed systems Data replication: common technique in distributed systems Reliability Reliability If one replica is unavailable or crashes, use anotherIf one replica is unavailable or crashes, use another Protect against corrupted dataProtect against corrupted data Performance Performance Scale with size of the distributed system (replicated web servers)Scale with size of the distributed system (replicated web servers) Scale in geographically distributed systems (web proxies)Scale in geographically distributed systems (web proxies) Key issue: need to maintain consistency of replicated data Key issue: need to maintain consistency of replicated data If one copy is modified, others become inconsistentIf one copy is modified, others become inconsistent

CS677: Distributed OS Object Replication Approach 1: application is responsible for replication Approach 1: application is responsible for replication Application needs to handle consistency issuesApplication needs to handle consistency issues Approach 2: system (middleware) handles replication Approach 2: system (middleware) handles replication Consistency issues are handled by the middlewareConsistency issues are handled by the middleware Simplifies application development but makes object-specific solutions harderSimplifies application development but makes object-specific solutions harder

CS677: Distributed OS Replication and Scaling Replication and caching used for system scalability Replication and caching used for system scalability Multiple copies: Multiple copies: Improves performance by reducing access latencyImproves performance by reducing access latency But higher network overheads of maintaining consistencyBut higher network overheads of maintaining consistency Example: object is replicated N timesExample: object is replicated N times Read frequency R, write frequency W Read frequency R, write frequency W If R<<W, high consistency overhead and wasted messages If R<<W, high consistency overhead and wasted messages Consistency maintenance is itself an issue Consistency maintenance is itself an issue What semantics to provide?What semantics to provide? Tight consistency requires globally synchronized clocks!Tight consistency requires globally synchronized clocks! Solution: loosen consistency requirements Solution: loosen consistency requirements Variety of consistency semantics possibleVariety of consistency semantics possible

CS677: Distributed OS Data-Centric Consistency Models Consistency model (aka consistency semantics) Consistency model (aka consistency semantics) Contract between processes and the data storeContract between processes and the data store If processes obey certain rules, data store will work correctly If processes obey certain rules, data store will work correctly All models attempt to return the results of the last write for a read operationAll models attempt to return the results of the last write for a read operation Differ in how “last” write is determined/defined Differ in how “last” write is determined/defined

CS677: Distributed OS Strict Consistency Any read always returns the result of the most recent write Any read always returns the result of the most recent write Implicitly assumes the presence of a global clockImplicitly assumes the presence of a global clock A write is immediately visible to all processesA write is immediately visible to all processes Difficult to achieve in real systems (network delays can be variable) Difficult to achieve in real systems (network delays can be variable)

CS677: Distributed OS Sequential Consistency Sequential consistency: weaker than strict consistency Sequential consistency: weaker than strict consistency Assumes all operations are executed in some sequential order and each process issues operations in program orderAssumes all operations are executed in some sequential order and each process issues operations in program order Any valid interleaving is allowed Any valid interleaving is allowed All agree on the same interleaving All agree on the same interleaving Each process preserves its program order Each process preserves its program order Nothing is said about “most recent write” Nothing is said about “most recent write”

CS677: Distributed OS Linearizability Assumes sequential consistency and Assumes sequential consistency and If TS(x) < TS(y) then OP(x) should precede OP(y) in the sequenceIf TS(x) < TS(y) then OP(x) should precede OP(y) in the sequence Stronger than sequential consistencyStronger than sequential consistency Difference between linearizability and serializbility?Difference between linearizability and serializbility? Granularity: reads/writes versus transactions Granularity: reads/writes versus transactions Example: Example: Process P1Process P2Process P3 x = 1; print ( y, z); y = 1; print (x, z); z = 1; print (x, y);

CS677: Distributed OS Linearizability Example Four valid execution sequences for the processes of the previous slide. The vertical axis is time. Four valid execution sequences for the processes of the previous slide. The vertical axis is time. x = 1; print ((y, z); y = 1; print (x, z); z = 1; print (x, y); Prints: Signature: (a) x = 1; y = 1; print (x,z); print(y, z); z = 1; print (x, y); Prints: Signature: (b) y = 1; z = 1; print (x, y); print (x, z); x = 1; print (y, z); Prints: Signature: (c) y = 1; x = 1; z = 1; print (x, z); print (y, z); print (x, y); Prints: Signature: (d)

CS677: Distributed OS Causal consistency Causally related writes must be seen by all processes in the same order. Causally related writes must be seen by all processes in the same order. Concurrent writes may be seen in different orders on different machinesConcurrent writes may be seen in different orders on different machines Not permittedPermitted

CS677: Distributed OS Other models FIFO consistency: writes from a process are seen by others in the same order. Writes from different processes may be seen in different order (even if causally related) FIFO consistency: writes from a process are seen by others in the same order. Writes from different processes may be seen in different order (even if causally related) Relaxes causal consistencyRelaxes causal consistency Simple implementation: tag each write by (Proc ID, seq #)Simple implementation: tag each write by (Proc ID, seq #) Even FIFO consistency may be too strong! Even FIFO consistency may be too strong! Requires all writes from a process be seen in orderRequires all writes from a process be seen in order Assume use of critical sections for updates Assume use of critical sections for updates Send final result of critical section everywhereSend final result of critical section everywhere Do not worry about propagating intermediate resultsDo not worry about propagating intermediate results Assume presence of synchronization primitives to define semantics Assume presence of synchronization primitives to define semantics

CS677: Distributed OS Other Models Weak consistency Weak consistency Accesses to synchronization variables associated with a data store are sequentially consistentAccesses to synchronization variables associated with a data store are sequentially consistent No operation on a synchronization variable is allowed to be performed until all previous writes have been completed everywhereNo operation on a synchronization variable is allowed to be performed until all previous writes have been completed everywhere No read or write operation on data items are allowed to be performed until all previous operations to synchronization variables have been performed.No read or write operation on data items are allowed to be performed until all previous operations to synchronization variables have been performed. Entry and release consistency Entry and release consistency Assume shared data are made consistent at entry or exit points of critical sectionsAssume shared data are made consistent at entry or exit points of critical sections

CS677: Distributed OS Summary of Data-centric Consistency Models ConsistencyDescription StrictAbsolute time ordering of all shared accesses matters. Linearizability All processes must see all shared accesses in the same order. Accesses are furthermore ordered according to a (nonunique) global timestamp SequentialAll processes see all shared accesses in the same order. Accesses are not ordered in time CausalAll processes see causally-related shared accesses in the same order. FIFO All processes see writes from each other in the order they were used. Writes from different processes may not always be seen in that order (a) ConsistencyDescription WeakShared data can be counted on to be consistent only after a synchronization is done ReleaseShared data are made consistent when a critical region is exited EntryShared data pertaining to a critical region are made consistent when a critical region is entered. (b)

CS677: Distributed OS Caching in WWW: Case Study Dramatic growth in world wide web traffic Dramatic growth in world wide web traffic Web accesses are non-uniform in nature Web accesses are non-uniform in nature Create hot-spots of server and network load, increase latencyCreate hot-spots of server and network load, increase latency Solution: employ web proxy caches Solution: employ web proxy caches Reduces user response times, server load, network loadReduces user response times, server load, network load ProxiesEnd-hostsServers Network

CS677: Distributed OS Content Distribution Network Content distribution network (CDN) Content distribution network (CDN) Collection of proxies that act as intermediaries between servers and clientsCollection of proxies that act as intermediaries between servers and clients Service a client request from “closest” proxy with the objectService a client request from “closest” proxy with the object Similar benefits as single proxy environments, but larger scaleSimilar benefits as single proxy environments, but larger scale Example: Akamai CDN - 13,000+ proxiesExample: Akamai CDN - 13,000+ proxies Caching in CDN => must maintain cache consistency Caching in CDN => must maintain cache consistency End-hostsServers

CS677: Distributed OS Consistency Mechanisms Time-to-live (TTL) values Time-to-live (TTL) values Expiration time of cached documentExpiration time of cached document Proxy must refresh from server after expirationProxy must refresh from server after expiration Poll: Use if-modified-since (IMS) HTTP requests Poll: Use if-modified-since (IMS) HTTP requests Weaker guarantees: document can change before expirationWeaker guarantees: document can change before expiration Poll every time Poll every time Poll the server upon request for a cached objectPoll the server upon request for a cached object Increases response time of requestsIncreases response time of requests Provides stronger consistency guaranteesProvides stronger consistency guarantees

CS677: Distributed OS Consistency with Leases Lease: fixed duration contract between server and proxy Lease: fixed duration contract between server and proxy Server agrees to notify proxy of all updates to an object over duration d Server agrees to notify proxy of all updates to an object over duration d “d” is the lease duration“d” is the lease duration Lease may be renewed upon expiryLease may be renewed upon expiry Properties: Properties: Server needs to notify each proxy caching the object of an updateServer needs to notify each proxy caching the object of an update Excessive burden for popular objects Excessive burden for popular objects Leases requires a server to maintain stateLeases requires a server to maintain state Overhead can be excessive for large CDNs Overhead can be excessive for large CDNs Leases provide stronger consistency guaranteesLeases provide stronger consistency guarantees Push-based approach, server-initiated consistencyPush-based approach, server-initiated consistency

CS677: Distributed OS Mid-term Exam Comments Closed book, closed notes, 90 min Closed book, closed notes, 90 min Lectures 1-13 included on the test Lectures 1-13 included on the test Focus on things taught in class (lectures, in-class discussions)Focus on things taught in class (lectures, in-class discussions) Start with lecture notes, read corresponding sections from textStart with lecture notes, read corresponding sections from text Supplementary readings are not included on the test.Supplementary readings are not included on the test. Exam structure: few short answer questions, mix of subjective and “design” questions Exam structure: few short answer questions, mix of subjective and “design” questions Good luck! Good luck!