Consistency in key- value stores Monika Moser Consistency - - PowerPoint PPT Presentation

consistency in key value stores
SMART_READER_LITE
LIVE PREVIEW

Consistency in key- value stores Monika Moser Consistency - - PowerPoint PPT Presentation

Consistency in key- value stores Monika Moser Consistency guarantees explain a system's behavior Where is my data I just updated? The consistency guarantees of a system influence the behavior perceived by a client. An ideal world The result


slide-1
SLIDE 1

Consistency in key- value stores

Monika Moser

slide-2
SLIDE 2

Consistency guarantees explain a system's behavior

slide-3
SLIDE 3

Where is my data I just updated?

The consistency guarantees of a system influence the behavior perceived by a client.

slide-4
SLIDE 4

An ideal world

The result of every write-operation is reflected by subsequent read-operations.

1-copy-serializability

slide-5
SLIDE 5

Replication

Internet-scale storage systems replicate data Performance Availability Persistence

slide-6
SLIDE 6

Different kinds of consistency guarantees for the client

slide-7
SLIDE 7

Consistency from a client's point of view

Eventual Strong (1-copy serializability)

slide-8
SLIDE 8

Eventual consistency

slide-9
SLIDE 9

Eventual consistency flavors

Read your writes consistency

slide-10
SLIDE 10

Eventual consistency flavors

Session consistency

slide-11
SLIDE 11

Eventual consistency flavors

Monotonic read consistency

slide-12
SLIDE 12

Strong consistency

1 copy serializability

slide-13
SLIDE 13

Consistency from a system's point of view

slide-14
SLIDE 14

Read and write sets

N Replicas W Replicas in the write set R Replicas in the read set

slide-15
SLIDE 15

Strong consistency

W + R > N

slide-16
SLIDE 16

Weak or eventual consistency

W + R <= N

slide-17
SLIDE 17

You have to choose!

CAP-Theorem 2 out of 3 Partition tolerance Availability Consistency

slide-18
SLIDE 18

Consistency, Availability, Partition Tolerance

Availability of data cannot be guaranteed

slide-19
SLIDE 19

Consistency, Availability, Partition Tolerance Consistency of data cannot be guaranteed

slide-20
SLIDE 20

Strong consistency. What makes it expensive?

slide-21
SLIDE 21

Strong consistency

Write all, read one No failures tolerated Good read performance

slide-22
SLIDE 22

Strong consistency

Quorum, e.g Paxos Read and writes from a majority Tolerates the failure of a minority

slide-23
SLIDE 23

If you need agreement you're lost

“Each node in a system should be able to make decisions purely based on local state. If you need to do something under high load with failures occurring and you need to reach agreement, you’re lost… If you’re concerned about scalability, any algorithm that forces you to run agreement will eventually become your

  • bottleneck. Take that as a given.”

— Werner Vogels, Amazon CTO and Vice President

slide-24
SLIDE 24

Paxos

A fault tolerant quorum-based consensus algorithm

slide-25
SLIDE 25

Paxos properties

Replicas may crash and later recover Messages may be lost If a majority of replicas runs without crashing, all replicas eventually agree

slide-26
SLIDE 26

Paxos

2 Phases Read phase Get a promise that your update will be executed by a quorum Write phase If the read phase was acknowledged, start the write phase

slide-27
SLIDE 27

Paxos - communication steps

Writes: Leader

slide-28
SLIDE 28

Paxos - leader fails

Writes: New Leader

Ordering among leaders

slide-29
SLIDE 29

Paxos - leader fails

Writes: New Leader

Ordering among leaders Choice of value restricted

slide-30
SLIDE 30

Tradeoffs

Availability vs Consistency Read vs Write Performance Read patterns of the system? Write patterns? Probability of a conflict? Can the system deal with the conflict resolution techniques?

slide-31
SLIDE 31

monika.m.moser@googlemail.com

Questions? Thanks!