In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
I would like to share with you what the problems may be caused by the concurrent operation of the database. I believe most people don't know much about it, so share this article for your reference. I hope you will gain a lot after reading this article. let's learn about it!
What is database concurrent operation
The database is a shared resource that can be used by multiple users. These user programs can be executed one by one serially, and only one user program runs at a time to access the database. Other user programs must wait until the end of the user program to access the database. However, if a user program involves the input / output exchange of a large amount of data, the database system is idle most of the time. Therefore, in order to make full use of database resources and give full play to the characteristics of database sharing resources, multiple users should be allowed to access the database in parallel. However, this will result in multiple user programs accessing the same data concurrently. If there is no control over the concurrent operation, incorrect data may be accessed and stored, and the consistency of the database will be destroyed. Therefore, the database management system must provide concurrency control mechanism. The concurrency control mechanism is one of the important indicators to measure the performance of a database management system.
Problems caused by database concurrent operation
(1) lost updates
When two or more things are read into the same data and modified, the problem of missing updates will occur, that is, the result of the update of the latter will be overwritten by the previous transaction, that is, when transaction An and B colleagues proceed, transaction A has changed the data but has not committed it, B has modified the same data (note that at this time the data is the data that A has not yet committed), then the data changes made by A will be lost.
(2) non-repeatable
When two data reads a certain data, another transaction performs an update to the data. When the current transaction reads the data again (hoping to have the same value as the first read), the data obtained is different from the previous one. This is because transaction B modified the data after reading the data for the first time, so that the data read again is different from the data read for the first time.
(3) read 'dirty data'
When one transaction modifies a certain data, another transaction reads the data, and for some reason, the previous transaction undoes the modification of the modified data, and the modified data is restored to the original value, then the data read by the latter transaction is inconsistent with the data, which is called reading dirty data.
Note: there is also a ghost data called "Ghost data" that is similar to dirty data, except that ghost data refers to the data read after the transaction is committed, but the previous transaction is restored after reading. Dirty data refers to data that is not read before it is committed.
The above is all the contents of the article "what are the problems that may be caused by the concurrent operation of the database?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.