20
Dynamo: Amazon’s Highly Available Key- Value Store Christopher Meiklejohn Jiangnan Shangguan Monday, March 4, 13

Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Dynamo: Amazon’s Highly Available Key-

Value StoreChristopher Meiklejohn

Jiangnan Shangguan

Monday, March 4, 13

Page 2: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Problem

• Reliability

• shopping carts

• session data

• Scalability

• Availability versus Consistency

• during failure conditions

Monday, March 4, 13

Page 3: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Requirements• Query Model

• key/value based

• Efficiency

• 99.9th percentile

• Conflict Resolution

• Always writable

• Performed by application

Monday, March 4, 13

Page 4: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

System Architecture

• Partitioning

• Replication

• Versioning

• Membership

• Failure Handling

• Scaling

Monday, March 4, 13

Page 5: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

System Interface

• get(key)

• put(key, context, object)

• MD5

Monday, March 4, 13

Page 6: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Consistent Hashing

• Scale incrementally

• Dynamic partitioning

• Ring

• Uniform data and load distribution

• Virtual nodes

Monday, March 4, 13

Page 7: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Replication

• Replicate at N virtual nodes

• Preference list (consisting of N virtual nodes)

G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in SOSP

Monday, March 4, 13

Page 8: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Data Versioning• Vector Clocks

• Determine causality

G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in SOSP

Monday, March 4, 13

Page 9: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Execution of GET/PUT

• Any node can be a coordinator

• Coordinator responsible for writing v-clock

• Quorums (R/W)

• R + W > N

Monday, March 4, 13

Page 10: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Handling Failures

• Hinted Handoff

• Metadata hint for owning node

• “Sloppy Quorums”

• N healthy nodes

• starting with preferences list

Monday, March 4, 13

Page 11: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Replica Repair• Hinted replicas no longer available

• Anti-entropy synchronization method

• Merkle trees

• Starting with partition key space

• Nodes exchange trees corresponding to common partitions

• Implementation vague

Monday, March 4, 13

Page 12: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Ring Membership• Separate explicit mechanism

• Nodes may be down for maintenance

• Nodes may be powered up by accident

• Gossip protocol is used to propagate

• Nodes randomly select tokens mapping to virtual nodes for ownership.

• Ownership transfer happens between nodes no longer responsible for that data

Monday, March 4, 13

Page 13: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Implementation

• Three main components

• Request coordination

• Membership and failure detection

• Local persistence

Monday, March 4, 13

Page 14: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Local Persistence

• Pluggable backends

• Memory backend

• Berkeley DB

• MySQL

Monday, March 4, 13

Page 15: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Request Coordination• Messaging substrate

• Similar to SEDA (pipelining)

• Heavy use of finite state machines

• Read coordination

• eg. send requests, wait for responses, fail, systematic resolution, read repair

• Write coordination

• Latency requirements allow for any node to coordinate requests.

Monday, March 4, 13

Page 16: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Resolution Strategies

• Business specific resolution

• shopping cart

• Timestamp based resolution (ie. LWW)

• session data

Monday, March 4, 13

Page 17: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Performance

• Designed for commodity hardware

• Optimize performance using writer thread

• Object cache

• Durable write quorum (DW)

Monday, March 4, 13

Page 18: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Partitioning Strategies

G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in SOSP

Monday, March 4, 13

Page 19: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Divergence

• Failure scenarios

• High concurrency writes

Monday, March 4, 13

Page 20: Dynamo: AmazonÕs Highly Available Key- Value Store · • Gossip protocol is used to propagate ... G. DeCandia et al.,(2007) Dynamo: Amazon's highly available key-value store, in

Thank you!Questions?

Monday, March 4, 13