Explain use of transactions in NoSQL

Technology CommunityCategory: NoSQLExplain use of transactions in NoSQL
VietMX Staff asked 3 years ago

NoSQL covers a diverse set of tools and services, including key-value-, document, graph and wide-column stores. They usually try improving scalability of the data store, usually by distributing data processing. Transactions require ACID properties of how DBs perform user operations. ACID restricts how scalability can be improved: most of the NoSQL tools relax consistency criteria of the operatioins to get fault-tolerance and availability for scaling, which makes implementing ACID transactions very hard.

A commonly cited theoretical reasoning of distributed data stores is the CAP theorem: consistency, availability and partition tolerance cannot be achieved at the same time.

A new, weaker set of requirements replacing ACID is BASE (“basically avalilable, soft state, eventual consistency”). However, eventually consistent tools (“eventually all accesses to an item will return the last updated value”) are hardly acceptable in transactional applications like banking.

Generally speaking, NoSQL solutions have lighter weight transactional semantics than relational databases, but still have facilities for atomic operations at some level. Generally, the ones which do master-master replication provide less in the way of consistency, and more availability. So one should choose the right tool for the right problem.

Many offer transactions at the single document (or row etc.) level. For example with MongoDB there is atomicity at the single document – but documents can be fairly rich so this usually works.