Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does couchbase 3.0 support transaction?

Tags:

couchbase

  • couchbase config

host: ip:127.0.0.1 port:17000

buckets: Bucket1 Bucket2 Bucket3

I want to set 3 buckets {set(Bucket1), set(Bucket2), set(Bucket3)} as a transaction.

How should I do to implement?

like image 953
Mudingxi Chanshi Avatar asked Dec 15 '22 16:12

Mudingxi Chanshi


1 Answers

The short answer is 'no'. Couchbase does not support transactions across different documents. As theMayer mentioned, you might avoid the need for transactions by modelling your data differently. However, if you must have it, you can use two phase commit to get part of the transaction functionality (the atomicity and durability, but not isolation or consistency.)

You can read up on 2PC in general here: http://en.wikipedia.org/wiki/Two-phase_commit_protocol and specifically as it relates to Couchbase here: http://docs.couchbase.com/couchbase-devguide-2.5/#performing-two-phase-commits

like image 131
David Ostrovsky Avatar answered Feb 15 '23 12:02

David Ostrovsky