I’ve been looking into Redis. I wondered about storing integers as keys and values rather than plain old strings. After asking on Stackoverflow, I did my own experiments.
It looks like it is possible to use any byte string as a key.
For my application’s case it actually didn’t make that much difference storing the strings or the integers. I imagine that the structure in Redis undergoes some kind of alignment anyway, so there may be some pre-wasted bytes anyway. The value is hashed in any case.