In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "what does ACID in SQL refer to". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The central idea of WAL is that changes to data files (which are carriers of tables and indexes) must occur only after these changes have been logged, that is, after the log records have been washed to permanent storage.
If we follow this process, then we don't need to flush the data page to disk every time the transaction commits, because we know that in the event of a crash
We can restore the database with logs: any records that have not been attached to the data page will first be redone from the log record (this is called forward scroll restore, also known as REDO) and then the changes made by those uncommitted transactions will be removed from the data page (this is called backward scroll recovery-UNDO).
1. Consistency:
A transaction can encapsulate a state change (unless it is read-only).
Transactions must always keep the system in a consistent state, regardless of the number of concurrent transactions at any given time.
That is to say, if multiple transactions are concurrent, the system must also operate like serial transactions.
Its main feature is protective and immutable (PreservinganInvariant). Take the transfer case as an example, suppose there are five accounts, each account balance is 100yuan, then the total amount of the five accounts is 500yuan.
If multiple transfers occur between these five accounts at the same time, no matter how many are concurrent, for example, 5 yuan between An and B accounts, 10 yuan between C and D accounts, and 15 yuan between B and E, the total amount of the five accounts should still be 500 yuan, which is protective and invariable.
2. Atomicity:
All the operations in the whole transaction are either completed or not completed, and it is impossible to stagnate in the middle.
An error occurs during the execution of a transaction and is Rollback back to its state before the transaction starts, as if the transaction had never been executed.
3. Persistence
After the transaction commits, the changes made by the transaction to the database are persisted in the database, saved permanently, and will not be rolled back.
4. Isolation
Transactions are executed in an isolated state so that they appear to be the only operations performed by the system at a given time.
If there are two transactions that run at the same time and perform the same function, the isolation of the transaction ensures that each transaction is thought to be the only transaction in the system that is using the system.
This attribute is sometimes called serialization, and to prevent confusion between transaction operations, requests must be serialized or serialized so that only one request is used for the same data at a time.
Description
Because an operation usually contains many sub-operations, and these sub-operations may cause problems due to hardware damage or other factors, it is not easy to implement ACID correctly.
ACID recommends that the database operate all the data that needs to be updated and modified at once, but it is not feasible in practice.
At present, there are two main ways to implement ACID: the first is Writeaheadlogging, that is, the journal approach (modern databases are based on this). The second is Shadowpaging.
Compared with WAL (writeaheadlogging) technology, shadowpaging technology is relatively simple to implement, eliminates the overhead of writing log records, and the recovery speed is fast (no redo and undo are needed).
This is the end of the content of "what does ACID in SQL refer to". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.