Redis set vs hash

前端 未结 3 1440
自闭症患者
自闭症患者 2020-12-12 18:12

In many Redis tutorials (such as this one), data is stored in a set, but with multiple values combined together in a string (i.e. a user account might be stored in the set a

3条回答
  •  [愿得一人]
    2020-12-12 18:17

    Use case comparison:

    Sets provide with a semantic interface to store data as a set in Redis server. The use cases for this kind of data would be more for an analytics purpose, for example how many people browse the product page and how many end up purchasing the product.

    Hashes provide a semantic interface to store simple and complex data objects in the Redis server. For example, user profile, product catalog, and so on.

    Ref: Learning Redis

提交回复
热议问题