tags:

views:

514

answers:

2

There is a limit of 1 meg for objects in memcached. Whats the best way to store objects larger than this?

I'm using the Enyim .Net client.

+2  A: 

I use memcached via the C API but the situation is essentially the same. You'd need to find a way to split the data up yourself and provide a way to generate a set of keys to access the parts based on your master key. You'll also probably need some kind of header stored in the first blob that can tell you if you are looking at a multi-part cache object.

I don't think there is anything out there that will do the heavy lifting here for you but then I'm doing this in C++ not .NET, perhaps someone has written a module already. Otherwise...I'd suggest there is a gap in the market :)

jkp
thanks for the idea. It's a collection of objects, so should be very straight forward to split up. cheers
Recursieve
+2  A: 

It is possible to increase the max size of an item greater than 1MB in memcached since 1.4.2:

http://code.google.com/p/memcached/wiki/ReleaseNotes142#Configurable_maximum_item_size

Note older versions of the Enyim.Caching client still have a 1MB hardcoded internal limit.

Richard Dingwall