Search:

Search all manuals
Search this manual
Manual
Couchbase Developer's Guide 1.8
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
6 Advanced Topics in Development
Chapter Sections
Chapters

6.3. Providing Transactional Logic

6.3.1. Using a 'Lease-Out' Pattern
6.3.2. Performing Two-Phase Commits
6.3.3. Getting and Locking

In another chapter of this guide, "Structuring Data"Chapter 5, Structuring Data, 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:

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.