search

Home  >  Q&A  >  body text

redis数据类型的使用场景

redis中字符串、哈希、列表、集合等数据类型的使用场景是什么?
什么时候应该使用符串、哈希、列表、集合?
谢谢。

PHP中文网PHP中文网2778 days ago771

reply all(2)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-04-25 09:04:48

    1. Generally choose the character type when storing a single value or json string
    2. Use hash when the data has an obvious hierarchical relationship and only a part of it is read at a time. For example, we want to store provinces and cities in China, and only take a subset of units under a certain province or city each time
    3. To implement a queue, FIFO can use list
    4. Require that the elements in the list are not repeated, or you want to sort them Collections can be used, but not much for personal use

    reply
    0
  • 滿天的星座

    滿天的星座2017-04-25 09:04:48

    You can refer to our application in production.

    Tuniu Original|Cool practice of wireless center operation and development Redis

    reply
    0
  • Cancelreply