Lec-76: Introduction to Serializability | Transactions Concurrency and Control | DBMS

Lec-76: Introduction to Serializability | Transactions Concurrency and Control | DBMS


Lec-76: Introduction to Serializability | Transactions Concurrency and Control | DBMS

👉Subscribe to our new channel:   / @varunainashots  

👉Link for DBMS Notes:
đź”—File 1: https://rb.gy/8g186
đź”—File 2: https://rb.gy/s7l18
🧑‍🎓Contributed by: Anurag Singhal

Serializability is the classical concurrency scheme. It ensures that a schedule for executing concurrent transactions is equivalent to one that executes the transactions serially in some order. It assumes that all accesses to the database are done using read and write operations.

â–ş Database Management System(Complete Playlist):
   • DBMS (Database Management system) Com…  

Other subject-wise playlist Links:
--------------------------------------------------------------------------------------------------------------------------------------
â–şDesign and Analysis of algorithms (DAA):
   • Design and Analysis of algorithms (DAA)  
â–şComputer Architecture (Complete Playlist):
   • Computer Organization and Architectur…  
â–ş Theory of Computation
   • TOC(Theory of Computation)  
â–şArtificial Intelligence:
   • Artificial Intelligence (Complete Pla…  
â–şComputer Networks (Complete Playlist):
   • Computer Networks (Complete Playlist)  
â–şOperating System:
   • Operating System (Complete Playlist)  
â–şStructured Query Language (SQL):
   • Structured Query Language (SQL)  
â–şDiscrete Mathematics:
   • Discrete Mathematics  
â–şCompiler Design:
   • Compiler Design (Complete Playlist)  
â–şNumber System:
   • Number system  
â–şCloud Computing \u0026 BIG Data:
   • Cloud Computing \u0026 BIG Data  
â–şSoftware Engineering:
   • Software Engineering  
â–şData Structure:
   • Data Structure  
â–şGraph Theory:
   • Graph Theory  
â–şProgramming in C:
   • C Programming  
â–şDigital Logic:
   • Digital Logic(Complete Playlist)  

---------------------------------------------------------------------------------------------------------------------------------------
Our social media Links:
► Subscribe to us on YouTube:    / gatesmashers  
►Subscribe to our new channel:    / @varunainashots  
â–ş Like our page on Facebook: https://www.facebook.com/gatesmashers
â–ş Follow us on Instagram: https://www.instagram.com/gate.smashers
â–ş Follow us on Instagram: https://www.instagram.com/varunainashots
â–ş Follow us on Telegram: https://t.me/gatesmashersofficial
â–ş Follow us on Threads: https://www.threads.net/@gate.smashers
--------------------------------------------------------------------------------------------------------------------------------------
â–şFor Any Query, Suggestion or notes contribution:
Email us at: [email protected]

#Serializability#DBMS#freeEducationGATE


Content

0 -> Hello friends!
1.209 -> Welcome to Gate Smashers
2.771 -> The topic is
4.014 -> Serializability
5.348 -> If we talk about transactions topic in database
9.906 -> Then in that the most important topic
12.466 -> That is serializability
13.844 -> And specially those who are doing Gate and UGC-Net preparation
17.385 -> Or who are preparing for other competitive exams
20.296 -> Those people specially
22.259 -> Don't leave this topic at all
24.674 -> Because from here
25.529 -> There are maximum chances of the question to come
27.604 -> And the topic is very simple
29.662 -> Actually what is the meaning of serializability?
33.228 -> Serializable
35.056 -> Means, What a schedule has a ability to become a serializable
40.088 -> Means I am given a schedule
42.05 -> What is a schedule
43.192 -> Collection of transactions
44.709 -> Means I have lot of transactions
46.602 -> After gathering them a schedule is formed
48.692 -> That schedule
50.446 -> Can I make serializable?
52.847 -> Can I make that schedule serial
54.646 -> This is the topic
56.06 -> So if I talk
57.608 -> There is a schedule
59.909 -> In which there are 2 transactions
61.949 -> T1 and T2
63.878 -> There are 2 transactions in schedule T1 and T2
67.554 -> And if in T1 I write
69.229 -> Let's say read(A)
70.333 -> write(A)
72.074 -> Read(A)
74.17 -> Write(A)
75.898 -> If I write it in this way
77.931 -> Then this schedule
79.713 -> Just from the diagram
81.564 -> you have to check
82.551 -> That do you think this is parallel or serial schedule
85.792 -> This is serial schedule
87.93 -> Because in this
88.908 -> T1 will get over first
90.016 -> After that T2 will start
92.004 -> And it will finish
93.156 -> Means if we represent this in a graphical way
96.194 -> Then how can we make in the graph
98.799 -> We have to make its processing
100.923 -> Means, how many transactions are there? 2
102.513 -> T1 and T2
104.245 -> So I have made 2 vertices
105.912 -> First of all which started? T1
108.435 -> And which finished?
109.657 -> T1
110.229 -> After that we went on which?
111.839 -> When T1 got completed
112.829 -> Then we move to T2
115.119 -> So I can denote it in this way
118.887 -> So we have made a simple precedence graph
122.068 -> Of this serial schedule
124.637 -> And what is the meaning of this serial schedule
126.683 -> That T1 will be completed
128.17 -> Then after that T2 will be completed
130.716 -> We can write this in one more way
133.681 -> If I say
135.154 -> That there are 2 transactions T1 and T2
138.555 -> It can also happen that first T1 will be finished
142.341 -> And after that
144.108 -> First T2 will finish
146.247 -> And after that T1
149.941 -> Now see
150.813 -> What is the schedule by seeing
152.388 -> Serial or parallel?
153.491 -> Again this schedule by seeing
155.715 -> It is looking serial only
156.824 -> And in actual this is serial schedule only
158.652 -> So serial schedule means
160.379 -> First T2 completed
162.026 -> Then after that
163.148 -> T1
164.164 -> So if I represent this
165.747 -> T1
166.45 -> And T2
167.571 -> But, T2 completed first
170.461 -> After that
171.488 -> T1 got completed
173.111 -> So if you want you can see it like this
174.925 -> Or you see it like this
176.213 -> Which schedule are this both? serial schedule
178.869 -> Because in this first transaction is executing and completing
182.162 -> And after that
183.136 -> Second transaction is starting
184.795 -> In middle there is no interleaving
187.268 -> So this schedules can be done serializable
191.589 -> What is the need to do them serializable?
195.178 -> It is already serial schedule
197.17 -> This is also serial
198.591 -> And this is also serial
199.758 -> So the serial schedule cannot be done serializable
203.001 -> It is already serial
205.169 -> What will always be given in the question
207.814 -> Parallel schedule
209.12 -> Means, you will be given in this way
214.005 -> That one
216.454 -> T1 is there
217.059 -> And one T2 is there
218.32 -> There are 2 transactions
219.927 -> In a schedule
220.982 -> Read(A)
223.295 -> Let's say Read(A)
226.054 -> Write(A)
228.412 -> Write(A)
233.49 -> This T1 and T2
235.107 -> Read(A)
235.998 -> Read(A) write(A)
237.509 -> Read(A)
238.937 -> Now what is this schedule by seeing?
241.181 -> It is serial or parallel?
242.417 -> It is a parallel schedule
244.658 -> Reason, if we make its graph
247.106 -> So from where did it start? T1
249.535 -> We went from T1
250.526 -> On T2
251.449 -> So we started from T1
253.01 -> We went on T2
255.617 -> And we completed T2 a bit
257.522 -> Read(A) write(A)
258.94 -> We again came on what?
260.696 -> We came on T1
261.933 -> So over here a loop is created
263.873 -> Whenever parallel schedule will be given then what will be created over there
266.663 -> Loop
267.642 -> Now after seeing this question
270.029 -> After seeing this complete schedule
272.282 -> You have to find out
273.325 -> That is this schedule is serializable or not
277.886 -> It is serializable or not
279.076 -> What is the meaning to find serializable or not
281.605 -> If I tell you in simple language
283.464 -> Then this parallel schedule
285.974 -> We have to find a clone
287.987 -> Means finds one clone
290.561 -> That should be serializable
292.268 -> It should be a serial schedule
293.88 -> So if we want to convert this into serial schedule
297.844 -> Then how we will do it
299.19 -> We have 2 ways to convert into serial schedule
302.973 -> Either this parallel schedule
305.51 -> Convert it to T1 goes to T2
308.416 -> Or
311.336 -> Convert it to T2 goes to T1
314.745 -> Means, if this write(A)
316.919 -> I write it over here
317.836 -> So this will be T1 goes to T2
320.639 -> Or if I write read(A) write(A) over here
323.324 -> Or I can write read(A) and write(A) above
326.474 -> And write read(A) below
327.795 -> Then what will this become?
328.887 -> T2 goes to T1
330.555 -> So this is a parallel schedule
332.496 -> To check parallel schedule as serializable
335.958 -> What you have to check
337.173 -> That what equivalent to this
339.188 -> Equivalent to this
340.664 -> Does any serial schedule exists or not
343.339 -> So that concept we say serializability
347.253 -> And for serializability there are 2 ways
351.813 -> One is conflict serializable
353.143 -> And another is view serializable
356.248 -> Conflict serializable and view serializable
359.896 -> You can use conflict serializable method
362.628 -> With that we will come to know that
364.48 -> Can we make serializable schedule of this or not
367.777 -> And one is view serializable method
370.758 -> We will use these both methods
372.148 -> And in any parallel schedule
374.735 -> We will check
376.063 -> That can it be serializable or it cannot be made
380.336 -> So first point you always remember
382.385 -> Whenever serializability will be given
384.48 -> Any question will be given
385.756 -> You will never be given serial schedule
388.174 -> Always you will be given
389.788 -> Parallel schedule
390.92 -> And equivalent to that parallel schedule
394.081 -> You have to find out a serial schedule
396.224 -> So what can that serial schedule be
398.296 -> Like T1 goes to T2
399.819 -> Or T2 goes to T1
402.521 -> If there are 2 transactions
404.024 -> If we talk that there are 3 transactions
406.068 -> Let's say
407.783 -> That we have a schedule S
410.388 -> In that there are 3 transactions
412.684 -> T1, T2 and T3
416.233 -> T1, T2 and T3
419.731 -> Now T1, T2 and T3
421.83 -> What will be given parallel
423.019 -> Let's say Read(A)
424.59 -> Read(A)
426.587 -> Write(A)
428.507 -> Write (A)
430.117 -> Let's say read(B)
432.949 -> Write(B)
434.474 -> Write(B)
436.901 -> Anything
437.868 -> In this way some parallel schedule will be given
440.754 -> This parallel schedule
442.816 -> Which is looking parallel by seeing
444.723 -> This is looking parallel
446.333 -> Can we do it serializable or not
450.14 -> Means what I have to find equivalent to this?
451.982 -> I have to find serial schedule
453.722 -> So for that we use these both methods
456.387 -> So if we will make this serial
458.417 -> Then what possibility we have?
460.297 -> What is the meaning of making serial
461.99 -> That first T1
463.863 -> Then T2
465.288 -> And then T3
466.798 -> Or first T1
469.327 -> Then T3
470.674 -> Then T2
472.286 -> Or T2
473.723 -> T3 T1
476.603 -> Or T2 T1 T3
480.974 -> Or T3 T1 T2
485.72 -> An last is
486.945 -> T3 T2 and T1
491.118 -> So these are 6 possibilities
493.002 -> Out of these 6 possibility
495.046 -> If I convert this schedule
497.224 -> And bring in one possibility
499.811 -> Then we can say that yes it is serializable
504.593 -> Why did this 6 values come?
506.132 -> Because 3 values are there
508.006 -> Over here we have 3 transactions
509.867 -> So 3! you have to find out
512.79 -> So what is 3!? 6
514.713 -> So we have these 6 possibility
516.288 -> Out of these 6
517.942 -> If you bring equivalent to any one
520.403 -> Means by seeing this looks parallel
523.141 -> But if we want to make it serial
525.657 -> Then from these 6 possibilities we will have to make any possibility as true
530.094 -> So to do that
532.083 -> We have 2 methods
533.774 -> Conflict and View
534.718 -> So over here I just wanted to give you over view
537.251 -> That what is serializability
539.27 -> Simple always remember
541.12 -> That serializability means
542.301 -> One parallel schedule is there
544.202 -> You have to find a clone
546.156 -> That should be serial
547.437 -> That is the point
548.695 -> You have to find a clone of parallel
550.792 -> That should be serial
552.071 -> How to do it
553.295 -> That we will check in next video
554.951 -> Thank you

Source: https://www.youtube.com/watch?v=s8QlJoL1G6w