1 / 10

Conflict-Serializability

Conflict-Serializability. Bharath Kumar Manur Venkataramana Class ID No:- 110. Conflicts. What do you mean by a conflict in database? Example situation for such a conflict? Online Reservation Systems. 4 situations where conflict cannot happen.

calida
Download Presentation

Conflict-Serializability

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Conflict-Serializability Bharath Kumar Manur Venkataramana Class ID No:- 110

  2. Conflicts • What do you mean by a conflict in database? • Example situation for such a conflict? Online Reservation Systems. • 4 situations where conflict cannot happen 1) Ri (X) ; Rj (Y) will never conflict, even if database element X=Y. 2) Ri (X) ; Wi (Y) will not conflict for X not equal to Y. 3) Wi (X) ; Rj (Y) will not conflict for X not equal to Y. 4) Wi (X) ; Wj (Y) will not conflict for X not equal to Y.

  3. Conflicts • There are 3 situations where we may not swap the order of actions. They are:- 1) Two actions of the same transactions conflict. 2) Two writes of the same database element by different transactions conflict. 3) A read and a write of the same database element by different transactions also conflict.

  4. Conflict Serializability • Two actions conflict if:- 1) They are issued by different transactions. 2) They operate on the same database element. 3) At least one of them is a write operation. • The 2 schedules S and S1 are conflict-equivalent, if S can be transformed into S1 by a sequence of non-conflicting swaps of adjacent actions. • A schedule is conflict-serializable if it is conflict-equivalent to a serial schedule.

  5. Conflict Serializability (Contd.)‏ • Schedule 1 can be transformed into Schedule 5, a serial schedule where T2 follows T1, by series of swaps of non-conflicting instructions. • Therefore Schedule 1 is conflict serializable. Schedule 1 Schedule 5

  6. Precedence Graphs • A Precedence graph is used to find out whether a schedule is conflict-serializable or not. • There are 2 types of precedence graphs :- • Acyclic Graphs which determines that the Schedule S is conflict-serializable. • Cyclic Graphs which are nothing but the conflict graphs which cannot determine the precedence order for the Schedule S.

  7. Algorithm to produce a Precedence Graph • Add a node for each transaction. • Add a directed edge from Ti to Tj, if Tj reads the value of a database element written by Ti. • Add a directed edge from Ti to Tj, if Tj writes a value into the database element after it has been read by Ti. • If the graph is cyclic, then the Schedule is not Conflict-Serializable.

  8. Acyclic Graphs • An example of a Schedule S. Example Schedule R2(a) R1(b) W2(a) R3(a) W1(b) W3(a) R2(b) W2(b) Precedence Graph T1 T2 T3

  9. Conflict or Cyclic Graphs • An example of a Schedule S. Example Schedule W1(a) R2(a) R3(b) W2(c) R3(c) W3(a) W3(b) R1(b) T1 T2 Precedence Graph T3 Execution is conflict-serializable only if the conflict graph is acyclic.

  10. Test for Conflict-Serializability • Let S be a schedule which consists of action of n transactions, T1 -> T2 -> T3 -> ..... -> Tn -> T1. • The actions of T1 precedes T2 and so on till Tn , but since the action of Tn precedes T1. • Due to Tn -> T1, we find there is a cycle in the precedence graph and the conclusion is that the schedule is not conflict-serializable. • Finally a schedule is conflict serializable if and only if its precedence graph is acyclic.

More Related