I like to use verbose names in Redis, for instance set-allBooksBelongToUser:$userId
.
Is this ok or does that impact performance?
I can't answer this question with any certainty. However, I can ask some questions about it and offer some observations.
I think it's obvious that extremely long keys (names) and/or values would have a performance impact on overall performance if they can be used at all. These impacts could be in the client, over the network, or on the server. So the first question to drag out of yours would be:
How long can the keys and values be between Redis and your clients?
Searching on Redis, key length and limits nets me an interesting blog entry on Redis vs. memcached which may start to answer your question. The first response to that blog entry appears to have been written by Salvatore Sanfilipo, creator of Redis (early last fall: 09/2010) suggesting that a more recent version would show significantly better results. Two comments down from that link us to Salvatore's Redis/memcached Benchmark which was posted a few days after he'd responded to the original "blagger" (who seems to be anonymous).
This doesn't answer the questions (how long can the keys be and at what points are there detectable impacts on performance). However, it gives us a clue about approach the question.
The authors of both these articles wrote code and tested it ... and graphed the results.
We could make all sorts of guesses. We could look at the code and try to reason it out.
However, the most meaningful way to approach a question of this sort is to write some code to measure one proposed usage pattern ... and some more to test another (for instance a range of key lengths ranging from 8 characters to ... how long would you like ... 8 kilobytes?) ... and the measure it.