Showing posts with label Durablilty. Show all posts
Showing posts with label Durablilty. Show all posts

Thursday, 14 June 2012

Durability in Database

I have talked about about the three properties (Atomicity, Consistency and Isolation) in my previous posts. In this post, we'll cover the last but very important property i.e. Durability. Well, It's important because it saves the world from situation like THIS. Now let's see why and how.

 As said in earlier post Durability ensures that any transaction committed on the database is not lost in case of events like error, power crash, etc. Probably, the concepts is relatively easy to understand compared to it's importance.

Think of a hypothetical situation where a bank's database table stores the numerous transactions related to the accounts of its users. What happens now is a power crash, system failure, or anything like these one would prefer not to happen. And result: Data loss i.e. loss (partial/full) of the records storing the transaction details of all the accounts of bank. So it should result into one of two situations for user (first and second) depending on the his/her credit/debit situation.

Now, think: such database issue, happening in other organizations specially those related to defense, tax, etc. So, it can concluded that this issue has be avoided. In other words the history of data operations/transaction needs to be saved from loss due to crashes, failures, etc. The database should be durable.

To maintain the durability of database, data restoration is done by using database backups and transaction logs. e.g. In case of Oracle, there are redo logs.

Monday, 11 June 2012

The ACIDic nature of a Database

Now, this concept is not specific to relational database, but it must be known as it's a basic principle applied practically on all kinds of databases. So, here we go. Let's discuss some ACIDic properties of a database.

Well just to have a clear start, we are not talking about stuff which somehow relates to "this".

The four letters of the word ACID denote the set of four properties.

[You can click on them to see more on each properties in my other posts.]
  • Atomicity It means that a database is said to be atomic if each transaction on the database follows  "all or none" rule.
  • Consistency It means that a database is consistent (in a valid state) before and after each transaction with respect to the rules and constraints applied on the database.
  • Isolation Any two or more transactions on a database are isolated from each other. i.e. they don't interfere with each other.
  • Durability This property ensures that any transaction committed on the database is not lost in case of events like error, power crash, etc.