Take the 2-minute tour ×

NoSQL emphasizes availability over consistency. Sometimes, this would cause the data in your NoSQL datastore to become inconsistent.

1) What are strategies to recover from such a situation?

2) What are strategies to prevent such a situation if possible?

3) What are the specific strategies for the popular NoSQL vendors, such as MongoDB, CouchDB, Cassandra, and HBase?

share|improve this question

1 Answer 1

I think with asking point #3 you are mixing 2 different problems:

A. Database becomes unreadable i.e. its data files are corruputed and data is not accessible or partially accessible

B. Application data stored in NoSQL database becomes inconsistent (e.g. some key mistmatch happened) for application to use that and application starts to behave weirdly.

Problem A is a database maintainability issue and each database handles it in a specific way (e.g., MongoDB). And truly speaking it's not only NoSQL problem. But in general this kind of situation is rather an emergency and shouldn't happen if your database engine is solid and has good and enough hardware.

Problem B is poorly your application specific and I think the main strategy here is to make your application expect that data might be inconsistent at some point and try to work around that if possible. There can also be some background process that finds inconsistencies in data. In any case it purely depends on your data model.

EDIT: Updates on the data in NoSQL database are not transactional, but in general are atomic. So, if one tuple is updated by 2 different processes you will not get part of the tuple from one and another part from another, you will get the whole tuple from one of the processes which is considered "last" by the engine. But if your application updates several "dependent" tuples, then result for several updating threads is not predicatable, of course, because there is no transaction around those multiple updates. Unless, of course, all pocesses put same data into database. But if you have too many dependecies between different types of tuples/objects then I would say that your application is using NoSQL in a wrong way.

EDIT: There is also intresting discussion here.

share|improve this answer
Sorry when i meant corrupt, i meant by B, and not A. Data can become corrupt in any database, relational or non relational. In NoSQL databases, since transactions are not fully supported, it is possible two updates on the same data may "corrupt" the data. –  onejigtwojig Aug 3 '11 at 5:17

Your Answer


