I want to store a JSON payload into redis. There's really 2 ways I can do this:
-
一个使用简单的字符串键和值
SET user:1 payload
-
Using hashes
HSET user:1 username "someone"
HSET user:1 location "NY"
HSET user:1 bio "STRING WITH OVER 100 lines"
Keep in mind that if I use a hash, the value length isn't predictable. They're not all short such as the bio example above.
Which is more memory efficient? Using string keys and values, or using a hash?