My favorites | Sign in
Project Logo
                
Search
for
Updated Apr 16, 2009 by brianlmoon
PHPClientComparison  
Comparison of pecl/memcache and pecl/memcached

PHP Client Comparison

There are primarily two clients used with PHP. One is the older, more widespread pecl/memcache and the other is the newer, less used, more feature rich pecl/memcached.

Both support the basics such as multiple servers, setting vaules, getting values, increment, decrement and getting stats.

Here are some more advanced features and information.

pecl/memcache pecl/memcached
First Release Date 2004-06-08 2009-01-29 (beta)
Actively Developed? Yes Yes
External Dependency None libmemcached
Features
Automatic Key Fixup1 Yes No
Append/Prepend No Yes
Automatic Serialzation2 Yes Yes
Binary Protocol No Optional
CAS No Yes
Compression Yes Yes
Communication Timeout Connect Only Various Options
Consistent Hashing Yes Yes
Delayed Get No Yes
Multi-Get Yes Yes
Session Support Yes Yes
Set/Get to a specific server No Yes
Stores Numerics Converted to Strings Yes

  1. pecl/memcache will convert an invalid key into a valid key for you. pecl/memcached will return false when trying to set/get a key that is not valid.
  2. You do not have to serialize your objects or arrays before sending them to the set commands. Both clients will do this for you.

Comment by mike503, Apr 21, 2009

I would put in ability to set to multiple servers - I know pecl/memcache supports that. Basically like setting copies=2 in ZFS.

I would also like to see a link as to what the append/prepend is. If it is what I think it is, it's almost worth a switch for me immediately!

Comment by boxmonkey, Apr 21, 2009

Is connection pooling handled differently between the two? I know with pecl/memcache, connection pooling happens on a per-apache-instance basis. With pecl/memcached, is it the same, or does it happen at a different level?

Comment by anshulgupta04, Jun 15, 2009

Is there any failover mechnism in PECL/Memcached. What I want is if any server in my pools goes down, the client should get data from other servers (I m using repcached servers)

Comment by matthew.nelson, Oct 01, 2009

pecl/memcached does not support failover or persistent connections. This is quite annoying, since I'm sure the underlying libmemcached C library supports both.

pecl/memcache does not have the very handy getServerByKey() method, which is immensely useful when debugging.

Comment by nick.lemouton, Dec 03, 2009

Is pecl/memcache still being developed? There's been no new version since Feb 09 and the latest beta has a few show stopping bugs (the only version that works with the binary protocol).


Sign in to add a comment
Hosted by Google Code