Storing object properties in redis

前端 未结 3 1400
迷失自我
迷失自我 2020-12-09 03:34

Lets say I have an object (User) which consists of a few properties (ID, Name, Surename, Age). Which way is better to store this object in redis?

  • store each pr
3条回答
  •  孤城傲影
    2020-12-09 03:41

    From official Redis

    Use hashes when possible

    Small hashes are encoded in a very small space

    When you haven't to much fields in it.

    Every time an hash will exceed the number of elements or element size specified it will be converted into a real hash table, and the memory saving will be lost.

提交回复
热议问题