Case Study - Amazon. Amazon r Amazon has many Data Centers r Hundreds of services r Thousands of commodity machines r Millions of customers at peak times.

Slides:



Advertisements
Similar presentations
Dynamo: Amazon’s Highly Available Key-value Store
Advertisements

Dynamo: Amazon’s Highly Available Key-value Store Slides taken from created by paper authors Giuseppe DeCandia, Deniz Hastorun,
Consistency Guarantees and Snapshot isolation Marcos Aguilera, Mahesh Balakrishnan, Rama Kotla, Vijayan Prabhakaran, Doug Terry MSR Silicon Valley.
Dynamo: Amazon’s Highly Available Key-value Store ID2210-VT13 Slides by Tallat M. Shafaat.
Linearizability Linearizability is a correctness criterion for concurrent object (Herlihy & Wing ACM TOPLAS 1990). It provides the illusion that each operation.
AMAZON’S KEY-VALUE STORE: DYNAMO DeCandia,Hastorun,Jampani, Kakulapati, Lakshman, Pilchin, Sivasubramanian, Vosshall, Vogels: Dynamo: Amazon's highly available.
D YNAMO : A MAZON ’ S H IGHLY A VAILABLE K EY - V ALUE S TORE Presented By Roni Hyam Ami Desai.
Chapter 4 Infrastructure as a Service (IaaS)
Distributed Hash Tables Chord and Dynamo Costin Raiciu, Advanced Topics in Distributed Systems 18/12/2012.
Amazon’s Dynamo Simple Cloud Storage. Foundations 1970 – E.F. Codd “A Relational Model of Data for Large Shared Data Banks”E.F. Codd –Idea of tabular.
Dynamo: Amazon's Highly Available Key-value Store Distributed Storage Systems CS presented by: Hussam Abu-Libdeh.
Dynamo: Amazon's Highly Available Key-value Store Guiseppe DeCandia, Deniz Hastorun, Madan Jampani, Gunavardhan Kakulapati, Avinash Lakshman, Alex Pilchin,
Amazon Fay Chang, Jeffrey Dean, Sanjay Ghemawat, Wilson C. Hsieh, Deborah A. Wallach, Mike Burrows, Tushar Chandra, Andrew Fikes, Robert E. Gruber Google,
Dynamo: Amazon’s Highly Available Key-value Store Adopted from slides and/or materials by paper authors (Giuseppe DeCandia, Deniz Hastorun, Madan Jampani,
1 Dynamo Amazon’s Highly Available Key-value Store Scott Dougan.
Consistency-Based Service Level Agreements for Cloud Storage Douglas B. Terry, Vijayan Prabhakaran, Ramakrishna Kotla, Mahesh Balakrishnan, Marcos K. Aguilera,
Data Structures Hash Tables
Dynamo: Amazon’s Highly Available Key- value Store (SOSP’07) Giuseppe DeCandia, Deniz Hastorun, Madan Jampani, Gunavardhan Kakulapati, Avinash Lakshman,
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Rethinking Dynamo: Amazon’s Highly Available Key-value Store --An Offense Shih-Chi Chen Hongyu Gao.
Replication and Consistency CS-4513 D-term Replication and Consistency CS-4513 Distributed Computing Systems (Slides include materials from Operating.
Dynamo A presentation that look’s at Amazon’s Dynamo service (based on a research paper published by Amazon.com) as well as related cloud storage implementations.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.
Amazon’s Dynamo System The material is taken from “Dynamo: Amazon’s Highly Available Key-value Store,” by G. DeCandia, D. Hastorun, M. Jampani, G. Kakulapati,
Dynamo: Amazon’s Highly Available Key-value Store Giuseppe DeCandia, et.al., SOSP ‘07.
Cloud Storage – A look at Amazon’s Dyanmo A presentation that look’s at Amazon’s Dynamo service (based on a research paper published by Amazon.com) as.
Dynamo: Amazon’s Highly Available Key-value Store Presented By: Devarsh Patel 1CS5204 – Operating Systems.
Distributed Data Stores – Facebook Presented by Ben Gooding University of Arkansas – April 21, 2015.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Case Study: Amazon Dynamo Steve Ko Computer Sciences and Engineering University at Buffalo.
Peer-to-Peer in the Datacenter: Amazon Dynamo Aaron Blankstein COS 461: Computer Networks Lectures: MW 10-10:50am in Architecture N101
Dynamo: Amazon’s Highly Available Key-value Store COSC7388 – Advanced Distributed Computing Presented By: Eshwar Rohit
Distributed Systems Tutorial 11 – Yahoo! PNUTS written by Alex Libov Based on OSCON 2011 presentation winter semester,
Server-side Scripting Powering the webs favourite services.
Fault Tolerance via the State Machine Replication Approach Favian Contreras.
HBase A column-centered database 1. Overview An Apache project Influenced by Google’s BigTable Built on Hadoop ▫A distributed file system ▫Supports Map-Reduce.
Dynamo: Amazon's Highly Available Key-value Store Dr. Yingwu Zhu.
Dynamo: Amazon’s Highly Available Key-value Store DeCandia, Hastorun, Jampani, Kakulapati, Lakshman, Pilchin, Sivasubramanian, Vosshall, Vogels PRESENTED.
Google’s Big Table 1 Source: Chang et al., 2006: Bigtable: A Distributed Storage System for Structured Data.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Amazon’s Dynamo Lecturer.
D YNAMO : A MAZON ’ S H IGHLY A VAILABLE K EY - VALUE S TORE Presenters: Pourya Aliabadi Boshra Ardallani Paria Rakhshani 1 Professor : Dr Sheykh Esmaili.
Dynamo: Amazon’s Highly Available Key-value Store
CSE 486/586 CSE 486/586 Distributed Systems Case Study: Amazon Dynamo Steve Ko Computer Sciences and Engineering University at Buffalo.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Data Versioning Lecturer.
CAP + Clocks Time keeps on slipping, slipping…. Logistics Last week’s slides online Sign up on Piazza now – No really, do it now Papers are loaded in.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation MongoDB Architecture.
GFS. Google r Servers are a mix of commodity machines and machines specifically designed for Google m Not necessarily the fastest m Purchases are based.
Distributed Systems CS Consistency and Replication – Part IV Lecture 21, Nov 10, 2014 Mohammad Hammoud.
Dynamo: Amazon’s Highly Available Key-value Store DAAS – Database as a service.
Department of Computer Science, Johns Hopkins University EN Instructor: Randal Burns 24 September 2013 NoSQL Data Models and Systems.
Big Data Yuan Xue CS 292 Special topics on.
Kitsuregawa Laboratory Confidential. © 2007 Kitsuregawa Laboratory, IIS, University of Tokyo. [ hoshino] paper summary: dynamo 1 Dynamo: Amazon.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Amazon’s Dynamo Lecturer.
CS 540 Database Management Systems NoSQL & NewSQL Some slides due to Magda Balazinska 1.
CSE 486/586 Distributed Systems Consistency --- 2
CSE 486/586 Distributed Systems Case Study: Amazon Dynamo
CS 440 Database Management Systems
Dynamo: Amazon’s Highly Available Key-value Store
NOSQL.
Lecturer : Dr. Pavle Mogin
Lecture 9: Dynamo Instructor: Weidong Shi (Larry), PhD
6.4 Data and File Replication
EECS 498 Introduction to Distributed Systems Fall 2017
CS 440 Database Management Systems
Dynamo Recap Hadoop & Spark
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
CRDTs and Coordination Avoidance (Lecture 8, cs262a)
EECS 498 Introduction to Distributed Systems Fall 2017
CSE 486/586 Distributed Systems Case Study: Amazon Dynamo
Presentation transcript:

Case Study - Amazon

Amazon r Amazon has many Data Centers r Hundreds of services r Thousands of commodity machines r Millions of customers at peak times r Performance + Reliability + Efficiency = $$$$$ r Outages are bad m Customers lose confidence, Business loses money r Accidents happen

Amazon r Amazon has hundreds of services that deliver a wide range of functionality r Service infrastructure m Tens of thousands of servers located across many data centers world wide

Amazon r Amazon has too much data to store at a single site r The data must be partitioned across sites r The data must also be replicated r For some services there may be a need to sacrifice strong consistency for availability for some services

Amazon r Amazon has developed several storage technologies r One of these is Dynamo which is a distributed datastore r Dynamo is used for services with high reliability requirements but m Need tight control over the tradeoffs between availability, consistency, and performance

Amazon r Some of the services Dynamo supports include: m Customer shopping carts m Customer sessions m Amazon search engine r Highly replicated m Replicas exist within a data centre and across data centres

Dynamo r The datastore is a type of database but it is not a typical relational database r A typical database has these properties: m Data is organized in tables that are sorted based on primary/secondary keys m Lots of flexibility in queries based on any field in the table m Difficult to replicate r In Dynamo: m A query only uses the primary key. m Each data item is replicated at N hosts.

System Interface r get(key) m Locate and return data r put(key) m Determines where the data is to be placed Based on a hash of the key which determines the physical node m Writes data to disk r Both operations use HTTP

Replication r Each node has a coordinator m This is the node determined by the hash on the key m Nodes are logically organized as a ring (more on this later) m The data is replicated at the N nodes “next” to the coordinator node in the ring

Replication r Eventually consistent data store m If no updates take place for a long enough period time, all replicas will gradually (i.e., eventually) become consistent.

Execution of put() r For a put() operation the coordinator does the following: m Generates the vector clock for the new version and writes the new version locally m Sends the new version (with the new vector clock) to the replicas m If at least W-1 nodes respond the write is considered successful m A put() call may return to its caller before the update has been applied at all the replicas

Example put(x,1) x = 0 Note: Logical Timestamps are associated with data

Example put(x,1) [1 0 0] put(x,1) [1 0 0] x = 1 x = 0

Example put(x,1) [1 0 0] x = 1 x = 0

Example x = 1

Execution of get() r For a get() operation the coordinator does the following: m Coordinator requests all existing versions of data for that key from the N highest-ranked reachable nodes in the preference list for that key m Waits for R responses before returning the result to the client

Configurable Parameters r R is the minimum number of nodes that must participate in a successful read operation r W is the minimum number of nodes that participate in a successful write operation

Data Versioning r Updates are propagated to all replicas asynchronously r A put() call may return to its caller before the update r A subsequent get() operation may: m return a data object that does not have the latest updates m Furthermore since get() needs R responses; The R responses may represent different versions. r The reader reconciles the versions returned by get()

Example put(x,1) [1 0 0] Two replicas have x = 1; one does not; Have to reconcile when replicas do not have the same value x = 1 x = 0

Data Versioning r Why not wait for the put() to receive responses from each of the replicas before returning? r Amazon wants an always writable data store m Do we want a shopping cart that we have to often wait on (the answer it turns out is no)? m Slow customer updates could result in a poor customer experience

Example: Shopping Cart r Assume that all vector clock values are initialized to 0 r Assume three replicas: S x,S y,S z r Let us assume that the identifier of the coordinator is S x r Assume that Hanan’s shopping cart is represented by the key 1234 r Her shopping cart is initially empty r She wants to purchase The Girl with the Dragon Tattoo

Example: Shopping Cart r The contents of the shopping cart at the coordinator is now the following: m {(“The Girl with the Dragon Tattoo“, 5 dollars)} r Let us represent the shopping cart data by D1 r The vector timestamp for D1 is [1,0,0] r We will use the notation D1(S x,[1,0,0]) to denote the timestamp associated with D1 by S x

Example: Shopping Cart r Now let us assume that Hanan adds to the shopping cart the following: m {(“The Girl who Played with Fire“, 5 dollars)} r The new value of the shopping cart is {(“The Girl with the Dragon Tattoo“, 5 dollars), (“The Girl who Played with Fire“, 5 dollars)} r The new contents of the shopping cart is represented by D2 and the associated timestamp is D2(S x,[2,0,0])

Example: Shopping Cart r Assume that the shopping cart is read and that one of the responses is D1(S x,[1,0,0]) and the other is D2(S x,[2,0,0]) r The clocks show which is the most recent update r The customer will see a shopping cart with both books in it. r Note: At some point all replicas will have both books in the shopping cart

Example: Shopping Cart r Let us now look at an extension of the example r In this variation assume that the coordinator (S x )failed (temporarily) and that an update request went to another node which we will denote by S y

Example: Shopping Cart r The update request is that the book, The Girl who Played with Fire is deleted from the shopping cart. The contents of the shopping cart is the following: {(“The Girl with the Dragon Tattoo“, 5 dollars)} r The new contents of the shopping cart is represented by D3 and the associated timestamp is D3(S y,[2,1,0])

Example: Shopping Cart r Assume that the next update request ends up at other node which we will denote by S z r In this update request another book, The Girl who Kicked the Hornet’s Nest, is be added to the shopping cart. r Assume that S z hasn’t received anything from S y but it had received updates from S x

Example: Shopping Cart r The new value of the shopping cart is {(“The Girl with the Dragon Tattoo“, 5 dollars), (“The Girl who Played with Fire“, 5 dollars), (“The Girl who Kicked the Hornet’s Nest”, 8 dollars)} r Let us denote this data by D4. r The vector timestamp is D4(S z,[2,0,1])

Example: Shopping Cart r Now the client wants to read the shopping cart r It gets back two versions: m D3 with timestamp [2,1,0] m D4 with timestamp [2,0,1] m One timestamp is not larger than the other m D3 has two books and D4 has three books m The client assumes D4 since it has all the writes r Amazon’s policy for reconciling m Add to Cart operation can never be forgotten or rejected

Data Versioning

Summary r Use of vector timestamps in Amazon r A little information related to Amazon