ACID
-
Atomicity,
Consistency,
Isolation,
Durability
Atomicity (Better term would be abortability)
-
Atomic means something that cannot be broken down into smaller parts.
Atomic means When Application is writing to DB and some fault
occurs(process crash, LAN cable loose, Disk full) then user will not see
DB in inconsistent state.
How atomicity is achieved in DB using Transactions
ie If the writes are grouped together into an atomic transaction, and the transaction cannot be completed (committed) due to a fault, then the transaction is aborted and the database must discard or undo any writes it has made so far in that transaction
Consistency
node-1 ------\
client
node-2 -----/
Client will get(same, latest data) to whatever node they connect to in
system. OR Every read operation will recieve most recent Write (or
error). Consistency Problem? With mutiple databases doing sync(master slave etc), client should be returned accurate and most recent information. Solution: Consensus Algorithm
Durability
-
Once Transaction has been committed
successfully(ie data is written to DB), then that data will not be
forgotten, even in case of hardware fault/ database crashes
How to achieve Durability?
On Single node system: Using SSD or Hard-disks.
On multinode: Using Replication, data is copied to other nodes