Colons were in previous versions of redis as a concept for storing data with names. In earlier versions, redis only supported strings, if you wanted to keep email and the age of "bob", you had to save all this as a string, so colons were used:
SET user:bob:email bob@example.com SET user:bob:age 31
They had special processing or no performance characteristics, but the only goal was to convert the data names to find them again. Currently, you can use hashes to store most of the colonized keys:
HSET user:bob email bob@example.com HSET user:bob age 31
You do not need to call the hash "user: bob", we could call it "bob", but namespacing it with a user prefix, we immediately find out what information this hash should have.
Tobias P. Aug 24 '10 at 11:06 2010-08-24 11:06
source share