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

Memcached & Membase

1 reply [Last post]
  • Login or register to post comments
Mon, 04/11/2011 - 04:19
membaseuser_dk
Offline
Joined: 01/13/2011
Groups: None

Hi

I think this is a dump question but here goes.

If you read about how to use Memcached it is often like this:

//write query
$sql = "select * from somewhere where something=something";
//create an index key for memcache
$key = md5('query'.$sql);
//lookup value in memcache
$result = $memcache->get($key);
//check if we got something back
if($result == null) {
//fetch from database
$result_sql = mysql_query($sql) or die(mysql_error()." : $sql");
if(mysql_num_rows($result_sql)> 0) {
$result = mysql_fetch_object($result_sql);
//store in memcache
$memcache->set($key,$result,0,$ttl);
}
}
$content = $result->content;

... but if Memcached is used with Membase this check is done transparently right? (If in Cache go get otherwise get from Membase and store in Cache).

Top
  • Login or register to post comments
Mon, 04/11/2011 - 14:31
perry
Offline
Joined: 10/11/2010
Groups:

I "think" you're on the right page.

Membase has it's own persistence layer underneath a memcached interface. If a request comes in for data that is not in RAM but is stored on the disk, Membase will bring it up from disk and put it in the cache.

However, if you're migrating from sql, or using sql as another backend store, Membase has no connection to that.

Make sense?

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