Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Membase | Memcached Server 1.0.3

Connect Directly with Servers from Bucket List

3 replies [Last post]
  • Login or register to post comments
Mon, 07/12/2010 - 10:17
BobSnopes
Offline
Joined: 07/12/2010
Groups: None

Hi. I'm working on a PHP application and was curious about implementing smart client-like capabilities. I was going to have it do a GET on the bucket to acquire the list of nodes, so as to get the performance gain, but was unsure of if the hashing mechanism used by the PHP client would be able to select the correct server to get/set the key, as the proxy would if performing the same request. If I set the PHP client to use consistent hashing, query for the list of nodes that a bucket uses, and then feed those into the PHP client to direct connect to (not proxy), can I be sure that it's distributed the same way as if I used the proxy connection of any single server? Thanks.

Top
Mon, 07/12/2010 - 10:30
ingenthr
Offline
Joined: 03/16/2010
Groups:

Excellent news! It'd be awesome to have a PHP smart client.

Yes, you should see all of the items on the same nodes if both are using consistent hashing. For the most part, the clients are very consistent about consistent hashing. The proxy port does use consistent hashing.

With the Java smart client, we did a fair amount of testing to be sure it, libmemcached and the proxy implementation consistently hash the same way with consistent hashing, and they do. I'd recommend some similar testing just to be sure your PHP client is doing the same thing.

By the way, which client is it?

Top
Mon, 07/12/2010 - 10:42
BobSnopes
Offline
Joined: 07/12/2010
Groups: None

Hah, oh no, I'm not writing a full smart client. Just the portion to query for nodes and pass them into the pecl/memcache (not, memcached). Although, when I get free time I'd like to extend pecl/memcached (with the d this time!) to have full smart client capabilities after taking a complete look at spymemcached. Thanks for your quick response though, it's exactly what I was wondering. I figured they all used the same basic libketama implementation, but wanted to be sure.

Top
Mon, 07/12/2010 - 10:52
ingenthr
Offline
Joined: 03/16/2010
Groups:

Well, some years ago there was some question on the memcached mailing list wondering if spymemcached actually did the same thing as libketama. In that case, Richard Jones (from last.fm) popped up and said they were using spymemcached's implementation, so that seemed to clarify things. :)

The testing was more of a trust-but-verify situation.

If you have any other questions on how the smart client works or is intended to work, please let us know. Note that the developer kit includes a lot of documentation on the REST interface. Also, moxi now has libcurl and enough smarts to be a smart client, so there is some BSD licensed code you may be able to use for your pecl/memcached project. It's more for NorthScale Server+membase than NorthScale Server+memcached, but the REST interface is the same.

When you get this smarter pecl/memcache client going, if you're willing, it'd be great to share a blog posting or something like that with the details. Thanks!

Top
  • 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