i'm planning use redis hashes map of maps in following way: [version ->[key -> serialized data]]
application , data design suggest using redis key version , redis field key. in our case mean storing few dozens of redis keys tens of millions fields each.
seems asymmetrical use case scenarios redis documentation. okay in terms of performance simple get/set/delete operations? no key expiration , other redis advanced techniques used.
you can use hash data structure store data way. design adds additional operation get/set value of each field compared using simple kv strings (i.e. version:key key , data value). otoh, using simple string kv, you'll end having lot (few dozens times tens of millions) keys, each having overhead greater approach you've suggested (more on same @ http://redis.io/topics/memory-optimization#using-hashes-to-abstract-a-very-memory-efficient-plain-key-value-store-on-top-of-redis).
that said, hash approach valid , used extensively. performance lost due operations negligible, considering savings in space.
note: question not specify why/how need fetch serialized data. need fetch keys under given version? maybe versions of given key? both? other? depending on use case's requirements, there may better alternatives.
Comments
Post a Comment