How to set a key-value pair in a specific instance?

3 views
Skip to first unread message

Jitendra

unread,
Dec 9, 2008, 12:06:51 AM12/9/08
to memcached
Hi All,

I would like to set a key-value pair to a specific instance of
memcached.
For my data I have a 10 instances of memcached running.
For better recovery in case of crash I would like to set specific key-
value pairs in a specific instance of memcached so that I can restart
and push those data to that instance.
I tried with memcached_set_by_key(), memcached_get_by_key() to set and
get the key-value, with the master key as (serverip+port no).
But it is not working as desired. I guess I am wrong somewhere.
Appreciate any suggestions on this issue.

Regards
Jitendra

Henrik Schröder

unread,
Dec 9, 2008, 6:56:13 AM12/9/08
to memc...@googlegroups.com
On Tue, Dec 9, 2008 at 06:06, Jitendra <jkn...@gmail.com> wrote:

But it is not working as desired. I guess I am wrong somewhere.


Yes, you are trying to use memcache as you would use a persistent storage. It is not, it's a cache, items you put in memcache might not be there when you want to retrieve them.


/Henrik

Jitendra

unread,
Dec 9, 2008, 7:20:30 AM12/9/08
to memcached
Hi Henrik,

Thanks a lot for your response.
One question please.
May I know what is the difference between the following APIs.
memcached_set(), memcached_set_by_key()
memcached_get(), memcached_get_by_key()
I guess both are functionally same, isn't it ?
Thanks in advance for any response.

Regards
Jitendra
Reply all
Reply to author
Forward
0 new messages