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

Waiting for Persistence

1 reply [Last post]
  • Login or register to post comments
Mon, 11/07/2011 - 06:29
masaq
Offline
Joined: 11/07/2011
Groups: None

Hi.

I'm new to Membase and am evaluating it along with other datastores.

My project is a game that in places requires complex player to player interaction (for example trading of items and currency), and for these operations I would like to know with certainty that they have taken place in case I need to roll them back for whatever reason.

Looking at 1.7 I see the 'sync' command has been added but at the moment this guarantees that the data has been persisted to another node, rather than to disk.

Would it be possible to get the behaviour I require by setting my values with an expiry date in the past, and then immediately getting the data? The idea being that on the read the cache is invalid and requires a disk read, meaning I can tell if the set has persisted to disk.

Failing that, is there a way to tell if a value has been written to disk? It's ok for me to keep the data hanging around in the game server until it can get confirmation of the write.

Thanks for reading.

Top
  • Login or register to post comments
Fri, 11/11/2011 - 16:40
ingenthr
Offline
Joined: 03/16/2010
Groups:

There is not currently a way to be sure if a value has been written to disk. The protocol for SYNC and much of the internal implementation supports it, but it is an experimental feature only for now, owing to testing. We'll have some good updates on this soon.

Even then, you'd have to disable replication to be able to reliably rely on once to memory and once to disk. During a failover scenario, you're going to an alternate server which may have it in memory and disk.

Which client are you using? There is an operation called GETL, where multiple items are locked when fetched, so a client can know that no one else can access them until a CAS unlock. You have to handle a few complex failure scenarios if you need everything to always reconcile, but it's possible from a client.

Doing these kind of distributed transactions are actually common, and can be implemented, but require some care. For instance, this makes me think of these two things:
http://guide.couchdb.org/editions/1/en/recipes.html#banking
http://dustin.github.com/2011/02/17/memcached-set.html

... though neither of them exactly fit what you're asking about. Hope they help with the thoughts though.

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