Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Membase | Membase Server 1.7.x

Does membase support atomic operations on a single data entry?

1 reply [Last post]
  • Login or register to post comments
Thu, 06/16/2011 - 02:29
minimedj
Offline
Joined: 06/15/2011
Groups: None

Does membase support atomic operations on a single data entry?

Top
  • Login or register to post comments
Thu, 06/16/2011 - 16:27
perry
Offline
Joined: 10/11/2010
Groups:

Absolutely. In fact, all operations are atomic on a single item at the server level.

What you need to be careful of is the "read/modify/write" cycle of an application. If two processes/threads try to do that procedure on the same item, one will overwrite the other. This is why there is the "CAS" operation which stands for "check and set". When you do a "get" on an item, you can optionally get back a CAS id. When performing a "set" on the same item, you supply the CAS id and the operation will fail if the item has a different CAS id (i.e., has been modified). Then the application can decide whether they want to just move on or re-do the "read/modify/write".

As far as the other operations go (incr, decr, append, prepend) they are always atomic and can be used to relieve some of the concurrency concerns with CAS.

In the ASCII protocol, CAS is only available as a "set" command, but the binary protocol supports CAS on all operations so for instance you could use it with "replace" (doesn't make much sense for "add").

Hope that helps, otherwise I can certainly point you at more documentation.

Perry

__________________

Forum support is great for free but sometimes you need a guaranteed response time and dedicated resources for your questions or issues.
Consider purchasing enterprise-level support from Couchbase: http://www.couchbase.com/products-and-services/overview
Call or email "sales -at- couchbase-dot- com" today!

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker