memcache or memcached? Which one to use?

Login or register to post comments
5 replies [Last post]
Offline
Joined: 10/11/2010

I have been thinking about getting memcached support integrated into this bloody (its red in color :P ) framework.

Now, as I go through the PHP documentation online, I find that there are two sets of memcached APIs. One is called memcache and the other is called memcached. When I search over the internet, I see people paraising 'memcache' for being a 'good nomenclature' (there is no 'd', indicating daemon in the end) and praising 'memcached' for good performance. Now, both have a few troubles with certain requests, which basically appears to be related with retrieving the word 'FALSE' being stored in as a value to some key (memcache is a KV store). Also, memcached is dependent on an external library named 'libmemcached' but performs well and it appears that the 'false' problem I mentioned above appears to have been taken care of in memcached.

So here is the scene:

1. memcache - good nomenclature, not-so-good performance, no extra dependencies, possible problems with 'FALSE'.

2. memcached - a little not-so-good nomenclature, better performance, libmemcached is the extra dependency, the 'FALSE' problem is apparently not there.

They both have the same APIs, with memcached supporting some more functions than memcache.

Since I plan to integrate memcached support into QCubed (planing to start working on it after 20th of Jan), I would want your words on which API to think about. Please give your opinions. Lead developers and people using the framework, both are invited. I just need to make sure that I do not make a bad decision with long term results.

Regards,
Vaibhav

Offline
Joined: 10/11/2010

Someone reply please.

Offline
Joined: 02/02/2010

I am working on a project with qcubed and memcache and it works fine there.

Looking add the php man pages the memcache api seems to be nearly a subset of the memcached api. It should not be that hard to change from memcache to memcached if something is not working the way you want.

Offline
Joined: 10/11/2010

Ok. Then I think I will go with memcache. But since I will start working on that after 20th of Jan only, more comments are welcome :)

Now, I am thinking to integrate memcached in a way so that one is able to make use of it without altering anything, so that the framework should take care of caching things. Since ORM mapping of tables is the difficult task here, I think memcached would help a lot.

I do not plan to make any functions which would fill memcached with arrays of objects but single objects only (that is what is needed mostly I guess and that is where the performance starts to suffer, in my belief), like in the app I am developing, there are pages which throw out requests on the database for single elements in a series (its an array and a foreach loop) to create controls. Memcached can help immensely in those places.

Regards,
Vaibhav

jmirancid's picture
Offline
Joined: 04/04/2011

I work before with memcache but i never heard about memecached.

As far as I know memcache comes with the normal Apache server distribution, and memecached is a third party API, rigth?

Offline
Joined: 10/11/2010

I do not understand what you mean by 'Apache Server Distribution'. I am talking about the two sets of memcached APIs available for PHP. The memcached API has more functions but I do not think we need them all straightaway.

http://php.net/manual/en/book.memcached.php

and

http://php.net/manual/en/book.memcache.php

Have a look and tell me :)