In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Replace transactions with table locking
The COMMIT (commit) and ROLLBACK (rollback) commands are not supported in MySQL's MyISAM type data table. When the user performs insert, delete, update and other operations on the database, the changed data is immediately saved on disk. In this way, in a multi-user environment, it will lead to many problems, in order to avoid multiple users operating on the specified table in the database at the same time. Table locking can be applied to avoid interference during user manipulation of the data table. Other users can access these modified data tables only when and only when the user releases the operation lock on the table.
Application of table lock to realize pseudo transaction
The general steps for implementing a pseudo transaction are as follows:
Lock the data tables in the database, and you can lock multiple tables in different ways
Perform database operations, add, delete, modify and other operations to the locked data table
Release the locked data table so that other users waiting in the queue for viewing or operation can browse the data in the data table or perform various data operations on the operation table.
Transactions and performanc
The application of transactions with different isolated levels may have a series of effects on the system, and the use of different isolated levels to deal with transactions may affect many factors such as system stability and security. In addition, in some database operations, there is no need to apply transaction processing, so users need to select the appropriate data table type when selecting the data table type. Therefore, when selecting the table type, we should consider that the data table has perfect function, and under the premise of efficient execution, it will not add additional burden to the system.
Apply small transactions
The significance of applying small transactions is to ensure that each transaction will not wait a long time before execution, so as to avoid the significant degradation of system performance caused by each transaction waiting for each other.
Choose the appropriate isolation level
Because the performance of the transaction is inversely proportional to the load it produces on the server, that is, the higher the transaction isolation level, the lower the performance, but the higher the security.
The concept of deadlock
Deadlock, that is, when two or more users in different sequences intend to update the same database at the same time, both parties have been waiting because they are waiting for each other to release permissions.
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.