There are two basic operations in a transaction.
- read (X): Transfers the data item X from the database to a variable.
- write (X): Transfers the value in the variable X in the main-memory buffer of the transaction that executes the write to the data item X in the database.
Example-1: Transfer an amount of Rupees 50 from Account-A to Account-B.
T1 : read A ;
A = A – 50 ;
write A ;
read B ;
B = B + 50 ;
write B ;
There are three types of storage.
- Volatile Storage: Information residing in volatile storage does not usually survive system crashes. Examples of such storage are main memory and cache memory.
- Non-Volatile Storage: System crashes do no serious harm to information kept in non-volatile storage. Examples of such storage are secondary storages.
- Stable Storage: Information that is present inside stable storage always retains and is never lost. Example of such storage is replicating the information in several non-volatile storages.