News for hackers. Stuff that matters.
Re:Storing hundreds of millions of simple key-value pairs in... by catwell on Tuesday November 01, 2011 @03:47PM (#3183842)
Lookups are not really O(1), they're O(number of keys per hash) as long as the hashes are zipmaps. When they become full blown hashes the memory usage increases.

Still, this is a very good way to store a lot of key/value pairs in Redis.

Re:Storing hundreds of millions of simple key-value pairs in... by pjscott on Tuesday November 01, 2011 @05:58PM (#3184339)
Big-O notation refers to asymptotic behavior. The zipmap encoding of hashes only matters for small values bounded by a constant, so hash lookups are still expected O(1) time in Redis.

</extreme-pedantry>

Re:Storing hundreds of millions of simple key-value pairs in... by catwell on Wednesday November 02, 2011 @05:05AM (#3185901)
Your point would be valid if the memory gain observed was not directly dependent on the fact that hashes are zipmap-encoded. So the trade-off here is between the constant factor of time complexity and the constant factor of memory complexity.