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

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Último (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

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.