Distributed Systems. Day 13: Distributed Transaction. To Be or Not to Be Distributed.. Transactions

Size: px
Start display at page:

Download "Distributed Systems. Day 13: Distributed Transaction. To Be or Not to Be Distributed.. Transactions"

Transcription

1 Distributed Systems Day 13: Distributed Transaction To Be or Not to Be Distributed.. Transactions

2 Summary Background on Transactions ACID Semantics Distribute Transactions Terminology: Transaction manager,, Two Phase Commit Adding Isolation with Locks: optimistic V. pessimistic Performance Issues Consistency Models Serializability Versus Linearizability

3

4

5 Hash table k 0 v 0 k 1 v 1 k 2 v 2 k 3 v 3 k 4 v 4 All Facebook Data k 5 v 5 Replication Lazy, Passive, Active Consistency for a single shard Distributed Transaction Consistent/Atomic change to data in multiple shards Multiple shards è Can use traditional replication techniques Clients send requests To all replicas FE FE Node A Node B Node C Shard 1 Shard 1 Shard 1 k 4 v 4 k 5 v 5 k 4 v 4 k 5 v 5 k 4 v 4 k 5 v 5 Partition data into shards, maps shards to server with consistent hashing Node D Node E Node F Shard 2 Shard 2 Shard 2 k 2 v 2 k 3 v 3 k 2 v 2 k 3 v 3 k 2 v 2 k 3 v 3 Maintain multiple copies For fault tolerance and to reduce latency

6 What is Transaction? A set of operations that need to be performed together. Example 1: transferring money between accounts Example 2: shopping cart checkout Initially Theo and Rodrigo have $100. Goal: Transfer $50 from Rodrigo to Theo. Read(R) Update(R, $50) Read(T) Update(T, $150) Rodrigo is in shard 1 Theo is in shard 2 Shard 1 Shard 2 Node A Node D Shard 1 Shard 2

7 What is Transaction? A set of operations that need to be performed together. Example 1: transferring money between accounts Example 2: shopping cart checkout Initially Theo and Rodrigo have $100. Goal: Transfer $50 from Rodrigo to Theo. Ideal: either the whole 4 operations happen or none happen Worst case: only a subset occur Read(R) Update(R, $50) Read(T) Update(T, $150) Rodrigo is in shard 1 Theo is in shard 2 Shard 1 Shard 2 Node A Node D Shard 1 Shard 2

8 Transaction Background ACID Semantics Atomicity Consistency Isolation Durability All or nothing semantics: all operations succeeds or fails. Transitions from one consistent state to another consistent state Intermediate states are not exposed to the outside world (no partial writes are exposed) Results of a committed transactions persists after the transaction (and through failures) Transactions are easy for traditional databases Traditional databases are on a single server à failure is ``all-or-nothing All components of the transactions fail Distributed transactions à different components can fail Need to provides Transaction semantics when only a subset of the components fail

9 Distributed Transactions Semantics Transaction Manager Server in charge of orchestrating the transaction Steps for transaction Client initiates a transaction TM gives client a Transaction ID (TID) Client submits operations to TM TM relays operations to replicas Client commits transaction TM performs two phase commit Node A Node B Node C FE Transaction Manager Shard 1 Shard 1 Shard 1 Node D Node E Node F Shard 2 Shard 2 Shard 2

10 Client-Side Code: Distributed Transactions Semantics tid = opentransaction(); RVal = a.get(tid, Rodrigo); a.update(tid, Rodrigo, RVal- 50); Tval = b.get(tid,theo); Transaction Manager b.update(tid,theo, Tval + 50); closetransaction(tid) Server in charge orof orchestrating the aborttransaction(tid) transaction Steps for transaction Client initiates a transaction TM gives client a Transaction ID (TID) Client submits operations to TM TM relays operations to replicas Client commits transaction TM performs two phase commit FE Transaction Manager Shard 1 Node A Node D Replica Shard Manager 1 Shard 2 Prepare operations Store operations locally in log Node But B do not commit Node operations E Shard 1 Transaction Manager TM hands out TIDs TM manages and relays operations to Replica Leaders TM keeps track of all Replicas involved in the transactions Shard 2 Shard 2 Node C Node F

11 Two Phase Commit

12 Two Phase Commit FE Provides Atomicity and Consistency NOT Isolation and Durability Assumptions: each server maintains a transaction log Transaction log is stored in persistent memory If failure à items in Transaction Log survives Terminology changes: <--- The transaction Manager ß Leader of a replica Transaction Manager Node A Node B Node C Shard 1 Shard 1 Shard 1 Node D Node E Node F Shard 2 Shard 2 Shard 2

13 Two Phase Commit Ready to Commit? Phase 1: sends request for votes s vote Vote [Yes/No] Phase 2: counts votes informs of transaction status At the end of Phase 2: either all participants commit or all abort Count Votes!!!!!! Abort/Commit?

14 State Diagram for Two-Phase Commit Init app commit/vote req Ready? pariticpants pariticpants pariticpants pariticpants any abort/abort Wait all commit/commit Vote: Commit or Abort Abort Commit Response

15 State Diagram for Two-Phase Commit Make a change pariticpants pariticpants pariticpants pariticpants vote req/abort Init vote req/commit Commit or Abort abort/ack Uncertain commit/ack Response Abort Commit

16 State Diagrams for Two Phase Commit Init app commit/vote req vote req/abort Init vote req/commit any abort/abort Wait all commit/commit abort/ack Uncertain commit/ack Abort Commit Abort Commit

17 Two Phase Commit Ready to Commit? Phase 1: sends request for votes s vote Vote [Yes/No] Phase 2: counts votes informs of transaction status At the end of Phase 2: either all participants commit or all abort Count Votes!!!!!! Abort/Commit?

18 Two Phase Commit With Failures Ready to Commit? What is the impact of failures on 2PC? Vote [Yes/No] 2PC is synchronous Failure == node failure or network failure Failure --> the protocol blocks/stalls fails, participants will be uncertain (waiting) fails, coordinator will be waiting Count Votes!!!!!! Abort/Commit?

19 Crash Points Init app commit/vote req vote req/abort Init vote req/commit any abort/abort Wait all commit/commit abort/ack Uncertain commit/ack Abort Commit Abort Commit

20 Crash Points Init app commit/vote req vote req/abort Init vote req/commit any abort/abort Wait all commit/commit abort/ack Uncertain commit/ack Abort Commit Abort Commit

21 Two Phase Commit With Failures What is the impact of failures on 2PC? 2PC is synchronous Failure == node failure or network failure Failure --> the protocol blocks/stalls fails, participants will be uncertain (waiting) fails, coordinator will be waiting Ready to Commit? Vote [Yes/No] Count Votes!!!!!! Detect failure using Timeouts Is this model Synchronous or Asynchronous? Abort/Commit?

22 Two Phase Commit With Failures Ready to Commit? What is the impact of failures on 2PC? 2PC is synchronous Failure == node failure or network failure Failure --> the protocol blocks/stalls Vote [Yes/No] fails, participants will be uncertain (waiting) fails, coordinator will be waiting Detect failure using Timeouts detects participant failure and assumes ABORT à Transaction terminates detects failure Why Can t automatically ABORT? Count Votes!!!!!! Abort/Commit?

23 Recovery from Failure vote req/abort Init vote req/commit in Uncertain state waiting for coordinator to say commit or abort abort/ack Uncertain commit/ack It detects failure of coordinator Using timeout Abort Commit in Uncertainstate can t assume either outcome - BAD things happen if participant makes wrong assumptions waits for coordinator to restart - On restart contact coordinator for final outcome

24 Recovery from Failure vote req/abort Init vote req/commit Uncertain abort/ack commit/ack Abort Commit in Uncertain state waiting for coordinator to say commit or abort It detects failure of coordinator Using timeout in Uncertain state can t assume either outcome - BAD things happen if participant makes wrong assumptions waits for coordinator to restart - On restart contact coordinator for final outcome

25 Recovery from Failure any abort/abort Abort Init Wait app commit/vote req all commit/commit Commit in wait state waiting for participant to say commit or abort It detects failure of participant Using timeout assumes they said no Takes no response as an abort Abort transaction!! If participant Fails, can make progress

26 Two Phase Commit With Failures Ready to Commit? What is the impact of failures on 2PC? 2PC is synchronous Failure == node failure or network failure Failure --> the protocol blocks/stalls Vote [Yes/No] fails, participants will be uncertain (waiting) fails, coordinator will be waiting Detect failure using Timeouts detects participant failure and assumes ABORT à transaction terminates detects failure The participant must wait for coordinator The transaction is stalled! Count Votes!!!!!! Abort/Commit?

27 Two Phase Commit and CAP Theorem! Ready to Commit? During a partition Does 2PC pick Availability or Consistency? Network Partition

28 CAP Theorem Given a Partition, you must pick between Availability and Consistency Pick Consistently: Some clients (not all) can change data consistently Pick Availability: All clients can change data but inconsistently C: Consistency (Linearizable) A: Availability P: Partition tolerance

29 Two Phase Commit and CAP Theorem! Ready to Commit? During a partition Does 2PC pick Availability or Consistency? Network Partition

30 Two Phase Commit With Failures What is the impact of failures on 2PC? 2PC is synchronous Failure == node failure or network failure Failure --> the protocol blocks/stalls ABORT Eventually transaction ends assumes ABORT Transaction ends Ready to Commit? Vote [Yes/No] fails, participants will be waiting fails, coordinator will be waiting Detect failure using Timeouts detects participant failure and assumes ABORT detects failure Why Can t automatically ABORT? that voted NO can abort However, Voted yes can not ABORT Count Votes!!!!!! Abort/Commit?

31 Two Phase Commit With Failures Ready to Commit? ABORT Eventually transaction ends What is the impact of failures on 2PC? 2PC is synchronous assumes ABORT Transaction ends Vote [Yes/No] Failure == node failure or network failure Failure --> the protocol blocks/stalls fails, participants will be waiting fails, coordinator will be waiting Count Votes!!!!!! Detect failure using Timeouts that voted NO can abort detects participant failure and However, Voted yes can not ABORT assumes ABORT detects failure Why Can t automatically ABORT? Abort/Commit?

32 Two Phase Commit: Adding Isolation with Locks

33

34

35 Pessimistic Versus Optimistic Locking Trade-off: concurrency versus isolation Pessimistic: Get all locks before transaction Release all locks after transaction Release locks after commit/abort Prevents anyone else from using the data during transaction Locks prevent read/write of data Locks stop other transactions Optimistic No locks Get a copy of data before transaction After transaction check to make sure data has not changed If the data changed then ABORT!!!! Data changes means someone else changed the data

36 Pessimistic Versus Optimistic Locking Trade-off: concurrency versus isolation Pessimistic Optimistic Low level of concurrency Low performance Sequential ordering of transactions High level of concurrency High throughput: especially if all reads Many Transactions will abort if many writes

37 Two Phase Commit: Practical Issues

38 Practical Performance Issues with 2PC Ready to Commit? Synchronization: 2PC Overheads Multiple ``rounds of communication Three rounds of communication 3(N) messages During these rounds resources are frozen Vote [Yes/No] Abort/Commit?

39 Practical Performance Issues with 2PC Blocking: 2PC During failure à 2PC can block When 2PC blocks à then other transactions are unable to progress

40 Practical Performance Issues with 2PC Synchronization: 2PC Overheads Multiple ``rounds of communication Three rounds of communication 3(N) messages During these rounds resources are frozen Blocking: 2PC During failure à 2PC can block When 2PC blocks à then other transactions are unable to progress

41 Distributed Transaction No Longer Considered Dead! 2007: Avoid Distributed transactions 2012: Google s Spanner Dist. Transaction!!! 2019: MS s Orleans Dist. Transaction to the Cloud!!!

42 Distributed Transactions and ACID

43 How do you get ACID in Distributed Transactions? Two Phase Commit à A + C 2PC: atomic and consistent change from one state to another state Two Phase Commit + Locks à A + C + I Locks provide isolation by preventing concurrent transaction from accessing data Two Phase Commit + Locks + Logs à A + C + I + D Logs ensure the transactions persists

44 Consistency Models Revisited

45 Consistency Spectrum SLOWER BUT EASY TO PROGRAM Strict Serializability Sequential FAST BUT HARDER TO PROGRAM Eventual Linearizable Causal+ STRONG CONSISTENCY WEAK CONSISTENCY

46 Strict Serializability Total order + FIFO + Time à for a transaction After a transaction commits, all future reads will see committed data Requires 2PC + pessimistic Locks Low performance: reads/write have high latency and low throughput Strict Serializability V. Linearizability Strict Serializability = Linearizability for Transactions Linearizability = Total order+ FIFO + Real time for individual operations Strict Serializability = Total order+ FIFO + Real time for transactions (groups of operations)

47 Strict Serializability Total order + FIFO + Time à for a transaction After a transaction commits, all future reads will see committed data Requires 2PC + pessimistic Locks Low performance: reads/write have high latency and low throughput Strict Serializability V. Linearizability Strict Serializability = Linearizability for Transactions Linearizability = Total order+ FIFO + Real time for individual operations Strict Serializability = Total order+ FIFO + Real time for transactions (groups of operations)

48 Summary Background on Transactions ACID Semantics Distribute Transactions Terminology: Transaction manager,, Two Phase Commit Adding Isolation with Locks: optimistic V. pessimistic Performance Issues Consistency Models Serializability Versus Linearizability

Distributed File System

Distributed File System Distributed File System Last Class NFS Design choices Opportunistic locking Local name spaces CS 138 XVIII 1 Copyright 2018 Theophilus Benson, Thomas W. Doeppner. All DFS Basic Info Global name space across

More information

ATOMIC COMMITMENT Or: How to Implement Distributed Transactions in Sharded Databases

ATOMIC COMMITMENT Or: How to Implement Distributed Transactions in Sharded Databases ATOMIC COMMITMENT Or: How to Implement Distributed Transactions in Sharded Databases We talked about transactions and how to implement them in a single-node database. We ll now start looking into how to

More information

Distributed System. Gang Wu. Spring,2018

Distributed System. Gang Wu. Spring,2018 Distributed System Gang Wu Spring,2018 Lecture4:Failure& Fault-tolerant Failure is the defining difference between distributed and local programming, so you have to design distributed systems with the

More information

CS /15/16. Paul Krzyzanowski 1. Question 1. Distributed Systems 2016 Exam 2 Review. Question 3. Question 2. Question 5.

CS /15/16. Paul Krzyzanowski 1. Question 1. Distributed Systems 2016 Exam 2 Review. Question 3. Question 2. Question 5. Question 1 What makes a message unstable? How does an unstable message become stable? Distributed Systems 2016 Exam 2 Review Paul Krzyzanowski Rutgers University Fall 2016 In virtual sychrony, a message

More information

CS October 2017

CS October 2017 Atomic Transactions Transaction An operation composed of a number of discrete steps. Distributed Systems 11. Distributed Commit Protocols All the steps must be completed for the transaction to be committed.

More information

Large-Scale Key-Value Stores Eventual Consistency Marco Serafini

Large-Scale Key-Value Stores Eventual Consistency Marco Serafini Large-Scale Key-Value Stores Eventual Consistency Marco Serafini COMPSCI 590S Lecture 13 Goals of Key-Value Stores Export simple API put(key, value) get(key) Simpler and faster than a DBMS Less complexity,

More information

Goal A Distributed Transaction

Goal A Distributed Transaction Goal A Distributed Transaction We want a transaction that involves multiple nodes Review of transactions and their properties Things we need to implement transactions * Locks * Achieving atomicity through

More information

Building Consistent Transactions with Inconsistent Replication

Building Consistent Transactions with Inconsistent Replication Building Consistent Transactions with Inconsistent Replication Irene Zhang, Naveen Kr. Sharma, Adriana Szekeres, Arvind Krishnamurthy, Dan R. K. Ports University of Washington Distributed storage systems

More information

Distributed systems. Lecture 6: distributed transactions, elections, consensus and replication. Malte Schwarzkopf

Distributed systems. Lecture 6: distributed transactions, elections, consensus and replication. Malte Schwarzkopf Distributed systems Lecture 6: distributed transactions, elections, consensus and replication Malte Schwarzkopf Last time Saw how we can build ordered multicast Messages between processes in a group Need

More information

CS 425 / ECE 428 Distributed Systems Fall 2017

CS 425 / ECE 428 Distributed Systems Fall 2017 CS 425 / ECE 428 Distributed Systems Fall 2017 Indranil Gupta (Indy) Nov 7, 2017 Lecture 21: Replication Control All slides IG Server-side Focus Concurrency Control = how to coordinate multiple concurrent

More information

CSE 544 Principles of Database Management Systems. Alvin Cheung Fall 2015 Lecture 14 Distributed Transactions

CSE 544 Principles of Database Management Systems. Alvin Cheung Fall 2015 Lecture 14 Distributed Transactions CSE 544 Principles of Database Management Systems Alvin Cheung Fall 2015 Lecture 14 Distributed Transactions Transactions Main issues: Concurrency control Recovery from failures 2 Distributed Transactions

More information

Exam 2 Review. October 29, Paul Krzyzanowski 1

Exam 2 Review. October 29, Paul Krzyzanowski 1 Exam 2 Review October 29, 2015 2013 Paul Krzyzanowski 1 Question 1 Why did Dropbox add notification servers to their architecture? To avoid the overhead of clients polling the servers periodically to check

More information

Causal Consistency and Two-Phase Commit

Causal Consistency and Two-Phase Commit Causal Consistency and Two-Phase Commit CS 240: Computing Systems and Concurrency Lecture 16 Marco Canini Credits: Michael Freedman and Kyle Jamieson developed much of the original material. Consistency

More information

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons)

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons) ) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons) Transactions - Definition A transaction is a sequence of data operations with the following properties: * A Atomic All

More information

Performance and Forgiveness. June 23, 2008 Margo Seltzer Harvard University School of Engineering and Applied Sciences

Performance and Forgiveness. June 23, 2008 Margo Seltzer Harvard University School of Engineering and Applied Sciences Performance and Forgiveness June 23, 2008 Margo Seltzer Harvard University School of Engineering and Applied Sciences Margo Seltzer Architect Outline A consistency primer Techniques and costs of consistency

More information

Distributed Systems. Characteristics of Distributed Systems. Lecture Notes 1 Basic Concepts. Operating Systems. Anand Tripathi

Distributed Systems. Characteristics of Distributed Systems. Lecture Notes 1 Basic Concepts. Operating Systems. Anand Tripathi 1 Lecture Notes 1 Basic Concepts Anand Tripathi CSci 8980 Operating Systems Anand Tripathi CSci 8980 1 Distributed Systems A set of computers (hosts or nodes) connected through a communication network.

More information

Distributed Systems. Characteristics of Distributed Systems. Characteristics of Distributed Systems. Goals in Distributed System Designs

Distributed Systems. Characteristics of Distributed Systems. Characteristics of Distributed Systems. Goals in Distributed System Designs 1 Anand Tripathi CSci 8980 Operating Systems Lecture Notes 1 Basic Concepts Distributed Systems A set of computers (hosts or nodes) connected through a communication network. Nodes may have different speeds

More information

Topics in Reliable Distributed Systems

Topics in Reliable Distributed Systems Topics in Reliable Distributed Systems 049017 1 T R A N S A C T I O N S Y S T E M S What is A Database? Organized collection of data typically persistent organization models: relational, object-based,

More information

Distributed Systems. Day 9: Replication [Part 1]

Distributed Systems. Day 9: Replication [Part 1] Distributed Systems Day 9: Replication [Part 1] Hash table k 0 v 0 k 1 v 1 k 2 v 2 k 3 v 3 ll Facebook Data Does your client know about all of F s servers? Security issues? Performance issues? How do clients

More information

TAPIR. By Irene Zhang, Naveen Sharma, Adriana Szekeres, Arvind Krishnamurthy, and Dan Ports Presented by Todd Charlton

TAPIR. By Irene Zhang, Naveen Sharma, Adriana Szekeres, Arvind Krishnamurthy, and Dan Ports Presented by Todd Charlton TAPIR By Irene Zhang, Naveen Sharma, Adriana Szekeres, Arvind Krishnamurthy, and Dan Ports Presented by Todd Charlton Outline Problem Space Inconsistent Replication TAPIR Evaluation Conclusion Problem

More information

Transactions. CS 475, Spring 2018 Concurrent & Distributed Systems

Transactions. CS 475, Spring 2018 Concurrent & Distributed Systems Transactions CS 475, Spring 2018 Concurrent & Distributed Systems Review: Transactions boolean transfermoney(person from, Person to, float amount){ if(from.balance >= amount) { from.balance = from.balance

More information

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons)

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons) ) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons) Goal A Distributed Transaction We want a transaction that involves multiple nodes Review of transactions and their properties

More information

Computing Parable. The Archery Teacher. Courtesy: S. Keshav, U. Waterloo. Computer Science. Lecture 16, page 1

Computing Parable. The Archery Teacher. Courtesy: S. Keshav, U. Waterloo. Computer Science. Lecture 16, page 1 Computing Parable The Archery Teacher Courtesy: S. Keshav, U. Waterloo Lecture 16, page 1 Consistency and Replication Today: Consistency models Data-centric consistency models Client-centric consistency

More information

Module 8 Fault Tolerance CS655! 8-1!

Module 8 Fault Tolerance CS655! 8-1! Module 8 Fault Tolerance CS655! 8-1! Module 8 - Fault Tolerance CS655! 8-2! Dependability Reliability! A measure of success with which a system conforms to some authoritative specification of its behavior.!

More information

Last time. Distributed systems Lecture 6: Elections, distributed transactions, and replication. DrRobert N. M. Watson

Last time. Distributed systems Lecture 6: Elections, distributed transactions, and replication. DrRobert N. M. Watson Distributed systems Lecture 6: Elections, distributed transactions, and replication DrRobert N. M. Watson 1 Last time Saw how we can build ordered multicast Messages between processes in a group Need to

More information

Defining properties of transactions

Defining properties of transactions Transactions: ACID, Concurrency control (2P, OCC) Intro to distributed txns The transaction Definition: A unit of work: May consist of multiple data accesses or updates Must commit or abort as a single

More information

SCALABLE CONSISTENCY AND TRANSACTION MODELS

SCALABLE CONSISTENCY AND TRANSACTION MODELS Data Management in the Cloud SCALABLE CONSISTENCY AND TRANSACTION MODELS 69 Brewer s Conjecture Three properties that are desirable and expected from realworld shared-data systems C: data consistency A:

More information

EECS 498 Introduction to Distributed Systems

EECS 498 Introduction to Distributed Systems EECS 498 Introduction to Distributed Systems Fall 2017 Harsha V. Madhyastha Dynamo Recap Consistent hashing 1-hop DHT enabled by gossip Execution of reads and writes Coordinated by first available successor

More information

Replication in Distributed Systems

Replication in Distributed Systems Replication in Distributed Systems Replication Basics Multiple copies of data kept in different nodes A set of replicas holding copies of a data Nodes can be physically very close or distributed all over

More information

Integrity in Distributed Databases

Integrity in Distributed Databases Integrity in Distributed Databases Andreas Farella Free University of Bozen-Bolzano Table of Contents 1 Introduction................................................... 3 2 Different aspects of integrity.....................................

More information

Transactions. Intel (TX memory): Transactional Synchronization Extensions (TSX) 2015 Donald Acton et al. Computer Science W2

Transactions. Intel (TX memory): Transactional Synchronization Extensions (TSX) 2015 Donald Acton et al. Computer Science W2 Transactions Intel (TX memory): Transactional Synchronization Extensions (TSX) 0 Goal A Distributed Transaction We want a transaction that involves multiple nodes Review of transactions and their properties

More information

CSE 444: Database Internals. Section 9: 2-Phase Commit and Replication

CSE 444: Database Internals. Section 9: 2-Phase Commit and Replication CSE 444: Database Internals Section 9: 2-Phase Commit and Replication 1 Today 2-Phase Commit Replication 2 Two-Phase Commit Protocol (2PC) One coordinator and many subordinates Phase 1: Prepare Phase 2:

More information

CPS 512 midterm exam #1, 10/7/2016

CPS 512 midterm exam #1, 10/7/2016 CPS 512 midterm exam #1, 10/7/2016 Your name please: NetID: Answer all questions. Please attempt to confine your answers to the boxes provided. If you don t know the answer to a question, then just say

More information

CMU SCS CMU SCS Who: What: When: Where: Why: CMU SCS

CMU SCS CMU SCS Who: What: When: Where: Why: CMU SCS Carnegie Mellon Univ. Dept. of Computer Science 15-415/615 - DB s C. Faloutsos A. Pavlo Lecture#23: Distributed Database Systems (R&G ch. 22) Administrivia Final Exam Who: You What: R&G Chapters 15-22

More information

Control. CS432: Distributed Systems Spring 2017

Control. CS432: Distributed Systems Spring 2017 Transactions and Concurrency Control Reading Chapter 16, 17 (17.2,17.4,17.5 ) [Coulouris 11] Chapter 12 [Ozsu 10] 2 Objectives Learn about the following: Transactions in distributed systems Techniques

More information

Consistency in Distributed Systems

Consistency in Distributed Systems Consistency in Distributed Systems Recall the fundamental DS properties DS may be large in scale and widely distributed 1. concurrent execution of components 2. independent failure modes 3. transmission

More information

Distributed Transactions

Distributed Transactions Distributed Transactions Preliminaries Last topic: transactions in a single machine This topic: transactions across machines Distribution typically addresses two needs: Split the work across multiple nodes

More information

Replication and Consistency. Fall 2010 Jussi Kangasharju

Replication and Consistency. Fall 2010 Jussi Kangasharju Replication and Consistency Fall 2010 Jussi Kangasharju Chapter Outline Replication Consistency models Distribution protocols Consistency protocols 2 Data Replication user B user C user A object object

More information

Modern Database Concepts

Modern Database Concepts Modern Database Concepts Basic Principles Doc. RNDr. Irena Holubova, Ph.D. holubova@ksi.mff.cuni.cz NoSQL Overview Main objective: to implement a distributed state Different objects stored on different

More information

Fault Tolerance. Goals: transparent: mask (i.e., completely recover from) all failures, or predictable: exhibit a well defined failure behavior

Fault Tolerance. Goals: transparent: mask (i.e., completely recover from) all failures, or predictable: exhibit a well defined failure behavior Fault Tolerance Causes of failure: process failure machine failure network failure Goals: transparent: mask (i.e., completely recover from) all failures, or predictable: exhibit a well defined failure

More information

CSE 5306 Distributed Systems

CSE 5306 Distributed Systems CSE 5306 Distributed Systems Fault Tolerance Jia Rao http://ranger.uta.edu/~jrao/ 1 Failure in Distributed Systems Partial failure Happens when one component of a distributed system fails Often leaves

More information

FIT: A Distributed Database Performance Tradeoff. Faleiro and Abadi CS590-BDS Thamir Qadah

FIT: A Distributed Database Performance Tradeoff. Faleiro and Abadi CS590-BDS Thamir Qadah FIT: A Distributed Database Performance Tradeoff Faleiro and Abadi CS590-BDS Thamir Qadah Desirable features in Distributed Databases Impossible to achieve Fairness Isolation Throughput It is impossible

More information

Distributed Transaction Management

Distributed Transaction Management Distributed Transaction Management Material from: Principles of Distributed Database Systems Özsu, M. Tamer, Valduriez, Patrick, 3rd ed. 2011 + Presented by C. Roncancio Distributed DBMS M. T. Özsu & P.

More information

NoSQL systems: sharding, replication and consistency. Riccardo Torlone Università Roma Tre

NoSQL systems: sharding, replication and consistency. Riccardo Torlone Università Roma Tre NoSQL systems: sharding, replication and consistency Riccardo Torlone Università Roma Tre Data distribution NoSQL systems: data distributed over large clusters Aggregate is a natural unit to use for data

More information

CSE 5306 Distributed Systems. Fault Tolerance

CSE 5306 Distributed Systems. Fault Tolerance CSE 5306 Distributed Systems Fault Tolerance 1 Failure in Distributed Systems Partial failure happens when one component of a distributed system fails often leaves other components unaffected A failure

More information

Concurrency Control II and Distributed Transactions

Concurrency Control II and Distributed Transactions Concurrency Control II and Distributed Transactions CS 240: Computing Systems and Concurrency Lecture 18 Marco Canini Credits: Michael Freedman and Kyle Jamieson developed much of the original material.

More information

Exam 2 Review. Fall 2011

Exam 2 Review. Fall 2011 Exam 2 Review Fall 2011 Question 1 What is a drawback of the token ring election algorithm? Bad question! Token ring mutex vs. Ring election! Ring election: multiple concurrent elections message size grows

More information

Distributed Databases

Distributed Databases Distributed Databases Chapter 22, Part B Database Management Systems, 2 nd Edition. R. Ramakrishnan and Johannes Gehrke 1 Introduction Data is stored at several sites, each managed by a DBMS that can run

More information

Chapter 4: Distributed Systems: Replication and Consistency. Fall 2013 Jussi Kangasharju

Chapter 4: Distributed Systems: Replication and Consistency. Fall 2013 Jussi Kangasharju Chapter 4: Distributed Systems: Replication and Consistency Fall 2013 Jussi Kangasharju Chapter Outline n Replication n Consistency models n Distribution protocols n Consistency protocols 2 Data Replication

More information

Fault Tolerance. o Basic Concepts o Process Resilience o Reliable Client-Server Communication o Reliable Group Communication. o Distributed Commit

Fault Tolerance. o Basic Concepts o Process Resilience o Reliable Client-Server Communication o Reliable Group Communication. o Distributed Commit Fault Tolerance o Basic Concepts o Process Resilience o Reliable Client-Server Communication o Reliable Group Communication o Distributed Commit -1 Distributed Commit o A more general problem of atomic

More information

Database Replication: A Tutorial

Database Replication: A Tutorial Chapter 12 Database Replication: A Tutorial Bettina Kemme, Ricardo Jiménez-Peris, Marta Patiño-Martínez, and Gustavo Alonso Abstract This chapter provides an in-depth introduction to database replication,

More information

Fault Tolerance Causes of failure: process failure machine failure network failure Goals: transparent: mask (i.e., completely recover from) all

Fault Tolerance Causes of failure: process failure machine failure network failure Goals: transparent: mask (i.e., completely recover from) all Fault Tolerance Causes of failure: process failure machine failure network failure Goals: transparent: mask (i.e., completely recover from) all failures or predictable: exhibit a well defined failure behavior

More information

Distributed Systems Fault Tolerance

Distributed Systems Fault Tolerance Distributed Systems Fault Tolerance [] Fault Tolerance. Basic concepts - terminology. Process resilience groups and failure masking 3. Reliable communication reliable client-server communication reliable

More information

Eventual Consistency Today: Limitations, Extensions and Beyond

Eventual Consistency Today: Limitations, Extensions and Beyond Eventual Consistency Today: Limitations, Extensions and Beyond Peter Bailis and Ali Ghodsi, UC Berkeley - Nomchin Banga Outline Eventual Consistency: History and Concepts How eventual is eventual consistency?

More information

Recap. CSE 486/586 Distributed Systems Case Study: Amazon Dynamo. Amazon Dynamo. Amazon Dynamo. Necessary Pieces? Overview of Key Design Techniques

Recap. CSE 486/586 Distributed Systems Case Study: Amazon Dynamo. Amazon Dynamo. Amazon Dynamo. Necessary Pieces? Overview of Key Design Techniques Recap CSE 486/586 Distributed Systems Case Study: Amazon Dynamo Steve Ko Computer Sciences and Engineering University at Buffalo CAP Theorem? Consistency, Availability, Partition Tolerance P then C? A?

More information

Module 8 - Fault Tolerance

Module 8 - Fault Tolerance Module 8 - Fault Tolerance Dependability Reliability A measure of success with which a system conforms to some authoritative specification of its behavior. Probability that the system has not experienced

More information

Distributed Databases

Distributed Databases Distributed Databases Chapter 21, Part B Database Management Systems, 2 nd Edition. R. Ramakrishnan and Johannes Gehrke 1 Introduction Data is stored at several sites, each managed by a DBMS that can run

More information

CS5412: THE BASE METHODOLOGY VERSUS THE ACID MODEL

CS5412: THE BASE METHODOLOGY VERSUS THE ACID MODEL 1 CS5412: THE BASE METHODOLOGY VERSUS THE ACID MODEL Lecture VIII Ken Birman Today s lecture will be a bit short 2 We have a guest with us today: Kate Jenkins from Akamai The world s top content hosting

More information

Databases. Laboratorio de sistemas distribuidos. Universidad Politécnica de Madrid (UPM)

Databases. Laboratorio de sistemas distribuidos. Universidad Politécnica de Madrid (UPM) Databases Laboratorio de sistemas distribuidos Universidad Politécnica de Madrid (UPM) http://lsd.ls.fi.upm.es/lsd/lsd.htm Nuevas tendencias en sistemas distribuidos 2 Summary Transactions. Isolation.

More information

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons)

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons) ) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons) Transactions - Definition A transaction is a sequence of data operations with the following properties: * A Atomic All

More information

Parallel Data Types of Parallelism Replication (Multiple copies of the same data) Better throughput for read-only computations Data safety Partitionin

Parallel Data Types of Parallelism Replication (Multiple copies of the same data) Better throughput for read-only computations Data safety Partitionin Parallel Data Types of Parallelism Replication (Multiple copies of the same data) Better throughput for read-only computations Data safety Partitioning (Different data at different sites More space Better

More information

TRANSACTION MANAGEMENT

TRANSACTION MANAGEMENT TRANSACTION MANAGEMENT CS 564- Spring 2018 ACKs: Jeff Naughton, Jignesh Patel, AnHai Doan WHAT IS THIS LECTURE ABOUT? Transaction (TXN) management ACID properties atomicity consistency isolation durability

More information

Transactions. Kathleen Durant PhD Northeastern University CS3200 Lesson 9

Transactions. Kathleen Durant PhD Northeastern University CS3200 Lesson 9 Transactions Kathleen Durant PhD Northeastern University CS3200 Lesson 9 1 Outline for the day The definition of a transaction Benefits provided What they look like in SQL Scheduling Transactions Serializability

More information

Building Consistent Transactions with Inconsistent Replication

Building Consistent Transactions with Inconsistent Replication DB Reading Group Fall 2015 slides by Dana Van Aken Building Consistent Transactions with Inconsistent Replication Irene Zhang, Naveen Kr. Sharma, Adriana Szekeres, Arvind Krishnamurthy, Dan R. K. Ports

More information

CS Amazon Dynamo

CS Amazon Dynamo CS 5450 Amazon Dynamo Amazon s Architecture Dynamo The platform for Amazon's e-commerce services: shopping chart, best seller list, produce catalog, promotional items etc. A highly available, distributed

More information

Consistency. CS 475, Spring 2018 Concurrent & Distributed Systems

Consistency. CS 475, Spring 2018 Concurrent & Distributed Systems Consistency CS 475, Spring 2018 Concurrent & Distributed Systems Review: 2PC, Timeouts when Coordinator crashes What if the bank doesn t hear back from coordinator? If bank voted no, it s OK to abort If

More information

Consistency in Distributed Storage Systems. Mihir Nanavati March 4 th, 2016

Consistency in Distributed Storage Systems. Mihir Nanavati March 4 th, 2016 Consistency in Distributed Storage Systems Mihir Nanavati March 4 th, 2016 Today Overview of distributed storage systems CAP Theorem About Me Virtualization/Containers, CPU microarchitectures/caches, Network

More information

PRIMARY-BACKUP REPLICATION

PRIMARY-BACKUP REPLICATION PRIMARY-BACKUP REPLICATION Primary Backup George Porter Nov 14, 2018 ATTRIBUTION These slides are released under an Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) Creative Commons

More information

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons)

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons) ) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons) Goal A Distributed Transaction We want a transaction that involves multiple nodes Review of transactions and their properties

More information

Distributed Systems Consensus

Distributed Systems Consensus Distributed Systems Consensus Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) Consensus 1393/6/31 1 / 56 What is the Problem?

More information

Dynamo: Amazon s Highly Available Key-value Store. ID2210-VT13 Slides by Tallat M. Shafaat

Dynamo: Amazon s Highly Available Key-value Store. ID2210-VT13 Slides by Tallat M. Shafaat Dynamo: Amazon s Highly Available Key-value Store ID2210-VT13 Slides by Tallat M. Shafaat Dynamo An infrastructure to host services Reliability and fault-tolerance at massive scale Availability providing

More information

CS 347 Parallel and Distributed Data Processing

CS 347 Parallel and Distributed Data Processing CS 347 Parallel and Distributed Data Processing Spring 2016 Notes 5: Concurrency Control Topics Data Database design Queries Decomposition Localization Optimization Transactions Concurrency control Reliability

More information

Motivating Example. Motivating Example. Transaction ROLLBACK. Transactions. CSE 444: Database Internals

Motivating Example. Motivating Example. Transaction ROLLBACK. Transactions. CSE 444: Database Internals CSE 444: Database Internals Client 1: SET money=money-100 WHERE pid = 1 Motivating Example Client 2: SELECT sum(money) FROM Budget Lectures 13 Transaction Schedules 1 SET money=money+60 WHERE pid = 2 SET

More information

Important Lessons. Today's Lecture. Two Views of Distributed Systems

Important Lessons. Today's Lecture. Two Views of Distributed Systems Important Lessons Replication good for performance/ reliability Key challenge keeping replicas up-to-date Wide range of consistency models Will see more next lecture Range of correctness properties L-10

More information

Consistency and Replication. Why replicate?

Consistency and Replication. Why replicate? Consistency and Replication Today: Consistency models Data-centric consistency models Client-centric consistency models Lecture 15, page 1 Why replicate? Data replication versus compute replication Data

More information

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Fall 2007 Lecture 13 - Distribution: transactions

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Fall 2007 Lecture 13 - Distribution: transactions CSE 544 Principles of Database Management Systems Magdalena Balazinska Fall 2007 Lecture 13 - Distribution: transactions References Transaction Management in the R* Distributed Database Management System.

More information

CSE 444: Database Internals. Lectures 13 Transaction Schedules

CSE 444: Database Internals. Lectures 13 Transaction Schedules CSE 444: Database Internals Lectures 13 Transaction Schedules CSE 444 - Winter 2018 1 About Lab 3 In lab 3, we implement transactions Focus on concurrency control Want to run many transactions at the same

More information

CS 347 Parallel and Distributed Data Processing

CS 347 Parallel and Distributed Data Processing CS 347 Parallel and Distributed Data Processing Spring 2016 Notes 6: Reliability Reliable Distributed DB Management Reliability Failure models Scenarios CS 347 Notes 6 2 Reliability Correctness Serializability

More information

Building a transactional distributed

Building a transactional distributed Building a transactional distributed data store with Erlang Alexander Reinefeld, Florian Schintke, Thorsten Schütt Zuse Institute Berlin, onscale solutions GmbH Transactional data store - What for? Web

More information

CMPT 354: Database System I. Lecture 11. Transaction Management

CMPT 354: Database System I. Lecture 11. Transaction Management CMPT 354: Database System I Lecture 11. Transaction Management 1 Why this lecture DB application developer What if crash occurs, power goes out, etc? Single user à Multiple users 2 Outline Transaction

More information

Homework #2 Nathan Balon CIS 578 October 31, 2004

Homework #2 Nathan Balon CIS 578 October 31, 2004 Homework #2 Nathan Balon CIS 578 October 31, 2004 1 Answer the following questions about the snapshot algorithm: A) What is it used for? It used for capturing the global state of a distributed system.

More information

CS 347 Parallel and Distributed Data Processing

CS 347 Parallel and Distributed Data Processing CS 347 Parallel and Distributed Data Processing Spring 2016 Notes 5: Concurrency Control Topics Data Database design Queries Decomposition Localization Optimization Transactions Concurrency control Reliability

More information

CprE Fault Tolerance. Dr. Yong Guan. Department of Electrical and Computer Engineering & Information Assurance Center Iowa State University

CprE Fault Tolerance. Dr. Yong Guan. Department of Electrical and Computer Engineering & Information Assurance Center Iowa State University Fault Tolerance Dr. Yong Guan Department of Electrical and Computer Engineering & Information Assurance Center Iowa State University Outline for Today s Talk Basic Concepts Process Resilience Reliable

More information

Chapter 22. Transaction Management

Chapter 22. Transaction Management Chapter 22 Transaction Management 1 Transaction Support Transaction Action, or series of actions, carried out by user or application, which reads or updates contents of database. Logical unit of work on

More information

Consensus in Distributed Systems. Jeff Chase Duke University

Consensus in Distributed Systems. Jeff Chase Duke University Consensus in Distributed Systems Jeff Chase Duke University Consensus P 1 P 1 v 1 d 1 Unreliable multicast P 2 P 3 Consensus algorithm P 2 P 3 v 2 Step 1 Propose. v 3 d 2 Step 2 Decide. d 3 Generalizes

More information

Transactions and ACID

Transactions and ACID Transactions and ACID Kevin Swingler Contents Recap of ACID transactions in RDBMSs Transactions and ACID in MongoDB 1 Concurrency Databases are almost always accessed by multiple users concurrently A user

More information

Transaction Management. Pearson Education Limited 1995, 2005

Transaction Management. Pearson Education Limited 1995, 2005 Chapter 20 Transaction Management 1 Chapter 20 - Objectives Function and importance of transactions. Properties of transactions. Concurrency Control Deadlock and how it can be resolved. Granularity of

More information

Database Architectures

Database Architectures Database Architectures CPS352: Database Systems Simon Miner Gordon College Last Revised: 4/15/15 Agenda Check-in Parallelism and Distributed Databases Technology Research Project Introduction to NoSQL

More information

Recovering from a Crash. Three-Phase Commit

Recovering from a Crash. Three-Phase Commit Recovering from a Crash If INIT : abort locally and inform coordinator If Ready, contact another process Q and examine Q s state Lecture 18, page 23 Three-Phase Commit Two phase commit: problem if coordinator

More information

Principles of Software Construction: Objects, Design, and Concurrency

Principles of Software Construction: Objects, Design, and Concurrency Principles of Software Construction: Objects, Design, and Concurrency Distributed System Design, Part 4 MapReduce, continued, plus Transactions and Serializability Fall 2014 Charlie Garrod Jonathan Aldrich

More information

Lock-based concurrency control. Q: What if access patterns rarely, if ever, conflict? Serializability. Concurrency Control II (OCC, MVCC)

Lock-based concurrency control. Q: What if access patterns rarely, if ever, conflict? Serializability. Concurrency Control II (OCC, MVCC) Concurrency Control II (CC, MVCC) CS 418: Distributed Systems Lecture 18 Serializability Execution of a set of transactions over multiple items is equivalent to some serial execution of s Michael Freedman

More information

Fault Tolerance. Distributed Systems. September 2002

Fault Tolerance. Distributed Systems. September 2002 Fault Tolerance Distributed Systems September 2002 Basics A component provides services to clients. To provide services, the component may require the services from other components a component may depend

More information

Synchronization Part II. CS403/534 Distributed Systems Erkay Savas Sabanci University

Synchronization Part II. CS403/534 Distributed Systems Erkay Savas Sabanci University Synchronization Part II CS403/534 Distributed Systems Erkay Savas Sabanci University 1 Election Algorithms Issue: Many distributed algorithms require that one process act as a coordinator (initiator, etc).

More information

No compromises: distributed transactions with consistency, availability, and performance

No compromises: distributed transactions with consistency, availability, and performance No compromises: distributed transactions with consistency, availability, and performance Aleksandar Dragojevi c, Dushyanth Narayanan, Edmund B. Nightingale, Matthew Renzelmann, Alex Shamis, Anirudh Badam,

More information

No Compromises. Distributed Transactions with Consistency, Availability, Performance

No Compromises. Distributed Transactions with Consistency, Availability, Performance No Compromises Distributed Transactions with Consistency, Availability, Performance Aleksandar Dragojevic, Dushyanth Narayanan, Edmund B. Nightingale, Matthew Renzelmann, Alex Shamis, Anirudh Badam, Miguel

More information

Data Modeling and Databases Ch 14: Data Replication. Gustavo Alonso, Ce Zhang Systems Group Department of Computer Science ETH Zürich

Data Modeling and Databases Ch 14: Data Replication. Gustavo Alonso, Ce Zhang Systems Group Department of Computer Science ETH Zürich Data Modeling and Databases Ch 14: Data Replication Gustavo Alonso, Ce Zhang Systems Group Department of Computer Science ETH Zürich Database Replication What is database replication The advantages of

More information

Consistency and Scalability

Consistency and Scalability COMP 150-IDS: Internet Scale Distributed Systems (Spring 2015) Consistency and Scalability Noah Mendelsohn Tufts University Email: noah@cs.tufts.edu Web: http://www.cs.tufts.edu/~noah Copyright 2015 Noah

More information

Mobile and Heterogeneous databases Distributed Database System Transaction Management. A.R. Hurson Computer Science Missouri Science & Technology

Mobile and Heterogeneous databases Distributed Database System Transaction Management. A.R. Hurson Computer Science Missouri Science & Technology Mobile and Heterogeneous databases Distributed Database System Transaction Management A.R. Hurson Computer Science Missouri Science & Technology 1 Distributed Database System Note, this unit will be covered

More information

Datenbanksysteme II: Implementation of Database Systems Synchronization of Concurrent Transactions

Datenbanksysteme II: Implementation of Database Systems Synchronization of Concurrent Transactions Datenbanksysteme II: Implementation of Database Systems Synchronization of Concurrent Transactions Material von Prof. Johann Christoph Freytag Prof. Kai-Uwe Sattler Prof. Alfons Kemper, Dr. Eickler Prof.

More information

Transaction Models for Massively Multiplayer Online Games

Transaction Models for Massively Multiplayer Online Games 2011 30th IEEE International Symposium on Reliable Distributed Systems Transaction Models for Massively Multiplayer Online Games Kaiwen Zhang Department of Computer Science University of Toronto, Toronto,

More information