Memcached & Membase
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).
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!