SlideShare uma empresa Scribd logo
1 de 4
Concurrency control
From Wikipedia, the free encyclopedia
Jump to: navigation, search

In computer science, especially in the fields of computer programming (see also
concurrent programming, parallel programming), operating systems (see also parallel
computing), multiprocessors, and databases, concurrency control ensures that correct
results for concurrent operations are generated, while getting those results as quickly as
possible.

Computer systems, both software and hardware, consist of modules, or components. Each
component is designed to operate correctly, i.e., to obey to or meet certain consistency
rules. When components that operate concurrently interact by messaging or by sharing
accessed data (in memory or storage), a certain component's consistency may be violated
by another component. The general area of concurrency control provides rules, methods,
design methodologies, and theories to maintain the consistency of components operating
concurrently while interacting, and thus the consistency and correctness of the whole
system. Introducing concurrency control into a system means applying operation
constraints which typically result in some performance reduction. Operation consistency
and correctness should be achieved while still maintaining reasonable operation
efficiency.

Contents
[hide]

   •     1 Concurrency control in databases
            o 1.1 Transaction ACID rules
            o 1.2 Why is concurrency control needed?
            o 1.3 Concurrency control mechanisms
            o 1.4 See also
            o 1.5 References
   •     2 Concurrency control in operating systems
            o 2.1 See also

            o   2.2 References

   [edit] Concurrency control in databases
Concurrency control in Database management systems (DBMS; Bernstein et al. 1987,
Weikum and Vossen 2001), other transactional objects, and related distributed
applications (e.g., Grid computing and Cloud computing) ensures that database
transactions are performed concurrently without violating the data integrity of the
respective databases. Thus concurrency control is an essential element for correctness in
any system where two database transactions or more can access the same data
concurrently, e.g., virtually in any general-purpose database system. A well established
concurrency control theory exists for database systems: serializability theory, which
allows to effectively design and analyze concurrency control methods and mechanisms.

To ensure correctness, A DBMS usually guarantees that only serializable transaction
schedules are generated, unless serializability is intentionally relaxed. For maintaining
correctness in cases of failed (aborted) transactions (which can always happen for many
reasons) schedules also need to have the recoverability property. A DBMS also
guarantees that no effect of committed transactions is lost, and no effect of aborted
(rolled back) transactions remains in the related database. Overall transaction
characterization is usually summarized by the following ACID rules:

[edit] Transaction ACID rules

Main article: ACID

Every database transaction must obey the following rules:

   •   Atomicity - Either the effects of all or none of its operations remain when a
       transaction is completed (committed or aborted respectively). In other words, to
       the outside world a committed transaction appears to be indivisible, atomic. A
       transaction is an indivisible unit of work that is either performed in its entirety or
       not performed at all ("all or nothing" semantics).
   •   Consistency - Every transaction must leave the database in a consistent state, i.e.,
       maintain the predetermined integrity rules of the database (constraints upon and
       among the database's objects). A transaction must transform a database from one
       consistent state to another consistent state.
   •   Isolation - Transactions cannot interfere with each other. Moreover, an
       incomplete transaction is not visible to another transaction. Providing isolation is
       the main goal of concurrency control.
   •   Durability - Effects of successful (committed) transactions must persist through
       crashes.

[edit] Why is concurrency control needed?

If transactions are executed serially, i.e., sequentially with no overlap in time, no
transaction concurrency exists. However, if concurrent transactions with interleaving
operations are allowed in an uncontrolled manner, some unexpected result may occur.
Here are some typical examples:

   1. Lost update problem: A second transaction writes a second value of a data-item
      (datum) on top of a first value written by a first concurrent transaction, and the
      first value is lost to other transactions running concurrently which need, by their
precedence, to read the first value. The transactions that have read the wrong
      value end with incorrect results.
   2. The dirty read problem: Transactions read a value written by a transaction that has
      been later aborted. This value disappears from the database upon abort, and
      should not have been read by any transaction ("dirty read"). The reading
      transactions end with incorrect results.
   3. The incorrect summary problem: While one transaction takes a summary over
      values of a repeated data-item, a second transaction updated some instances of
      that data-item. The resulting summary does not reflect a correct result for any
      (usually needed for correctness) precedence order between the two transactions (if
      one is executed before the other), but rather some random result, depending on the
      timing of the updates, and whether a certain update result has been included in the
      summary or not.

[edit] Concurrency control mechanisms

The main categories of concurrency control mechanisms are:

   •   Optimistic - Delay the checking of whether a transaction meets the isolation and
       other integrity rules (e.g., serializability and recoverability) until its end, without
       blocking any of its (read, write) operations, and then abort a transaction if the
       desired rules are violated.
   •   Pessimistic - Block an operation of a transaction if it may cause violation of the
       rules until the possibility of violation disappears.
   •   Semi-optimistic - Block operations in some situations, if they may cause
       violation of some rules, and do not block in other situations while delaying rules
       checking to transaction's end, as done with optimistic.

Many methods for concurrency control exist. Most of them can be implemented within
either main category above. Major methods, which have each many variants, and in some
cases may overlap or be combined, include:

   •   Two phase locking (2PL)
   •   Serialization (or Serializability, or Conflict, or Precedence) graph checking
   •   Timestamp ordering (TO)
   •   Commitment ordering (or Commit ordering; CO)
   •   Multiversion concurrency control (MVCC)
   •   Index concurrency control (for synchronizing access operations to indexes, rather
       than to user data)

A common major goal of concurrency control is generating schedules with the
Serializability property. Serializability of a schedule means equivalence to some serial
schedule with the same transactions (i.e., in which transactions are sequential with no
overlap in time). Serializability is considered the highest level of isolation between
database transactions, and the major correctness criterion for concurrent transactions. In
some cases relaxed forms of serializability are allowed for better performance, if
application's correctness is not violated by the relaxation.

Almost all implemented concurrency control mechanisms achieve serializability by
providing Conflict serializablity, a broad special case of serializability which can be
implemented effectively.

Concurrency control also ensures the Recoverability property for maintaining correctness
in cases of aborted transactions (which can always happen for many reasons).
Recoverability means that committed transactions have not read data written by aborted
transactions. None of the mechanisms above provides recoverability in its general form,
and special considerations and mechanism enhancements are needed to support
recoverability. A commonly utilized special case of recoverability is Strictness, which
allows efficient database recovery from failure, but excludes optimistic implementations
(the term "semi-optimistic" appeared for the first time in conjunction with Strict CO
(SCO)).

As database systems become distributed, or cooperate in distributed environments (e.g.,
in Grid computing and Cloud computing), a need exists for distributed concurrency
control mechanisms. Achieving Distributed serializability and Global serializability
effectively poses special challenges typically not met by most local serializability
mechanisms (especially due to a need in costly distribution of concurrency control
information). The Commitment ordering (CO; Raz 1992) technique provides a general
effective solution for both distributed and global serializability, also in a heterogeneous
environment with different concurrency control mechanisms.

Mais conteúdo relacionado

Mais procurados

protocols of concurrency control
protocols of concurrency controlprotocols of concurrency control
protocols of concurrency controlMOHIT DADU
 
Optimistic Algorithm and Concurrency Control Algorithm
Optimistic Algorithm and Concurrency Control AlgorithmOptimistic Algorithm and Concurrency Control Algorithm
Optimistic Algorithm and Concurrency Control AlgorithmShounak Katyayan
 
Optimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed SystemsOptimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed Systemsmridul mishra
 
Transaction concurrency control
Transaction concurrency controlTransaction concurrency control
Transaction concurrency controlAnand Grewal
 
Transactions (Distributed computing)
Transactions (Distributed computing)Transactions (Distributed computing)
Transactions (Distributed computing)Sri Prasanna
 
4. concurrency control
4. concurrency control4. concurrency control
4. concurrency controlAbDul ThaYyal
 
Svetlin Nakov - Database Transactions
Svetlin Nakov - Database TransactionsSvetlin Nakov - Database Transactions
Svetlin Nakov - Database TransactionsSvetlin Nakov
 
Transactions and Concurrency Control
Transactions and Concurrency ControlTransactions and Concurrency Control
Transactions and Concurrency ControlDilum Bandara
 
CS 542 -- Concurrency Control, Distributed Commit
CS 542 -- Concurrency Control, Distributed CommitCS 542 -- Concurrency Control, Distributed Commit
CS 542 -- Concurrency Control, Distributed CommitJ Singh
 
Dbms sixth chapter_part-1_2011
Dbms sixth chapter_part-1_2011Dbms sixth chapter_part-1_2011
Dbms sixth chapter_part-1_2011sumit_study
 
Dbms ii mca-ch9-transaction-processing-2013
Dbms ii mca-ch9-transaction-processing-2013Dbms ii mca-ch9-transaction-processing-2013
Dbms ii mca-ch9-transaction-processing-2013Prosanta Ghosh
 
Introduction to database-Transaction Concurrency and Recovery
Introduction to database-Transaction Concurrency and RecoveryIntroduction to database-Transaction Concurrency and Recovery
Introduction to database-Transaction Concurrency and RecoveryAjit Nayak
 
Databases: Locking Methods
Databases: Locking MethodsDatabases: Locking Methods
Databases: Locking MethodsDamian T. Gordon
 
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neetineeti arora
 
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
 
Database management system chapter16
Database management system chapter16Database management system chapter16
Database management system chapter16Md. Mahedi Mahfuj
 
Validation based protocol
Validation based protocolValidation based protocol
Validation based protocolBBDITM LUCKNOW
 

Mais procurados (20)

protocols of concurrency control
protocols of concurrency controlprotocols of concurrency control
protocols of concurrency control
 
Concurrent control
Concurrent controlConcurrent control
Concurrent control
 
Optimistic Algorithm and Concurrency Control Algorithm
Optimistic Algorithm and Concurrency Control AlgorithmOptimistic Algorithm and Concurrency Control Algorithm
Optimistic Algorithm and Concurrency Control Algorithm
 
Optimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed SystemsOptimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed Systems
 
Transaction concurrency control
Transaction concurrency controlTransaction concurrency control
Transaction concurrency control
 
Transactions (Distributed computing)
Transactions (Distributed computing)Transactions (Distributed computing)
Transactions (Distributed computing)
 
4. concurrency control
4. concurrency control4. concurrency control
4. concurrency control
 
Svetlin Nakov - Database Transactions
Svetlin Nakov - Database TransactionsSvetlin Nakov - Database Transactions
Svetlin Nakov - Database Transactions
 
Transactions and Concurrency Control
Transactions and Concurrency ControlTransactions and Concurrency Control
Transactions and 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
 
Dbms sixth chapter_part-1_2011
Dbms sixth chapter_part-1_2011Dbms sixth chapter_part-1_2011
Dbms sixth chapter_part-1_2011
 
Dbms ii mca-ch9-transaction-processing-2013
Dbms ii mca-ch9-transaction-processing-2013Dbms ii mca-ch9-transaction-processing-2013
Dbms ii mca-ch9-transaction-processing-2013
 
Introduction to database-Transaction Concurrency and Recovery
Introduction to database-Transaction Concurrency and RecoveryIntroduction to database-Transaction Concurrency and Recovery
Introduction to database-Transaction Concurrency and Recovery
 
Databases: Locking Methods
Databases: Locking MethodsDatabases: Locking Methods
Databases: Locking Methods
 
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neeti
 
Concurrency control
Concurrency control Concurrency control
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)
 
Database management system chapter16
Database management system chapter16Database management system chapter16
Database management system chapter16
 
Validation based protocol
Validation based protocolValidation based protocol
Validation based protocol
 
2 phase locking protocol DBMS
2 phase locking protocol DBMS2 phase locking protocol DBMS
2 phase locking protocol DBMS
 

Destaque

16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMSkoolkampus
 
DBMS-chap 2-Concurrency Control
DBMS-chap 2-Concurrency ControlDBMS-chap 2-Concurrency Control
DBMS-chap 2-Concurrency ControlMukesh Tekwani
 
Transaction & Concurrency Control
Transaction & Concurrency ControlTransaction & Concurrency Control
Transaction & Concurrency ControlRavimuthurajan
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMSkoolkampus
 
Concurrency control in DDBMS
Concurrency control in DDBMSConcurrency control in DDBMS
Concurrency control in DDBMSAqsa Saeed
 
Kushal Data Warehousing PPT
Kushal Data Warehousing PPTKushal Data Warehousing PPT
Kushal Data Warehousing PPTKushal Singh
 
Query decomposition in data base
Query decomposition in data baseQuery decomposition in data base
Query decomposition in data baseSalman Memon
 
8 query processing and optimization
8 query processing and optimization8 query processing and optimization
8 query processing and optimizationKumar
 
Warehouse components
Warehouse componentsWarehouse components
Warehouse componentsganblues
 
Query processing-and-optimization
Query processing-and-optimizationQuery processing-and-optimization
Query processing-and-optimizationWBUTTUTORIALS
 
Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...
Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...
Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...Beat Signer
 
14. Query Optimization in DBMS
14. Query Optimization in DBMS14. Query Optimization in DBMS
14. Query Optimization in DBMSkoolkampus
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMSkoolkampus
 

Destaque (20)

16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
 
DBMS-chap 2-Concurrency Control
DBMS-chap 2-Concurrency ControlDBMS-chap 2-Concurrency Control
DBMS-chap 2-Concurrency Control
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Concurrency Control.
Concurrency Control.Concurrency Control.
Concurrency Control.
 
Transaction & Concurrency Control
Transaction & Concurrency ControlTransaction & Concurrency Control
Transaction & Concurrency Control
 
Html graphics
Html graphicsHtml graphics
Html graphics
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMS
 
Concurrency control in DDBMS
Concurrency control in DDBMSConcurrency control in DDBMS
Concurrency control in DDBMS
 
Java chapter 3
Java   chapter 3Java   chapter 3
Java chapter 3
 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5
 
Kushal Data Warehousing PPT
Kushal Data Warehousing PPTKushal Data Warehousing PPT
Kushal Data Warehousing PPT
 
Java 1-contd
Java 1-contdJava 1-contd
Java 1-contd
 
Query decomposition in data base
Query decomposition in data baseQuery decomposition in data base
Query decomposition in data base
 
8 query processing and optimization
8 query processing and optimization8 query processing and optimization
8 query processing and optimization
 
Warehouse components
Warehouse componentsWarehouse components
Warehouse components
 
Query processing-and-optimization
Query processing-and-optimizationQuery processing-and-optimization
Query processing-and-optimization
 
CS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMSCS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMS
 
Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...
Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...
Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...
 
14. Query Optimization in DBMS
14. Query Optimization in DBMS14. Query Optimization in DBMS
14. Query Optimization in DBMS
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMS
 

Semelhante a Concurrency control

Transaction management
Transaction managementTransaction management
Transaction managementArchanaMani2
 
Presentation on Transaction
Presentation on TransactionPresentation on Transaction
Presentation on TransactionRahul Prajapati
 
Concurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptxConcurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptxMArshad35
 
DBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docx
DBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docxDBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docx
DBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docxrandyburney60861
 
On deferred constraints in distributed database systems
On deferred constraints in distributed database systemsOn deferred constraints in distributed database systems
On deferred constraints in distributed database systemsijma
 
Acid Properties In Database Management System
Acid Properties In Database Management SystemAcid Properties In Database Management System
Acid Properties In Database Management SystemAshish Kumar
 
Overview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed DatabasesOverview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed DatabasesMeghaj Mallick
 
Presentation transaction
Presentation transactionPresentation transaction
Presentation transactionAfzaal Sahil
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbmsNancy Gulati
 

Semelhante a Concurrency control (20)

chp13.pdf
chp13.pdfchp13.pdf
chp13.pdf
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Dbms voc 5 unit
Dbms voc 5 unitDbms voc 5 unit
Dbms voc 5 unit
 
Transaction management
Transaction managementTransaction management
Transaction management
 
Presentation on Transaction
Presentation on TransactionPresentation on Transaction
Presentation on Transaction
 
Ho20
Ho20Ho20
Ho20
 
Concurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptxConcurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptx
 
Chapter 4 u
Chapter 4 uChapter 4 u
Chapter 4 u
 
DBMS UNIT 4
DBMS UNIT 4DBMS UNIT 4
DBMS UNIT 4
 
DBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docx
DBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docxDBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docx
DBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docx
 
On deferred constraints in distributed database systems
On deferred constraints in distributed database systemsOn deferred constraints in distributed database systems
On deferred constraints in distributed database systems
 
Acid Properties In Database Management System
Acid Properties In Database Management SystemAcid Properties In Database Management System
Acid Properties In Database Management System
 
Sql server concurrency
Sql server concurrencySql server concurrency
Sql server concurrency
 
Overview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed DatabasesOverview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed Databases
 
Vani dbms
Vani dbmsVani dbms
Vani dbms
 
Presentation transaction
Presentation transactionPresentation transaction
Presentation transaction
 
Database
DatabaseDatabase
Database
 
Process coordination
Process coordinationProcess coordination
Process coordination
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbms
 
24904 lecture11
24904 lecture1124904 lecture11
24904 lecture11
 

Último

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Último (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

Concurrency control

  • 1. Concurrency control From Wikipedia, the free encyclopedia Jump to: navigation, search In computer science, especially in the fields of computer programming (see also concurrent programming, parallel programming), operating systems (see also parallel computing), multiprocessors, and databases, concurrency control ensures that correct results for concurrent operations are generated, while getting those results as quickly as possible. Computer systems, both software and hardware, consist of modules, or components. Each component is designed to operate correctly, i.e., to obey to or meet certain consistency rules. When components that operate concurrently interact by messaging or by sharing accessed data (in memory or storage), a certain component's consistency may be violated by another component. The general area of concurrency control provides rules, methods, design methodologies, and theories to maintain the consistency of components operating concurrently while interacting, and thus the consistency and correctness of the whole system. Introducing concurrency control into a system means applying operation constraints which typically result in some performance reduction. Operation consistency and correctness should be achieved while still maintaining reasonable operation efficiency. Contents [hide] • 1 Concurrency control in databases o 1.1 Transaction ACID rules o 1.2 Why is concurrency control needed? o 1.3 Concurrency control mechanisms o 1.4 See also o 1.5 References • 2 Concurrency control in operating systems o 2.1 See also o 2.2 References [edit] Concurrency control in databases Concurrency control in Database management systems (DBMS; Bernstein et al. 1987, Weikum and Vossen 2001), other transactional objects, and related distributed applications (e.g., Grid computing and Cloud computing) ensures that database transactions are performed concurrently without violating the data integrity of the
  • 2. respective databases. Thus concurrency control is an essential element for correctness in any system where two database transactions or more can access the same data concurrently, e.g., virtually in any general-purpose database system. A well established concurrency control theory exists for database systems: serializability theory, which allows to effectively design and analyze concurrency control methods and mechanisms. To ensure correctness, A DBMS usually guarantees that only serializable transaction schedules are generated, unless serializability is intentionally relaxed. For maintaining correctness in cases of failed (aborted) transactions (which can always happen for many reasons) schedules also need to have the recoverability property. A DBMS also guarantees that no effect of committed transactions is lost, and no effect of aborted (rolled back) transactions remains in the related database. Overall transaction characterization is usually summarized by the following ACID rules: [edit] Transaction ACID rules Main article: ACID Every database transaction must obey the following rules: • Atomicity - Either the effects of all or none of its operations remain when a transaction is completed (committed or aborted respectively). In other words, to the outside world a committed transaction appears to be indivisible, atomic. A transaction is an indivisible unit of work that is either performed in its entirety or not performed at all ("all or nothing" semantics). • Consistency - Every transaction must leave the database in a consistent state, i.e., maintain the predetermined integrity rules of the database (constraints upon and among the database's objects). A transaction must transform a database from one consistent state to another consistent state. • Isolation - Transactions cannot interfere with each other. Moreover, an incomplete transaction is not visible to another transaction. Providing isolation is the main goal of concurrency control. • Durability - Effects of successful (committed) transactions must persist through crashes. [edit] Why is concurrency control needed? If transactions are executed serially, i.e., sequentially with no overlap in time, no transaction concurrency exists. However, if concurrent transactions with interleaving operations are allowed in an uncontrolled manner, some unexpected result may occur. Here are some typical examples: 1. Lost update problem: A second transaction writes a second value of a data-item (datum) on top of a first value written by a first concurrent transaction, and the first value is lost to other transactions running concurrently which need, by their
  • 3. precedence, to read the first value. The transactions that have read the wrong value end with incorrect results. 2. The dirty read problem: Transactions read a value written by a transaction that has been later aborted. This value disappears from the database upon abort, and should not have been read by any transaction ("dirty read"). The reading transactions end with incorrect results. 3. The incorrect summary problem: While one transaction takes a summary over values of a repeated data-item, a second transaction updated some instances of that data-item. The resulting summary does not reflect a correct result for any (usually needed for correctness) precedence order between the two transactions (if one is executed before the other), but rather some random result, depending on the timing of the updates, and whether a certain update result has been included in the summary or not. [edit] Concurrency control mechanisms The main categories of concurrency control mechanisms are: • Optimistic - Delay the checking of whether a transaction meets the isolation and other integrity rules (e.g., serializability and recoverability) until its end, without blocking any of its (read, write) operations, and then abort a transaction if the desired rules are violated. • Pessimistic - Block an operation of a transaction if it may cause violation of the rules until the possibility of violation disappears. • Semi-optimistic - Block operations in some situations, if they may cause violation of some rules, and do not block in other situations while delaying rules checking to transaction's end, as done with optimistic. Many methods for concurrency control exist. Most of them can be implemented within either main category above. Major methods, which have each many variants, and in some cases may overlap or be combined, include: • Two phase locking (2PL) • Serialization (or Serializability, or Conflict, or Precedence) graph checking • Timestamp ordering (TO) • Commitment ordering (or Commit ordering; CO) • Multiversion concurrency control (MVCC) • Index concurrency control (for synchronizing access operations to indexes, rather than to user data) A common major goal of concurrency control is generating schedules with the Serializability property. Serializability of a schedule means equivalence to some serial schedule with the same transactions (i.e., in which transactions are sequential with no overlap in time). Serializability is considered the highest level of isolation between database transactions, and the major correctness criterion for concurrent transactions. In
  • 4. some cases relaxed forms of serializability are allowed for better performance, if application's correctness is not violated by the relaxation. Almost all implemented concurrency control mechanisms achieve serializability by providing Conflict serializablity, a broad special case of serializability which can be implemented effectively. Concurrency control also ensures the Recoverability property for maintaining correctness in cases of aborted transactions (which can always happen for many reasons). Recoverability means that committed transactions have not read data written by aborted transactions. None of the mechanisms above provides recoverability in its general form, and special considerations and mechanism enhancements are needed to support recoverability. A commonly utilized special case of recoverability is Strictness, which allows efficient database recovery from failure, but excludes optimistic implementations (the term "semi-optimistic" appeared for the first time in conjunction with Strict CO (SCO)). As database systems become distributed, or cooperate in distributed environments (e.g., in Grid computing and Cloud computing), a need exists for distributed concurrency control mechanisms. Achieving Distributed serializability and Global serializability effectively poses special challenges typically not met by most local serializability mechanisms (especially due to a need in costly distribution of concurrency control information). The Commitment ordering (CO; Raz 1992) technique provides a general effective solution for both distributed and global serializability, also in a heterogeneous environment with different concurrency control mechanisms.