views:

83

answers:

1

Hello,

This one could be a trivial 'yes or no' question but still could be helpfull. Could the C/C++ library libmemcached be used in a distributed file system ? I am asking this one because in all documentation on the net I came accross memcached was mostly assosciated with caching in web-service applications.

An example : Let there be servers A,B and client C. Client C connects to server A and asks to open a file F. If file F resides on server B , then server A caches that file and then serves it back to client C.

Should libmemcached library be used in the above situation ? Is there any alternative C framework proposal.

+1  A: 

Yes, but with severe limitations.

You'll only be able to cache blocks, not the entire file because memcached has an upper limit on what can be stored behind each key that is about 1MB. The other thing to consider is that you're taking a 1-2 ms for each block you want to assemble for the final file.

Your better off implementing your own in memory cache or finding an existing clustered filesystem like gluster.

Noah Campbell