In another chapter of this guide, "Structuring Data"Chapter 2, Modeling Documents, we discuss much more in depth the advantages you gain when you use JSON documents with Couchbase Server; we also discuss when you might want to use more than one document to represent an object. Here we want to discuss how to perform operations on data across one or more documents while providing some reliability and consistency. In traditional relational database systems, this is the concept of database concept of ACIDity:
Atomicity means that if a transaction fails, all changes to related records fail and the data is left unchanged,
Consistency means data must be valid according to defined rules, for instance you cannot delete a blog post without also deleting all of the related comments,
Isolation means that concurrent transactions would create the same data as if that transactions were executed sequentially,
Durability means that once the transaction completes, the data changes survive system failure.
Relational databases will typically rely on locking or versioning data to provide ACID capabilities. Locking means the database marks data so that no other transactions modify it until the first transaction succeeds; versioning means the database provides a version of the data that existed before one process started a process.
NoSQL databases generally do not support transactions in the traditional way used by relational databases. Yet there are many situations where you might want to use Couchbase Server to build an application with transactional logic. With Couchbase Server you can generally improve the reliability, consistency, and isolation of related commits by 1) providing 'leases' on information, which reserves the document for use by a single process, or 2) by performing two-phase commits on multiple documents.