Movatterモバイル変換


[0]ホーム

URL:


Uploaded byaineezafar2
PPT, PDF4 views

lecture 6 : introduction to concurency control.ppt

Concurrency control is a method used in databases to make sure that when many users access or change data at the same time, the data remains accurate, consistent, and free from conflicts.When multiple transactions run together (for example, many students updating their records at once), problems like lost updates, incorrect reads, or data corruption can occur. Concurrency control prevents these issues.

Embed presentation

Download to read offline
1Transaction Management
2Chapter 22 - Objectives Function and importance of transactions. Properties of transactions. Concurrency Control– Meaning of serializability.– How locking can ensure serializability.– Deadlock and how it can be resolved.– How timestamping can ensureserializability.– Optimistic concurrency control.
3Chapter 22 - Objectives Recovery Control– Some causes of database failure.– How to recover following databasefailure. Alternative models for long duration transactions.
4Transaction SupportTransactionAction, or series of actions, carried out by user orapplication, which reads or updates contents ofdatabase. Logical unit of work on the database. Application program is series of transactions with non-database processing in between. Transforms database from one consistent state toanother, although consistency may be violated duringtransaction.
5Example Transaction
6Transaction Support Can have one of two outcomes:– Success - transaction commits and database reaches anew consistent state.– Failure - transaction aborts, and database must berestored to consistent state before it started.– Such a transaction is rolled back or undone. Committed transaction cannot be aborted. Aborted transaction that is rolled back can berestarted later.
7Properties of TransactionsFour basic (ACID) properties of a transaction are:Atomicity ‘All or nothing’ property.Consistency Must transform database from one consistentstate to another.Isolation Partial effects of incomplete transactionsshould not be visible to other transactions.Durability Effects of a committed transaction arepermanent and must not be lost because of later failure.
8Concurrency ControlProcess of managing simultaneous operations onthe database without having them interfere withone another. Prevents interference when two or more usersare accessing database simultaneously and atleast one is updating data. Although two transactions may be correct inthemselves, interleaving of operations mayproduce an incorrect result.
9Need for Concurrency Control Three examples of potential problems caused byconcurrency:– Lost update problem.– Uncommitted dependency problem.– Inconsistent analysis problem.
10Lost Update Problem Successfully completed update is overridden byanother user. T1 withdrawing £10 from an account with balx,initially £100. T2 depositing £100 into same account. Serially, final balance would be £190.
11Lost Update Problem Loss of T2’s update avoided by preventing T1from reading balx until after update.
12Uncommitted Dependency Problem Occurs when one transaction can seeintermediate results of another transactionbefore it has committed. T4 updates balx to £200 but it aborts, so balxshould be back at original value of £100. T3 has read new value of balx (£200) and usesvalue as basis of £10 reduction, giving a newbalance of £190, instead of £90.
13Uncommitted Dependency Problem Problem avoided by preventing T3 fromreading balx until after T4 commits or aborts.
14Inconsistent Analysis Problem Occurs when transaction reads several values butsecond transaction updates some of them duringexecution of first. Sometimes referred to as dirty read or unrepeatableread. T6 is totaling balances of account x (£100), accounty (£50), and account z (£25). Meantime, T5 has transferred £10 from balx tobalz, so T6 now has wrong result (£10 too high).
15Inconsistent Analysis Problem Problem avoided by preventing T6 from reading balx and balzuntil after T5 completed updates.
16Serializability Objective of a concurrency control protocol is toschedule transactions in such a way as to avoidany interference. Could run transactions serially, but this limitsdegree of concurrency or parallelism in system. Serializability identifies those executions oftransactions guaranteed to ensure consistency.
17SerializabilityScheduleSequence of reads/writes by set of concurrenttransactions.Serial ScheduleSchedule where operations of each transactionare executed consecutively without anyinterleaved operations from other transactions. No guarantee that results of all serial executionsof a given set of transactions will be identical.
18Nonserial Schedule Schedule where operations from set of concurrenttransactions are interleaved. Objective of serializability is to find nonserialschedules that allow transactions to executeconcurrently without interfering with one another. In other words, want to find nonserial schedulesthat are equivalent to some serial schedule. Such aschedule is called serializable.
19Serializability In serializability, ordering of read/writes isimportant:(a) If two transactions only read a data item, theydo not conflict and order is not important.(b) If two transactions either read or writecompletely separate data items, they do notconflict and order is not important.(c) If one transaction writes a data item andanother reads or writes same data item, orderof execution is important.
20Example of Conflict Serializability
21Serializability Conflict serializable schedule orders anyconflicting operations in same way as some serialexecution. Under constrained write rule (transaction updatesdata item based on its old value, which is firstread), use precedence graph to test forserializability.
22Precedence Graph Create:– node for each transaction;– a directed edge Ti  Tj, if Tj reads the value ofan item written by TI;– a directed edge Ti  Tj, if Tj writes a value intoan item after it has been read by Ti. If precedence graph contains cycle schedule isnot conflict serializable.
23Example - Non-conflict serializable schedule T9 is transferring £100 from one account withbalance balx to another account with balancebaly. T10 is increasing balance of these two accounts by10%. Precedence graph has a cycle and so is notserializable.
24Example - Non-conflict serializable schedule
25View Serializability Offers less stringent definition of schedule equivalencethan conflict serializability. Two schedules S1 and S2 are view equivalent if:– For each data item x, if Ti reads initial value of x in S1, Timust also read initial value of x in S2.– For each read on x by Ti in S1, if value read by x iswritten by Tj, Ti must also read value of x produced by Tjin S2.– For each data item x, if last write on x performed by Ti inS1, same transaction must perform final write on x in S2.
26View Serializability Schedule is view serializable if it is viewequivalent to a serial schedule. Every conflict serializable schedule is viewserializable, although converse is not true. It can be shown that any view serializableschedule that is not conflict serializable containsone or more blind writes. In general, testing whether schedule isserializable is NP-complete.
27Example - View Serializable schedule
28Recoverability Serializability identifies schedules that maintaindatabase consistency, assuming no transactionfails. Could also examine recoverability oftransactions within schedule. If transaction fails, atomicity requires effects oftransaction to be undone. Durability states that once transaction commits,its changes cannot be undone (without runninganother, compensating, transaction).
29Recoverable ScheduleA schedule where, for each pair of transactionsTi and Tj, if Tj reads a data item previouslywritten by Ti, then the commit operation of Tiprecedes the commit operation of Tj.

Recommended

PDF
UNIT 2- TRANSACTION CONCEPTS AND CONCURRENCY CONCEPTS (1).pdf
PDF
Unit 5 - PPT.pdf DBMS SRM university chennai
PPT
transaction_processing.ppt
PPT
PDF
Cs501 transaction
PPTX
DBMS_Unit-4 data bas management (1).pptx
PPTX
Unit-IV_transaction.pptx
PPTX
Transactions
PDF
Advance_DBMS-Lecture_notesssssssssssssssss.pdf
PPT
Transactions in dbms
PPTX
Database Transactions for databases and all you need.pptx
PPT
ddededeeddeededeeeeeeeeeeeeeeeeeeeeeeeeeeee
PPT
Transaction management
PDF
DBMS - Unit 4 (Database Transaction Management) PPT.pdf
PPTX
Unit 5 Transcationrelationaldatabases.pptx
PPTX
Transactions and Concurrency Control
PPTX
Transaction management DBMS
PPT
Class-Transaction Management.ppt Database
PPTX
Adbms 35 recoverability and serializability
PDF
Transaction Management - Lecture 11 - Introduction to Databases (1007156ANR)
PPT
DBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTS
PPTX
DBMS_Transaction processing – Schedule –Serializable Schedule – Concurrency C...
PPTX
Transaction of program execution updates
PPT
unit06-dbms-new.ppt
DOCX
UNIT-IV: Transaction Processing Concepts
PPTX
UPDATED UNIT 4 DBMS NOTES ECE DS SRM 21 Reg
PPT
Concurrent Transactions.ppt
PPTX
UNIT-4-Transactionstates and processing ppt.pptx
PDF
An introduction to the Medical Importance of Viruses
PPTX
Stimulation_Tests_of various endocrine glands

More Related Content

PDF
UNIT 2- TRANSACTION CONCEPTS AND CONCURRENCY CONCEPTS (1).pdf
PDF
Unit 5 - PPT.pdf DBMS SRM university chennai
PPT
transaction_processing.ppt
PPT
PDF
Cs501 transaction
PPTX
DBMS_Unit-4 data bas management (1).pptx
PPTX
Unit-IV_transaction.pptx
PPTX
Transactions
UNIT 2- TRANSACTION CONCEPTS AND CONCURRENCY CONCEPTS (1).pdf
Unit 5 - PPT.pdf DBMS SRM university chennai
transaction_processing.ppt
Cs501 transaction
DBMS_Unit-4 data bas management (1).pptx
Unit-IV_transaction.pptx
Transactions

Similar to lecture 6 : introduction to concurency control.ppt

PDF
Advance_DBMS-Lecture_notesssssssssssssssss.pdf
PPT
Transactions in dbms
PPTX
Database Transactions for databases and all you need.pptx
PPT
ddededeeddeededeeeeeeeeeeeeeeeeeeeeeeeeeeee
PPT
Transaction management
PDF
DBMS - Unit 4 (Database Transaction Management) PPT.pdf
PPTX
Unit 5 Transcationrelationaldatabases.pptx
PPTX
Transactions and Concurrency Control
PPTX
Transaction management DBMS
PPT
Class-Transaction Management.ppt Database
PPTX
Adbms 35 recoverability and serializability
PDF
Transaction Management - Lecture 11 - Introduction to Databases (1007156ANR)
PPT
DBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTS
PPTX
DBMS_Transaction processing – Schedule –Serializable Schedule – Concurrency C...
PPTX
Transaction of program execution updates
PPT
unit06-dbms-new.ppt
DOCX
UNIT-IV: Transaction Processing Concepts
PPTX
UPDATED UNIT 4 DBMS NOTES ECE DS SRM 21 Reg
PPT
Concurrent Transactions.ppt
PPTX
UNIT-4-Transactionstates and processing ppt.pptx
Advance_DBMS-Lecture_notesssssssssssssssss.pdf
Transactions in dbms
Database Transactions for databases and all you need.pptx
ddededeeddeededeeeeeeeeeeeeeeeeeeeeeeeeeeee
Transaction management
DBMS - Unit 4 (Database Transaction Management) PPT.pdf
Unit 5 Transcationrelationaldatabases.pptx
Transactions and Concurrency Control
Transaction management DBMS
Class-Transaction Management.ppt Database
Adbms 35 recoverability and serializability
Transaction Management - Lecture 11 - Introduction to Databases (1007156ANR)
DBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTS
DBMS_Transaction processing – Schedule –Serializable Schedule – Concurrency C...
Transaction of program execution updates
unit06-dbms-new.ppt
UNIT-IV: Transaction Processing Concepts
UPDATED UNIT 4 DBMS NOTES ECE DS SRM 21 Reg
Concurrent Transactions.ppt
UNIT-4-Transactionstates and processing ppt.pptx

More from aineezafar2

PDF
An introduction to the Medical Importance of Viruses
PPTX
Stimulation_Tests_of various endocrine glands
PPT
a general introduction to writing instructions
PPT
Introduction-to-Virology- study of viruses
PPTX
Endocrine_Stimulation_Tests_FULL_CONTENT.pptx
PPT
Writing Instructions- Guiding a reader through a process
PPTX
An introduction to art of writing manuals.pptx
PPT
lecture 6 concurency control.ppt-Transaction Management
PPTX
OVERVIEW OF INNATE AND ADAPTIVE IMMUNITY IN HUMAN
PPTX
INTRODUCTION TO THE Human IMMUNE system (1).pptx
PPTX
Virology an overview of Structure and role of viruses
PPTX
External_and_Internal_Defence.......pptx
PPTX
Introduction to Mycology- Structure and Importance of Fungi
PPTX
Introduction to Viruses structure and Classification
PPTX
Introduction to innate Immunity in Human
PPTX
Introduction to the immune system adaptive immunity
PPTX
Surviving Sepsis Guidelines by Dr. jamal.pptx
PPT
Welcome to microbiology a branch of biology
PDF
202004131505183300sudhir_biochem_Introductory_Immunology.pdf
PPTX
Introduction to qualitative research design
An introduction to the Medical Importance of Viruses
Stimulation_Tests_of various endocrine glands
a general introduction to writing instructions
Introduction-to-Virology- study of viruses
Endocrine_Stimulation_Tests_FULL_CONTENT.pptx
Writing Instructions- Guiding a reader through a process
An introduction to art of writing manuals.pptx
lecture 6 concurency control.ppt-Transaction Management
OVERVIEW OF INNATE AND ADAPTIVE IMMUNITY IN HUMAN
INTRODUCTION TO THE Human IMMUNE system (1).pptx
Virology an overview of Structure and role of viruses
External_and_Internal_Defence.......pptx
Introduction to Mycology- Structure and Importance of Fungi
Introduction to Viruses structure and Classification
Introduction to innate Immunity in Human
Introduction to the immune system adaptive immunity
Surviving Sepsis Guidelines by Dr. jamal.pptx
Welcome to microbiology a branch of biology
202004131505183300sudhir_biochem_Introductory_Immunology.pdf
Introduction to qualitative research design

Recently uploaded

PDF
Joseph Heiman New Jersey - Passionate About Finance
PDF
How to Successfully Buy, Old Facebook Account.pdf
PPTX
Precautionary Landing Presentation Slide
PDF
Pre- 97 proposition to the parliamentary member
PDF
Is it academically dishonest to buy likinden connections if ....pdf
PPTX
How Does a Security Guards Company in Los Angeles County Screen Its Security ...
PDF
How To Safely Buy Instagram Accounts In 2025.pdf
PDF
Enterprise Architecture Professional Journal Vol X November 2025.pdf
PDF
Benefits of Buying Old GitHub Accounts for Your Projects
PDF
by Best Platforms to Buy Twitter Accounts in 2025.pdf
PDF
Dawn Buckley - A Respected Business Leader
PDF
The Most Recommended Commerce Colleges of the Year in 2025.pdf
PPTX
Summaries of the 20 best business books of 2025.
PPTX
Thermal Energy International Presentation - 2025 AGM
PDF
HIROSHI BRYAN VO - A Bilingual Voice Actor
PPTX
ActARion - The Future of Work with AI and Augmented Reality
PDF
Cyber Awareness Presentation - April 2024.pdf
PDF
Strategic Thinking in Action: A conversation with Steven Haines
PDF
Brief Two Image and Anchoring Text Apply
PPTX
CertificateCertificateCertificateCertificate
Joseph Heiman New Jersey - Passionate About Finance
How to Successfully Buy, Old Facebook Account.pdf
Precautionary Landing Presentation Slide
Pre- 97 proposition to the parliamentary member
Is it academically dishonest to buy likinden connections if ....pdf
How Does a Security Guards Company in Los Angeles County Screen Its Security ...
How To Safely Buy Instagram Accounts In 2025.pdf
Enterprise Architecture Professional Journal Vol X November 2025.pdf
Benefits of Buying Old GitHub Accounts for Your Projects
by Best Platforms to Buy Twitter Accounts in 2025.pdf
Dawn Buckley - A Respected Business Leader
The Most Recommended Commerce Colleges of the Year in 2025.pdf
Summaries of the 20 best business books of 2025.
Thermal Energy International Presentation - 2025 AGM
HIROSHI BRYAN VO - A Bilingual Voice Actor
ActARion - The Future of Work with AI and Augmented Reality
Cyber Awareness Presentation - April 2024.pdf
Strategic Thinking in Action: A conversation with Steven Haines
Brief Two Image and Anchoring Text Apply
CertificateCertificateCertificateCertificate

lecture 6 : introduction to concurency control.ppt

  • 1.
  • 2.
    2Chapter 22 -Objectives Function and importance of transactions. Properties of transactions. Concurrency Control– Meaning of serializability.– How locking can ensure serializability.– Deadlock and how it can be resolved.– How timestamping can ensureserializability.– Optimistic concurrency control.
  • 3.
    3Chapter 22 -Objectives Recovery Control– Some causes of database failure.– How to recover following databasefailure. Alternative models for long duration transactions.
  • 4.
    4Transaction SupportTransactionAction, orseries of actions, carried out by user orapplication, which reads or updates contents ofdatabase. Logical unit of work on the database. Application program is series of transactions with non-database processing in between. Transforms database from one consistent state toanother, although consistency may be violated duringtransaction.
  • 5.
  • 6.
    6Transaction Support Canhave one of two outcomes:– Success - transaction commits and database reaches anew consistent state.– Failure - transaction aborts, and database must berestored to consistent state before it started.– Such a transaction is rolled back or undone. Committed transaction cannot be aborted. Aborted transaction that is rolled back can berestarted later.
  • 7.
    7Properties of TransactionsFourbasic (ACID) properties of a transaction are:Atomicity ‘All or nothing’ property.Consistency Must transform database from one consistentstate to another.Isolation Partial effects of incomplete transactionsshould not be visible to other transactions.Durability Effects of a committed transaction arepermanent and must not be lost because of later failure.
  • 8.
    8Concurrency ControlProcess ofmanaging simultaneous operations onthe database without having them interfere withone another. Prevents interference when two or more usersare accessing database simultaneously and atleast one is updating data. Although two transactions may be correct inthemselves, interleaving of operations mayproduce an incorrect result.
  • 9.
    9Need for ConcurrencyControl Three examples of potential problems caused byconcurrency:– Lost update problem.– Uncommitted dependency problem.– Inconsistent analysis problem.
  • 10.
    10Lost Update ProblemSuccessfully completed update is overridden byanother user. T1 withdrawing £10 from an account with balx,initially £100. T2 depositing £100 into same account. Serially, final balance would be £190.
  • 11.
    11Lost Update ProblemLoss of T2’s update avoided by preventing T1from reading balx until after update.
  • 12.
    12Uncommitted Dependency ProblemOccurs when one transaction can seeintermediate results of another transactionbefore it has committed. T4 updates balx to £200 but it aborts, so balxshould be back at original value of £100. T3 has read new value of balx (£200) and usesvalue as basis of £10 reduction, giving a newbalance of £190, instead of £90.
  • 13.
    13Uncommitted Dependency ProblemProblem avoided by preventing T3 fromreading balx until after T4 commits or aborts.
  • 14.
    14Inconsistent Analysis ProblemOccurs when transaction reads several values butsecond transaction updates some of them duringexecution of first. Sometimes referred to as dirty read or unrepeatableread. T6 is totaling balances of account x (£100), accounty (£50), and account z (£25). Meantime, T5 has transferred £10 from balx tobalz, so T6 now has wrong result (£10 too high).
  • 15.
    15Inconsistent Analysis ProblemProblem avoided by preventing T6 from reading balx and balzuntil after T5 completed updates.
  • 16.
    16Serializability Objective ofa concurrency control protocol is toschedule transactions in such a way as to avoidany interference. Could run transactions serially, but this limitsdegree of concurrency or parallelism in system. Serializability identifies those executions oftransactions guaranteed to ensure consistency.
  • 17.
    17SerializabilityScheduleSequence of reads/writesby set of concurrenttransactions.Serial ScheduleSchedule where operations of each transactionare executed consecutively without anyinterleaved operations from other transactions. No guarantee that results of all serial executionsof a given set of transactions will be identical.
  • 18.
    18Nonserial Schedule Schedulewhere operations from set of concurrenttransactions are interleaved. Objective of serializability is to find nonserialschedules that allow transactions to executeconcurrently without interfering with one another. In other words, want to find nonserial schedulesthat are equivalent to some serial schedule. Such aschedule is called serializable.
  • 19.
    19Serializability In serializability,ordering of read/writes isimportant:(a) If two transactions only read a data item, theydo not conflict and order is not important.(b) If two transactions either read or writecompletely separate data items, they do notconflict and order is not important.(c) If one transaction writes a data item andanother reads or writes same data item, orderof execution is important.
  • 20.
    20Example of ConflictSerializability
  • 21.
    21Serializability Conflict serializableschedule orders anyconflicting operations in same way as some serialexecution. Under constrained write rule (transaction updatesdata item based on its old value, which is firstread), use precedence graph to test forserializability.
  • 22.
    22Precedence Graph Create:–node for each transaction;– a directed edge Ti  Tj, if Tj reads the value ofan item written by TI;– a directed edge Ti  Tj, if Tj writes a value intoan item after it has been read by Ti. If precedence graph contains cycle schedule isnot conflict serializable.
  • 23.
    23Example - Non-conflictserializable schedule T9 is transferring £100 from one account withbalance balx to another account with balancebaly. T10 is increasing balance of these two accounts by10%. Precedence graph has a cycle and so is notserializable.
  • 24.
    24Example - Non-conflictserializable schedule
  • 25.
    25View Serializability Offersless stringent definition of schedule equivalencethan conflict serializability. Two schedules S1 and S2 are view equivalent if:– For each data item x, if Ti reads initial value of x in S1, Timust also read initial value of x in S2.– For each read on x by Ti in S1, if value read by x iswritten by Tj, Ti must also read value of x produced by Tjin S2.– For each data item x, if last write on x performed by Ti inS1, same transaction must perform final write on x in S2.
  • 26.
    26View Serializability Scheduleis view serializable if it is viewequivalent to a serial schedule. Every conflict serializable schedule is viewserializable, although converse is not true. It can be shown that any view serializableschedule that is not conflict serializable containsone or more blind writes. In general, testing whether schedule isserializable is NP-complete.
  • 27.
    27Example - ViewSerializable schedule
  • 28.
    28Recoverability Serializability identifiesschedules that maintaindatabase consistency, assuming no transactionfails. Could also examine recoverability oftransactions within schedule. If transaction fails, atomicity requires effects oftransaction to be undone. Durability states that once transaction commits,its changes cannot be undone (without runninganother, compensating, transaction).
  • 29.
    29Recoverable ScheduleA schedulewhere, for each pair of transactionsTi and Tj, if Tj reads a data item previouslywritten by Ti, then the commit operation of Tiprecedes the commit operation of Tj.

[8]ページ先頭

©2009-2025 Movatter.jp