Atitit ACID Solutions 2PC ( two phase commit ) ACID assurance across multiple DB instances
1.1. ACID Solution 1
1.2. database vendors have long recognized the need for database partitioning and introduced a 2PC ( two phase commit ) to provide a technology that spans multiple DB instances. ACID Guaranteed . This agreement is divided into the following two stages : 1
1.3. Basically, the most critical technology for implementing ACID in a database is logs and locks. 2
1.4. I- the primary means of implementing transaction isolation is lock. Another key technique is the MVCC (multi-version Concurrency Control), which avoids locking in some scenarios, enabling simultaneous read and write. 2
1.5. At this point, the peak of ACID transaction processing is Oracle -approximately 500,000 TPS per node 3
1.1.
ACID Solutions
ACID Database transactions greatly simplifies the work of application developers . as shown in its abbreviated identity , ACID transactions provide the following guarantees :
· atomicity (atomicity) . all operations in a transaction , or the whole success . , or not all of it. .
· Consistency (consistency) . at the beginning and end of the transaction , database is in a consistent state .
· Isolation (Isolation) . The transaction is just like this one operation is performed by the database .
· Persistence (durability) . at the end of the transaction , This action will be irreversible . ( that is, if the transaction commits , the system will ensure that the data is not lost , even if the system Crash, Translator Supplement ).
1.2.
database vendors have long recognized the need for database partitioning , Two-phase commit ) Technology to provide acid Span style= "font-family:arial". This protocol is divided into the following two stages :
· In the first phase , the Transaction Coordinator requires that each database pre-commit (Precommit) that involves a transaction , and reflects whether it can be committed .
· in the second phase , the Transaction Coordinator requires each database to submit data .
Database The implementation of ACID
1.3.
Basically, the most critical technology for implementing ACID in a database is logs and locks.
A-database relies on the Redo/undo log to implement the atomicity of transactions.
in simple terms, The Redo log records the modified data after the transaction, and the Undo log records the raw data before the transaction. On recovery, the database first checks what stage the transaction is interrupted: If the transaction is interrupted in the commit phase, the Redo log is replayed, and if the interrupt is in the prepare phase, the Undo log is used for rollback.
Database with Check Point (Check-point) determines the recovery site for a transaction. Checkpoint Rep: The data that was submitted before this point was modified by the transaction has all been written back to disk. Therefore, the Redo/undo log can be processed from this location as soon as the last checkpoint is found after a database failure.
1.4.I -the primary means of implementing transaction isolation is lock. Another key technology is
MVCC(multi-version Concurrency Control), it can be in some scenarios to avoid locking, to achieve simultaneous read and write.
Different isolation levels do not have the same locking policy in the database:
Read Uncommitted -read does not need to lock, write only need to add a row of locks
VCC The scenario for transaction reads is optimized. The database holds multiple versions of the record, and other read-only transactions/non-transactional reads can access the previous version of the record directly when the update occurs, without waiting for the lock.
There is always a limit to the hardware performance of a single machine.
1.5.For Now,the pinnacle of ACID transaction processing is
Oracle--probably 500,000 TPS per node
. This figure is achieved on minicomputer and high-end storage devices -and a set of such devices is worth about $30,000,000.
。
ramble on Transactions and distributed transactions (2)- database ACID Implementation - push cool . html
author:: Nickname :Old Wow's claws( Full Name::AttilaxAkbar Al Rapanui Attilaksachanui)
Kanji Name: Etila ( Ayron) , email:[email protected]
reprint Please indicate source: http://www.cnblogs.com/attilax/
Atiend
Atitit acid Solution 2PC (two phase commit) acid assurance across multiple DB instances