SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Concurrency Control Paul Krzyzanowski [email_address] [email_address] Distributed Systems Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License.
Schedules ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Locking ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Strict two-phase locking ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Locking granularity ,[object Object],[object Object],[object Object],[object Object]
Multiple readers/single writer ,[object Object],[object Object],[object Object]
Multiple readers/single writer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Increasing concurrency: two-version locking ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Two-version locking ,[object Object],[object Object],[object Object]
Two-version locking ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Problems with locking ,[object Object],[object Object],[object Object]
Optimistic concurrency control ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Timestamp ordering ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The end.

Weitere ähnliche Inhalte

Was ist angesagt?

Optimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed SystemsOptimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed Systemsmridul mishra
 
Databases: Concurrency Control
Databases: Concurrency ControlDatabases: Concurrency Control
Databases: Concurrency ControlDamian T. Gordon
 
Concurrency of Issues of Distributed Advance Transaction
Concurrency of Issues of Distributed Advance TransactionConcurrency of Issues of Distributed Advance Transaction
Concurrency of Issues of Distributed Advance TransactionAbdelhafiz Khoudour
 
4. concurrency control
4. concurrency control4. concurrency control
4. concurrency controlAbDul ThaYyal
 
Locking base concurrency control
  Locking base concurrency control  Locking base concurrency control
Locking base concurrency controlPrakash Poudel
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management SystemJanki Shah
 
Concurrent transactions
Concurrent transactionsConcurrent transactions
Concurrent transactionsSajan Sahu
 
Svetlin Nakov - Database Transactions
Svetlin Nakov - Database TransactionsSvetlin Nakov - Database Transactions
Svetlin Nakov - Database TransactionsSvetlin Nakov
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMSkoolkampus
 
Databases: Locking Methods
Databases: Locking MethodsDatabases: Locking Methods
Databases: Locking MethodsDamian T. Gordon
 
Database ,11 Concurrency Control
Database ,11 Concurrency ControlDatabase ,11 Concurrency Control
Database ,11 Concurrency ControlAli Usman
 
Transactions and Concurrency Control
Transactions and Concurrency ControlTransactions and Concurrency Control
Transactions and Concurrency ControlDilum Bandara
 
DBMS (Deadlock, deadlock prevention, 2phase locking)
DBMS (Deadlock, deadlock prevention, 2phase locking)DBMS (Deadlock, deadlock prevention, 2phase locking)
DBMS (Deadlock, deadlock prevention, 2phase locking)Gaurav Solanki
 
Concurrency control!
Concurrency control!Concurrency control!
Concurrency control!Ashish K
 

Was ist angesagt? (20)

Optimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed SystemsOptimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed Systems
 
Databases: Concurrency Control
Databases: Concurrency ControlDatabases: Concurrency Control
Databases: Concurrency Control
 
Concurrency of Issues of Distributed Advance Transaction
Concurrency of Issues of Distributed Advance TransactionConcurrency of Issues of Distributed Advance Transaction
Concurrency of Issues of Distributed Advance Transaction
 
4. concurrency control
4. concurrency control4. concurrency control
4. concurrency control
 
Locking base concurrency control
  Locking base concurrency control  Locking base concurrency control
Locking base concurrency control
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
 
Concurrent transactions
Concurrent transactionsConcurrent transactions
Concurrent transactions
 
Svetlin Nakov - Database Transactions
Svetlin Nakov - Database TransactionsSvetlin Nakov - Database Transactions
Svetlin Nakov - Database Transactions
 
concurrency-control
concurrency-controlconcurrency-control
concurrency-control
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
 
Concurrency control
Concurrency control Concurrency control
Concurrency control
 
Databases: Locking Methods
Databases: Locking MethodsDatabases: Locking Methods
Databases: Locking Methods
 
2 phase locking protocol DBMS
2 phase locking protocol DBMS2 phase locking protocol DBMS
2 phase locking protocol DBMS
 
Deadlock dbms
Deadlock dbmsDeadlock dbms
Deadlock dbms
 
Concurrent control
Concurrent controlConcurrent control
Concurrent control
 
Database ,11 Concurrency Control
Database ,11 Concurrency ControlDatabase ,11 Concurrency Control
Database ,11 Concurrency Control
 
Transactions and Concurrency Control
Transactions and Concurrency ControlTransactions and Concurrency Control
Transactions and Concurrency Control
 
DBMS (Deadlock, deadlock prevention, 2phase locking)
DBMS (Deadlock, deadlock prevention, 2phase locking)DBMS (Deadlock, deadlock prevention, 2phase locking)
DBMS (Deadlock, deadlock prevention, 2phase locking)
 
Concurrency control!
Concurrency control!Concurrency control!
Concurrency control!
 

Andere mochten auch

management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactionsNilu Desai
 
Chapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency controlChapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency controlAbDul ThaYyal
 
Transaction & Concurrency Control
Transaction & Concurrency ControlTransaction & Concurrency Control
Transaction & Concurrency ControlRavimuthurajan
 
Transaction concurrency control
Transaction concurrency controlTransaction concurrency control
Transaction concurrency controlAnand Grewal
 
CS 542 -- Concurrency Control, Distributed Commit
CS 542 -- Concurrency Control, Distributed CommitCS 542 -- Concurrency Control, Distributed Commit
CS 542 -- Concurrency Control, Distributed CommitJ Singh
 
Optimistic Algorithm and Concurrency Control Algorithm
Optimistic Algorithm and Concurrency Control AlgorithmOptimistic Algorithm and Concurrency Control Algorithm
Optimistic Algorithm and Concurrency Control AlgorithmShounak Katyayan
 
transaction-management
transaction-managementtransaction-management
transaction-managementShami Zama
 
Qr codes para tech radar
Qr codes para tech radarQr codes para tech radar
Qr codes para tech radarSri Prasanna
 
Atomic Service Transactions
Atomic Service Transactions Atomic Service Transactions
Atomic Service Transactions WSO2
 
Distributed databases
Distributed databasesDistributed databases
Distributed databasesSuneel Dogra
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency controlBinte fatima
 
The nightmare of locking, blocking and isolation levels!
The nightmare of locking, blocking and isolation levels!The nightmare of locking, blocking and isolation levels!
The nightmare of locking, blocking and isolation levels!Boris Hristov
 
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURY
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURYdeadlock detection using Goldman's algorithm by ANIKET CHOUDHURY
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURYअनिकेत चौधरी
 

Andere mochten auch (20)

Distributed Transaction
Distributed TransactionDistributed Transaction
Distributed Transaction
 
management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactions
 
Chapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency controlChapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency control
 
Transaction & Concurrency Control
Transaction & Concurrency ControlTransaction & Concurrency Control
Transaction & Concurrency Control
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Transaction concurrency control
Transaction concurrency controlTransaction concurrency control
Transaction concurrency control
 
CS 542 -- Concurrency Control, Distributed Commit
CS 542 -- Concurrency Control, Distributed CommitCS 542 -- Concurrency Control, Distributed Commit
CS 542 -- Concurrency Control, Distributed Commit
 
Optimistic Algorithm and Concurrency Control Algorithm
Optimistic Algorithm and Concurrency Control AlgorithmOptimistic Algorithm and Concurrency Control Algorithm
Optimistic Algorithm and Concurrency Control Algorithm
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
 
Distributed System
Distributed System Distributed System
Distributed System
 
transaction-management
transaction-managementtransaction-management
transaction-management
 
Main synopsis
Main synopsisMain synopsis
Main synopsis
 
Qr codes para tech radar
Qr codes para tech radarQr codes para tech radar
Qr codes para tech radar
 
Atomic Service Transactions
Atomic Service Transactions Atomic Service Transactions
Atomic Service Transactions
 
Distributed databases
Distributed databasesDistributed databases
Distributed databases
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency control
 
Distributed System
Distributed SystemDistributed System
Distributed System
 
The nightmare of locking, blocking and isolation levels!
The nightmare of locking, blocking and isolation levels!The nightmare of locking, blocking and isolation levels!
The nightmare of locking, blocking and isolation levels!
 
INTERNRESUME
INTERNRESUMEINTERNRESUME
INTERNRESUME
 
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURY
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURYdeadlock detection using Goldman's algorithm by ANIKET CHOUDHURY
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURY
 

Ähnlich wie Concurrency (Distributed computing)

Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neetineeti arora
 
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neetineeti arora
 
Concurrency control PPT
Concurrency control PPTConcurrency control PPT
Concurrency control PPTShushrutGupta
 
Concurrency note.pdf
Concurrency note.pdfConcurrency note.pdf
Concurrency note.pdfBijayNag1
 
Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! EdholeEdhole.com
 
Oracle certification-courses
Oracle certification-coursesOracle certification-courses
Oracle certification-coursesraima sen
 
Intro to tsql unit 12
Intro to tsql   unit 12Intro to tsql   unit 12
Intro to tsql unit 12Syed Asrarali
 
concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.pptBikalAdhikari4
 
DBMS Presentation.pptx
DBMS Presentation.pptxDBMS Presentation.pptx
DBMS Presentation.pptxPravinBhargav1
 
Design & Development of an Advanced Database Management System Using Multiver...
Design & Development of an Advanced Database Management System Using Multiver...Design & Development of an Advanced Database Management System Using Multiver...
Design & Development of an Advanced Database Management System Using Multiver...IOSR Journals
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Meghaj Mallick
 
Transaction conccurency
Transaction conccurencyTransaction conccurency
Transaction conccurencyEsraa Farrag
 

Ähnlich wie Concurrency (Distributed computing) (20)

Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neeti
 
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neeti
 
Concurrency control PPT
Concurrency control PPTConcurrency control PPT
Concurrency control PPT
 
Rdbms
RdbmsRdbms
Rdbms
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
Concurrency note.pdf
Concurrency note.pdfConcurrency note.pdf
Concurrency note.pdf
 
Dbms voc 5 unit
Dbms voc 5 unitDbms voc 5 unit
Dbms voc 5 unit
 
concurrency control
concurrency controlconcurrency control
concurrency control
 
Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! Edhole
 
Oracle certification-courses
Oracle certification-coursesOracle certification-courses
Oracle certification-courses
 
Intro to tsql unit 12
Intro to tsql   unit 12Intro to tsql   unit 12
Intro to tsql unit 12
 
Vani dbms
Vani dbmsVani dbms
Vani dbms
 
concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.ppt
 
DBMS Presentation.pptx
DBMS Presentation.pptxDBMS Presentation.pptx
DBMS Presentation.pptx
 
F017213747
F017213747F017213747
F017213747
 
F017213747
F017213747F017213747
F017213747
 
Design & Development of an Advanced Database Management System Using Multiver...
Design & Development of an Advanced Database Management System Using Multiver...Design & Development of an Advanced Database Management System Using Multiver...
Design & Development of an Advanced Database Management System Using Multiver...
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
 
Transaction management transparencies
Transaction management transparenciesTransaction management transparencies
Transaction management transparencies
 
Transaction conccurency
Transaction conccurencyTransaction conccurency
Transaction conccurency
 

Mehr von Sri Prasanna

Mehr von Sri Prasanna (20)

Qr codes para tech radar 2
Qr codes para tech radar 2Qr codes para tech radar 2
Qr codes para tech radar 2
 
Test
TestTest
Test
 
Test
TestTest
Test
 
assds
assdsassds
assds
 
assds
assdsassds
assds
 
asdsa
asdsaasdsa
asdsa
 
dsd
dsddsd
dsd
 
About stacks
About stacksAbout stacks
About stacks
 
About Stacks
About  StacksAbout  Stacks
About Stacks
 
About Stacks
About  StacksAbout  Stacks
About Stacks
 
About Stacks
About  StacksAbout  Stacks
About Stacks
 
About Stacks
About  StacksAbout  Stacks
About Stacks
 
About Stacks
About  StacksAbout  Stacks
About Stacks
 
About Stacks
About StacksAbout Stacks
About Stacks
 
About Stacks
About StacksAbout Stacks
About Stacks
 
Network and distributed systems
Network and distributed systemsNetwork and distributed systems
Network and distributed systems
 
Introduction & Parellelization on large scale clusters
Introduction & Parellelization on large scale clustersIntroduction & Parellelization on large scale clusters
Introduction & Parellelization on large scale clusters
 
Mapreduce: Theory and implementation
Mapreduce: Theory and implementationMapreduce: Theory and implementation
Mapreduce: Theory and implementation
 
Other distributed systems
Other distributed systemsOther distributed systems
Other distributed systems
 
Distributed file systems
Distributed file systemsDistributed file systems
Distributed file systems
 

Kürzlich hochgeladen

Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 

Kürzlich hochgeladen (20)

Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 

Concurrency (Distributed computing)

  • 1. Concurrency Control Paul Krzyzanowski [email_address] [email_address] Distributed Systems Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.

Hinweis der Redaktion

  1. One of the important aspects of transactions is that their effect on shared data is serially equivalent. This means that any data that is touched by a set of transactions must be in such a state that the results could have been obtained if all the transactions executed serially (one after another) in some order (it does not matter which). What is invalid, is for the data to be in some form that cannot be the result of serial execution (e.g. two transactions modifying data concurrently). One easy way of achieving this guarantee is to ensure that only one transaction executes at a time. We can accomplish this by using mutual exclusion and having a “transaction” resource that each transaction must access before executing the transaction. However, this is usually overkill and does not allow us to take advantage of the concurrency that we may get in distributed systems (for instance, it is obviously overkill if two transactions don’t even access the same data). A schedule is considered to be any valid order of execution of transactions. For example, if three transactions, A , B , and C execute valid schedules are A-B-C, A-C-B, B-A-C, B-C-A, C-A-B, and C-B-A . If any transactions execute concurrently, a schedule is any interleaving among the transactions where the final output (state of the system) is the same as if the transactions executed serially in any order. What we would like to do is allow multiple transactions to execute simultaneously but keep them out of each other’s way and ensure serializability. This is called concurrency control .
  2. We can use exclusive locks on a resource to serialize execution of transactions that share resources. A transaction locks an object that it is about to use. If another transaction requests the same object and it is locked, the transaction must wait until the object is unlocked. To implement this in a distributed system, we rely on a lock manager - a server that issues locks on resources. This is exactly the same as a centralized mutual exclusion server: a client can request a lock and then send a message releasing a lock on a resource (by resource in this context, we mean some specific block of data that may be read or written). One thing to watch out for, is that we still need to preserve serial execution: if two transactions are accessing the same set of objects, the results must be the same as if the transactions executed in some order (transaction A cannot modify some data while transaction B modifies some other data and then transaction A accesses that modified data -- this is concurrent modification). To ensure serial ordering on resource access, we impose a restriction that states that a transaction is not allowed to get any new locks after it has released a lock . This is known as two-phase locking . The first phase of the transaction is a growing phase in which it acquires the locks it needs. The second phase is the shrinking phase where locks are released.
  3. A problem with two-phase locking is that if a transaction aborts, some other transaction may have already used data from an object that the aborted transaction modified and then unlocked. If this happens, any such transactions will also have to be aborted. This situation is known as cascading aborts . To avoid this, we can strengthen our locking by requiring that a transaction will hold all its locks to the very end: until it commits or aborts rather than releasing the lock when the object is no longer needed. This is known as strict two-phase locking .
  4. A typical system will have many objects and typically a transaction will access only a small amount of data at any given time (and it will frequently be the case that a transaction will not clash with other transactions). The granularity of locking affects the amount of concurrency we can achieve. If we can have a smaller granularity (lock smaller objects or pieces of objects) then we can generally achieve higher concurrency. For example, suppose that all of a bank’s customers are locked for any transaction that needs to modify a single customer datum: concurrency is severely limited because any other transactions that need to access any customer data will be blocked. If, however, we use a customer record as the granularity of locking, transactions that access different customer records will be capable of running concurrently.
  5. There is no harm having multiple transactions read from the same object as long as it has not been modified by any of the transactions. This way we can increase concurrency by having multiple transactions run concurrently if they are only reading from an object. However, only one transaction should be allowed to write to an object. Once a transaction has modified an object, no other transactions should be allowed to read or write the modified object. To support this, we now use two locks: read locks and write locks . Read locks are also known as shared locks (since they can be shared by multiple transactions) If a transaction needs to read an object, it will request a read lock from the lock manager. If a transaction needs to modify an object, it will request a write lock from the lock manager. If the lock manager cannot grant a lock, then the transaction will wait until it can get the lock (after the transaction with the lock committed or aborted). To summarize lock granting: If a transaction has: another transaction may obtain: no locks read lock or write lock read lock read lock (wait for write lock) write lock wait for read or write locks
  6. There is no harm having multiple transactions read from the same object as long as it has not been modified by any of the transactions. This way we can increase concurrency by having multiple transactions run concurrently if they are only reading from an object. However, only one transaction should be allowed to write to an object. Once a transaction has modified an object, no other transactions should be allowed to read or write the modified object. To support this, we now use two locks: read locks and write locks . Read locks are also known as shared locks (since they can be shared by multiple transactions) If a transaction needs to read an object, it will request a read lock from the lock manager. If a transaction needs to modify an object, it will request a write lock from the lock manager. If the lock manager cannot grant a lock, then the transaction will wait until it can get the lock (after the transaction with the lock committed or aborted). To summarize lock granting: If a transaction has: another transaction may obtain: no locks read lock or write lock read lock read lock (wait for write lock) write lock wait for read or write locks
  7. Two-version locking is an optimistic concurrency control scheme that allows one transaction to write tentative versions of objects while other transactions read from committed versions of the same objects. Read operations only wait if another transaction is currently committing the same object. This scheme allows more concurrency than read-write locks, but writing transactions risk waiting (or rejection) when they attempt to commit. Transactions cannot commit their write operations immediately if other uncommitted transactions have read the same objects. Transactions that request to commit in this situation have to wait until the reading transactions have completed.
  8. The two-version locking scheme requires three types of locks: read, write, and commit locks. Before an object is read, a transaction must obtain a read lock . Before an object is written, the transaction must obtain a write lock (same as with two-phase locking). Neither of these locks will be granted if there is a commit lock on the object. When the transaction is ready to commit: - all of the transaction’s write locks are changed to commit locks - if any objects used by the transaction have outstanding read locks, the transaction must wait until the transactions that set these locks have completed and the locks are released. If we compare the performance difference between two-version locking and strict two-phase locking (read/write locks): - read operations in two-version locking are delayed only while transactions are being committed rather than during the entire execution of transactions (usually the commit protocol takes far less time than the time to perform the transaction) - but… read operations of one transaction can cause a delay in the committing of other transactions.
  9. The two-version locking scheme requires three types of locks: read, write, and commit locks. Before an object is read, a transaction must obtain a read lock . Before an object is written, the transaction must obtain a write lock (same as with two-phase locking). Neither of these locks will be granted if there is a commit lock on the object. When the transaction is ready to commit: - all of the transaction’s write locks are changed to commit locks - if any objects used by the transaction have outstanding read locks, the transaction must wait until the transactions that set these locks have completed and the locks are released. If we compare the performance difference between two-version locking and strict two-phase locking (read/write locks): - read operations in two-version locking are delayed only while transactions are being committed rather than during the entire execution of transactions (usually the commit protocol takes far less time than the time to perform the transaction) - but… read operations of one transaction can cause a delay in the committing of other transactions.
  10. Locks are not without drawbacks Locks have an overhead associated with them: a lock manager is needed to keep track of locks - there is overhead in requesting them. Even read-only operations must still request locks. The use of locks can result in deadlock. We need to have software in place to detect or avoid deadlock. Locks can decrease the potential concurrency in a system by having a transaction hold locks for the duration of the transaction (until a commit or abort).
  11. King and Robinson (1981) proposed an alternative technique for achieving concurrency control, called optimistic concurrency control . This is based on the observation that, in most applications, the chance of two transactions accessing the same object is low. We will allow transactions to proceed as if there were no possibility of conflict with other transactions: a transaction does not have to obtain or check for locks. This is the working phase . Each transaction has a tentative version (private workspace) of the objects it updates - copy of the most recently committed version. Write operations record new values as tentative values. Before a transaction can commit, a validation is performed on all the data items to see whether the data conflicts with operations of other transactions. This is the validation phase . If the validation fails, then the transaction will have to be aborted and restarted later. If the transaction succeeds, then the changes in the tentative version are made permanent. This is the update phase . Optimistic control is deadlock free and allows for maximum parallelism (at the expense of possibly restarting transactions)
  12. Another approach to concurrency control was presented by Reed in 1983. This is called timestamp ordering . Each transaction is assigned a unique timestamp when it begins (can be from a physical or logical clock). Each object in the system has a read and write timestamp associated with it (two timestamps per object). The read timestamp is the timestamp of the last committed transaction that read the object. The write timestamp is the timestamp of the last committed transaction that modified the object (note - the timestamps are obtained from the transaction timestamp - the start of that transaction) The rule of timestamp ordering is: - if a transaction wants to write an object, it compares its own timestamp with the object’s read and write timestamps. If the object’s timestamps are older, then the ordering is good. - if a transaction wants to read an object, it compares its own timestamp with the object’s write timestamp. If the object’s write timestamp is older than the current transaction, then the ordering is good. If a transaction attempts to access an object and does not detect proper ordering, the transaction is aborted and restarted (improper ordering means that a newer transaction came in and modified data before the older one could access the data or read data that the older one wants to modify).