what is meant by the concurrent execution of database transactions in a multiuser system? why concurrency control is needed?
I'm having trouble with this. and what are some informal examples for concurrency control. any help would be greatly appreciated.
Concurrent execution reduces the unpredictable delays in running transactions. Moreover, it also reduces the average response time: the average time for a transaction to be completed after it has been submitted.
Multi-User databases need to control the order in which data are read and updated by multiple users. Concurrency Control provides a mechanism to ensure that the work of multiple users do not interfere and potentially corrupt the data in the database.
It enable to run multiple applications at the same time. It enables that the resources that are unused by one application can be used for other applications. Without concurrency, each application has to be run to completion before the next one can be run. It enables the better performance by the operating system.
In a database management system (DBMS), concurrency control manages simultaneous access to a database. It prevents two users from editing the same record at the same time and also serializes transactions for backup and recovery.
Concurrent execution of database transactions in a multi-user system means that any number of users can use the same database at the same time. Concurrency control is needed in order to avoid inconsistencies in the database.
Here is an example of how this scenario can lead to an inconsistency:
Assume we have two users, Alice and Bob, who both have access to the same bank account. Alice wants to deposit $100 and Bob wants to withdraw $200. Assuming there is $500 in the account, here is how the execution might take place if they perform their actions at the same time:
New balance after both actions should be $400. Now the database is in an inconsistent state.
Concurrency control can prevent inconsistencies by providing Alice with a temporary "lock" on the database until she is done with her action.
Well, it is as simple as this... Say you have a bank, and simultaneously two persons try to withdraw €100 from an account with €100 on it. These are concurrent operations.
You need to make sure that only one of them manage to withdraw 100€. This is concurrency handling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With