anh nguyen. the emergence of continuous consistency model (ccm) conit-based ccm what is it? ...

28
Anh Nguyen

Upload: gerald-lindsey

Post on 27-Dec-2015

229 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Anh Nguyen

Page 2: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

The emergence of continuous consistency model (CCM)

Conit-based CCMWhat is it?PoliciesExamples

DiscussionBreak…

The composability of consistency conditions Discussion

Summary2

Page 3: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Understand the ideas of CCM, and Conit-based CCM Examples▪ Identify conits, parameters

Understand the general meaning of the framework of the composability of consistency conditionsWhat is it?What is it for?Basic consistency conditions

3

Page 4: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

The availability of servicesThe exponential increase in access to Web

services

Network failures

0.1% improvement in availability ≈ 8 hours of additional uptime/year ≈ $1 million in additional revenue

Replication is a key approach4

Page 5: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Despite being a really promising solution to improve the availabality of services, it also brings about many new issuesInconsistency among replicas

Ex: distributed database

5

Page 6: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Strict consistency modelsSynchronise accesses to a subset of replicas to achieve a uniform view of write orderings

One-copy serializability

Impose performance overheadLimit system availability

Keep the system consistent

Well-known tradeoffs between consistency and availability

6

Optimistic consistency modelsAllow multiple updates to take place simultaneously at defferent replicas

Resolve conflicts: reconciliation algorithms (Ficus)

Improve performanceImprove system availability

Unbounded rate of conflicting updates can quickly leave the system in a ”delusional” state

Page 7: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Designers have been forced to choose from either consistency guarantees (strict consistency models) or none at all (optimistic consistency models)Different applications have different requirements about

consistency (the level of consistency)Bulletin board vs Airline reservation system

An application may need different levels of consistency during its runtime or under certain circumstancesA dynamic web page tracking the score of a football game

→ Continuous consistency models: enable services to describe and to specify different levels of consistency in between traditional strong and optimistic consistency

7

Page 8: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Haifeng Yu and Amin Vahdat introduced the concept of a conit (consistency unit)

The conit-based CCMallows a broad range of replicated services to

conveniently and quantitatively express their consistency requirements

applicable to a wide range of applications (generality)

able to efficiently enforce target consistency levels (practicality)

8

Page 9: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

A conit is a logical consistency unit

The space of consistency is parameterized by the following metricsNumerial error: the total weight of writes on a conit

not seen by a replica

Order error: the number of writes that have not established their commit order at any one replica

Staleness: a real-time bound on the delay of write propagation among replicas

9

Page 10: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

An example: a replicated bulletin board service where users may post/retrieve news messages to/from any replicaConit: number of all news messages

Numerial error: the total number of messages posted system-wide but not seen locally

Order error: the number of out of order messages on a given replica (messages seen locally but not committed)

Staleness: the delay of messages10

Page 11: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

An exercise Airline Reservation System

A replicated e-commerce service that accepts inquiries and purchase orders on a catalog

Each server maintains a full replica of the flight information database and accepts user reservatinos and inquiries about seat availability

Conitrepresents for the number of available seatsAt a state of the system

Committed value of the number of available seats: 300At a replica:

the number of available seats is 350The number of seats currently booked by users (not committed yet): 100Numerial error: Order error: Staleness

11

50100

Page 12: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

12

Page 13: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

The continuity of conit-based CCM (numerical error, order error, staleness) Strict consistency models: (0,0,0) Optimistic consistency models: (∞, ∞, ∞) Real values for the parameters achieve the continuity

The level of service consistency is adjusted flexibly by changing (numerical error, order error, staleness)

Each replica can have its own independent consistency level for a conit. This allows the system to route client requests to replicas with appropriate consistency bounds on a per-request basis In the airline reservation system, requests from ”preferred”

clients may be directed to a replica that maintains higher consistency levels (reducing the probability of an inconsistent access)

13

Page 14: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

AffectConit(): how each write affects the return value of a conit F. The systemcan then infer the return value of F by summing all accumulated numerical weights

DependonConit(): declare the required consistency level on each access14

Page 15: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Continuous consistency programmingCrystallise high-level application consistency

semantics. ”what does 90% consistency mean?”

Conit, numerical error, order error, staleness

AffectConit()

DependonConit()

TACT: A middleware layer

15

Page 16: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Can conit-based CCM model the consistency of all (most) services?

DifficultiesThe number of conits changes rapidly?

Adaptability

Haifeng Yu, Amin Vahdat, ”The Costs and Limits of Availability for Replicated Services”, ACM Trans. Comput. Syst. 24(1): 70-113 (2006)

16

Page 17: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

17

Page 18: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

DependonConit(): declare the required consistency level on each access

Another approach to express different levels of consistency Defines basic consistency conditions

A formal framework that enables composing a collection of consistency conditions into a more restrictive one

Proves that a given implementation of a high level condition is correct

Can be used to devise flexible, composable implementation of consistency conditions

18

Page 19: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Definitions and conventions Client processes: p1, p2, …, pn

An operation: op (read, write) An invocation event: inv(op) A corresponding response event: resp(op)

A history (H): a sequence of invocation and response events A sequential history: each invocation event is immediately followed by

the matching response event

A serialization (S) of a history H: a sequential history containing all the operations of H

A sequential history H to be legal if the value returned by each read operation r in H is the same as the value written by the last write operation that accesses the same object before r in H

19

Page 20: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Composability framework Consistency condition (consistency): a set of restrictions on

allowed histories (level of consistency)

Eventual Propagation: every write operation by any process must be seen by all other processes

Strong consistency conditions require the existence of some special legal serialization of the history All processes view the operations in the same logical order

Weaker conditions only require the existence of one special serialization for each process Each process views the operations in a different logical order

A history preserves a consistency condition by requiring the existence of a serialization set that obeys certain ordering restrictions

20

Page 21: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Basic consistency conditionsRead Your Writes (for a local history)

for every two operations write and read in the local history

If write precedes read, the return value of read is the value updated by write

FIFO of Reads (for a local history)for every two operation read1 and read2 in the local

history

If read1 precedes read2, the return value of read2 is ”newer” or equal to the return value read1

21

Page 22: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Basic consistency conditionsFIFO of Writes (for a local history)

For every two operations write1 and write2 in the local history

If write1 precedes write2, the object is updated by write1 and then write2

Reads Before Writes (for a local history)For every two operations read and write in the

local history

If read precedes write, the return value of read is the value not updated by write

22

Page 23: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Basic consistency conditionsLocal Causality (for a local history)

For every three operations write1, read, and write2 in which read and write2 are in the local history (write1 is not)

If the return value of read is a result written by write1 and read precedes write2, the object is updated by write1 and then write2

Total order

23

Page 24: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

An example of useful compositionsAny history that is consistent with respect to Total

Order and Reads Before Writes is also consistent with respect to Local Causality

An applicationThere are several simple clients and a few

supervisor clients. Each simple client reads and writes to different objects than the other simple clients. Supervisors can read all objects

Simple clients: FIFO of Writes and Read Your Writes

Supervisors: FIFO of Reads

24

Page 25: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

In an deal systemEach basic condition will be

implemented as a layer of code

When a given application needs a specific high-level consistency condition, it could simply pick the layers that implement the collection of basic conditions from which the high-level condition is composed of

25

Page 26: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Difficulties?Implementation compositions of

conditionsIn compile time?On-the-fly?

Does a complete set of basic consistency conditions to generate any consistency condition exist?

26

Page 27: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Conit-based CCMThe composability of consistency

conditions

Adaptability and Dependability

27

Page 28: Anh Nguyen.  The emergence of continuous consistency model (CCM)  Conit-based CCM  What is it?  Policies  Examples  Discussion Break…  The composability

Section 7.5.1 in TvS

"Design and Evaluation of a Conit-based Continuous Consistency Model for Replicated Services." ACM Transactions on Computer Systems, by Yu and Vahdat

"On the composability of consistency conditions“ Information Processing Letters by Friedman, vitenberg, and Chockler

”The Costs and Limits of Availability for Replicated Services”, ACM Trans. Comput. Syst. 24(1): 70-113 (2006), by Haifeng Yu, Amin Vahdat

28