Best way to keep a small list of key values ​​in Redis

I am trying to use Redis as a primary database for a small game that I make (mainly for communicating with programming and using Redis).

However, I came across a script that I could not find the answer to:

I want to keep a list of the names of the various cards that people can be on (not many of them), along with their identifier. Note. I never need to get an identifier on behalf of.

In two ways, in my opinion, this can be done either by storing the information as a string or as a hash.

i.e:

1) String based:

  • set maps: 0 "Main"
  • map set: 1 "Island"
  • etc. (and possibly maps: id to save auto increment value)

2) Hash:

  • hset maps "0" "Main"
  • hset maps "1" ""
  • ..

, . , , . , . - , .

, .

, Pluckerpluck

+3
1

String , , .

Redis . zipmap ( ziplist redis 2.6). . http://redis.io/topics/memory-optimization, " , ".

+6

All Articles