Difference between storing Integers and Strings in

2019-06-26 04:46发布

问题:

Any difference between these two commands?

LPUSH myset 123
LPUSH myset "123"

I want to store about 5 million integers and I want to do it in the most efficient way.

回答1:

No, there is no difference; both are stored as strings. From redis.io:

Redis Lists are simply lists of strings, sorted by insertion order.

Depending on your usage, you may want to consider using a set, rather than a list.



标签: redis