Stupid Question 109: In computer science, what do we mean by ACID?
Ah yes, transactions. I really don’t mind those ;)
The last few weeks I’ve enjoyed the quirks and surprises by stepping outside my comfort zone and embark on a no .Net what-so-ever project. The project is a node.js project, with express, nano, kendoUI, knockout and of course CouchDB (and whole lot of micro frameworks). Needless to say there has been quite a few discussions. I’ve tried out MongoDB, just a playdate project- and the way I understood it is not truly ACID compliant. Although just a proof of concept app, I wanted to know if CouchDB offered ACID transactions when we decided to use it for storing data. I asked around, and actually found myself having to explain what ACID means. So what do we men by ACID? (And there are alternatives, but that is a different question)
The four letters stand for four properties that we need to guarantee that a transaction in a database is reliable. A transaction is an operation, such as a money transfer- and does not have to be limited to just one account.
Let’s have a look at the words
A – Atomic
All or nothing, either everything gets done or nothing happens. It’s all one unit of work.It’s all or nothing baby.
C – Consistency
All data has to pass through the set of rules defined and be consistent from a valid state to another. Either data is committed or rolled back.Consistency is key!
I – Isolation
Each transaction should be independent of another one, they should be executed in total isolation. Do your thing- and do it on your own.
D - Durability
It’s a forever thing. Once a transaction is done,- it should remain there and the data should not be affected in case of system failure.
As for CouchDB, it does seem like it is ACID compliant. I will have to look at it in details, we don’t really need it for our application, but it just got me curious so why not find out.
Last modified on 2012-12-21