[request feature] range data set and range data fetch commands
in memcached protocol.
aaron at serendipity.cx
Thu Dec 13 02:57:37 UTC 2007
On Wed, Dec 12, 2007, sunjh <sunjh at amoney.com.cn> said:
> This is useful if you're dealing with large strings and don't want to fetch
> the entire thing at once.
> And useful if someone have custom data struct.
This has been suggested a number of times in the past. The only use cases
I've seen involve a large data structure but you only want some piece of
it. In any such data structure, you need to look at the first n bytes to
find which other m bytes contain the data you want. The likelihood of the
data changing out from under you between those two queries is high.
You're better off storing multiple keys which contain the smaller pieces
of data that you want. For example, with a large string you probably want
the first n bytes and also the whole thing. Store two keys.
More information about the memcached