Jdesk / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

Unlimitize the key length #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The current maximum key length limit (250 bytes) should be dropped
altogether, because it is artificial and arbitrary, and because it
complicates the usage of memcached unnecessarily.

As far as it concerns the code of memcached, the limit is purely artificial.

There may be reasons for having a small key length (speed; memory
consumption), but there may also be reasons for a large key length
(correctness (exact match vs. match of hash values); ease of use (no need
for workarounds around key lengths limits); ease of debugging (see keys in
cleartext, not as hashed text); less surprises when the limit is reached
only occasionally). Thus, memcached should not decide a priory on an
arbitrary limit.

Clients (and servers, too) are are allowed to warn about inefficiencies
pertaining to key length (e.g. if the key length exceed 250 bytes), but
they should continue to work if they can, and they can.

Thus, the limit should be dropped from the server as well as from the protocol.

Original issue reported on code.google.com by xuan--20...@baldauf.org on 9 Jan 2009 at 5:29

GoogleCodeExporter commented 9 years ago
The binary protocol opens the door for longer keys (we have 16 bits reserved in 
the
protocol for key length). Please note that the server is not updated to handle 
such
long keys internally.

I don't think that you will see unlimited key length, but 65k should be more 
than
enough for a key...

Original comment by trond.no...@gmail.com on 20 Jan 2009 at 3:29

GoogleCodeExporter commented 9 years ago
That's what Bill Gates said about 640k.

Original comment by cmdrwal...@gmail.com on 4 Mar 2009 at 1:01

GoogleCodeExporter commented 9 years ago

Original comment by trond.no...@gmail.com on 25 Mar 2009 at 8:28