Home  >  Q&A  >  body text

web服务器 - app后端是否需要redis缓存用户常用数据

app客户端每次获取用户的数据,例如:图像、好友列表、个性签名之类的信息,是每次直接读取数据库还是把用户个人信息缓存到redis中?

刚转app后端,遇到一些问题不是很清楚,请大神来指导。

PHP中文网PHP中文网2736 days ago536

reply all(3)I'll reply

  • 怪我咯

    怪我咯2017-04-24 09:13:10

    Data that is frequently read and rarely changed can be placed in the cache.
    Data with high performance requirements needs to be updated in the cache at the same time as the database. If the requirements are not high, let the cache expiration strategy be tossed by yourself.

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-24 09:13:10

    I am used to storing it in the cache, but remember to modify the data in the cache when modifying user information

    reply
    0
  • 高洛峰

    高洛峰2017-04-24 09:13:10

    Shouldn’t we first look at the interface access speed and then decide whether caching is necessary? If your table is optimized well enough and the interface is fast enough, why should you use cache?

    reply
    0
  • Cancelreply