Assignment 8 - Solution Problem 1 - We replicate database DB1.

Slides:



Advertisements
Similar presentations
Types of Distributed Database Systems
Advertisements

Transaction Management: Concurrency Control CS634 Class 17, Apr 7, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
Distributed Locking. Distributed Locking (No Replication) Assumptions Lock tables are managed by individual sites. The component of a transaction at a.
Database Replication techniques: a Three Parameter Classification Authors : Database Replication techniques: a Three Parameter Classification Authors :
CS 582 / CMPE 481 Distributed Systems
Strong Consistency and Agreement COS 461: Computer Networks Spring 2011 Mike Freedman 1 Jenkins,
1 ICS 214B: Transaction Processing and Distributed Data Management Replication Techniques.
Session - 14 CONCURRENCY CONTROL CONCURRENCY TECHNIQUES Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
Manajemen Basis Data Pertemuan 10 Matakuliah: M0264/Manajemen Basis Data Tahun: 2008.
1 Concurrency Control. 2 Transactions A transaction is a list of actions. The actions are reads (written R T (O)) and writes (written W T (O)) of database.
CS 603 Data Replication February 25, Data Replication: Why? Fault Tolerance –Hot backup –Catastrophic failure Performance –Parallelism –Decreased.
6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.
Practical Replication. Purposes of Replication Improve Availability Replicated databases can be accessed even if several replicas are unavailable Improve.
Replicated Databases. Reading Textbook: Ch.13 Textbook: Ch.13 FarkasCSCE Spring
1 ACTIVE FAULT TOLERANT SYSTEM for OPEN DISTRIBUTED COMPUTING (Autonomic and Trusted Computing 2006) Giray Kömürcü.
By Shruti poundarik.  Data Objects and Files are replicated to increase system performance and availability.  Increased system performance achieved.
1 Multiversion Reconciliation for Mobile Databases Shirish Hemanath Phatak & B.R.Badrinath Presented By Presented By Md. Abdur Rahman Md. Abdur Rahman.
2/29/ Replication CSEP 545 Transaction Processing Philip A. Bernstein Sameh Elnikety Copyright ©2012 Philip A. Bernstein.
Chapter 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University Building Dependable Distributed Systems.
Write Conflicts in Optimistic Replication Problem: replicas may accept conflicting writes. How to detect/resolve the conflicts? client B client A replica.
Distributed DBMS, Query Processing and Optimization
EEC 688/788 Secure and Dependable Computing Lecture 9 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
1 Controlled concurrency Now we start looking at what kind of concurrency we should allow We first look at uncontrolled concurrency and see what happens.
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Transactions on Replicated Data Steve Ko Computer Sciences and Engineering University at Buffalo.
Distributed Transactions What is a transaction? (A sequence of server operations that must be carried out atomically ) ACID properties - what are these.
Distributed Databases – Advanced Concepts Chapter 25 in Textbook.
CPS 512/590 final exam, 12/8/2015 /60 Your name please: /50 /50 /60
10. Replication CSEP 545 Transaction Processing Philip A. Bernstein
Transactions.
Database Transaction Abstraction I
CS 347: Parallel and Distributed Data Management Notes07: Data Replication Hector Garcia-Molina CS 347 Notes07.
Distributed Database Management Systems
Distributed Systems CS
The Echo Algorithm The echo algorithm can be used to collect and disperse information in a distributed system It was originally designed for learning network.
CSE 486/586 Distributed Systems Consistency --- 1
CPS 512 midterm exam #1, 10/7/2016 Your name please: ___________________ NetID:___________ /60 /40 /10.
Consistency and Replication
6.4 Data and File Replication
Consistency and Replication
Assignment 2 - Solution   1. w0[x,y,z] c0 r1[x] r2[y] w2[y] r3[z] w3[z] r2[z] w2[y] w1[z] w1[y] c1 c2 c3 a. An equivalent serial history must preserve.
Replication and Consistency
CIS 720 Concurrency Control.
Replication and Consistency
Distributed DBMS Model
Outline Announcements Fault Tolerance.
Distributed Transactions
CSE 486/586 Distributed Systems Consistency --- 1
CS162 Operating Systems and Systems Programming Review (II)
Database Transactions
Replication and Recovery in Distributed Systems
Basic Two Phase Locking Protocol
EEC 688/788 Secure and Dependable Computing
6.830 Lecture 14 Two-phase Locking Recap Optimistic Concurrency Control 10/28/2015.
Distributed Database Management Systems
EEC 688/788 Secure and Dependable Computing
IS 651: Distributed Systems Fault Tolerance
Distributed Transactions
Lecture 21: Replication Control
Chapter 7: Distributed Transactions
Distributed Systems CS
Exercises for Chapter 14: Distributed Transactions
Distributed Database Management Systems
EEC 688/788 Secure and Dependable Computing
Lecture 21: Replication Control
Dennis Kafura – CS5204 – Operating Systems
Replication and Consistency
System-Level Support CIS 640.
Distributed Database Management Systems
Transactions, Properties of Transactions
CS514: Intermediate Course in Operating Systems
Presentation transcript:

Assignment 8 - Solution Problem 1 - We replicate database DB1.   Problem 1 - We replicate database DB1. 1.A. Assume DB1 is a read-only database. Could availability decrease due to replication? Why? Every transaction accesses one copy only. Therefore, availability improves with more replicas. Is there a bound on system throughput (read-only tx/sec) as we increase the number of replicas? There is no bound on system throughput insofar as the database system is concerned. More replicas give more throughput. Network may impose a bound, depending on the capacity of connections between clients and the database.

Problem 1.B.1 Assume DB1 processes update-only transactions. Describe a situation where availability is decreased. There are several ways availability can be reduced. For example, use an algorithm that requires a transaction to update more than one replica to commit: Replication protocol specifies that all replicas must be updated within the transaction. Failure of one replica makes system unavailable. The more replicas, the higher the probability that one of them will fail.

Problem 1.B.2 Assuming infinite network bandwidth, what factor(s) bound the number of update-transactions per second? How is each factor affected as the number of replicas increases? System throughput is capped by the number of updates a single replica can perform because updates are performed on all replicas. This is an upper bound on system throughput. In a primary-copy system with synchronous updates of replicas, network latency bounds the update rate, since each transaction must be acknowledged by (a quorum of) the replicas before committing at the primary. Two-phase commit imposes another limit. The latter two factors reduce the maximum throughput as the number of replicas increase.

Problem 2 A database is replicated on two servers, server A and server B. Each transaction executes on one server using two phase locking and propagates its updates within the transaction boundary to the other server. Transactions commit using two phase commit.   Does this replication protocol provide one-copy-serializability? If “yes”, provide an argument, and if “no”, provide a history. No. 1SR is not guaranteed even if each site uses 2PL (providing local serializability) and 2PC (providing atomic commitment). To show this, suppose the database has two elements x and y and is replicated on two servers A and B. T1 = r1(x), w1(y) T2 = r2(y), w2(x)

T1 = r1(x), w1(y) T2 = r2(y), w2(x)   The execution is not 1SR since in a serial execution on a one-copy database, one of the transactions would have read the other one’s output, which did not occur in this execution. The problem here is the early release of read locks. If read locks were held until after commit, then the execution couldn’t arise. Site A: rl1(xa) r1(xa) wl1(ya) w1(ya) ru1(xa) wl2(xa) w2(xa) C1 C2 Site B: rl2(yb) r2(yb) wl2(xb) w2(xb) ru2(yb) wl1(yb) w1(yb)

Problem 3. A database is replicated on two servers. Transactions run serially at both servers. Updates are propagated by executing each transaction on both servers. Suppose the system executes the transaction program: T = { read x; read y; write z = x + y; write w = time.now()} Where time.now() is a database function that returns the current time. What could go wrong using this approach? T is non-deterministic, writing different values with each execution. If T is used for update propagation, replicas will contain different values for data item w.