search

Home  >  Q&A  >  body text

java - TimeLine推拉模式请教

redis如何实现推拉模式结合,如果根据用户是否在线判断推送和拉取,用户登陆后后台应该如何区分是从数据库中拉取还是读取redis中推送的timeline呢,这个是如何实现的呢

ringa_leeringa_lee2813 days ago589

reply all(2)I'll reply

  • PHPz

    PHPz2017-04-18 10:56:08

    First of all, if the number of users online exceeds a certain level, it is difficult for you to push. At this time, you can pull it. Pull it when the user logs in. It is impossible for users to log in at the same time. There is no extreme concurrency situation in pulling at this time. The pull should be in the cache. Pushing can be done when a certain base of users are online at the same time, such as three thousand. If you push once, the amount of long links maintained by a single machine is not large. If there are too many, tens or even hundreds of millions of users will not be able to push. You can choose to temporarily pull appropriately.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 10:56:08

    It is recommended to read this:

    1. https://www.keakon.net/2015/1...

    2. http://blog.lovemydeer.com/20...

    reply
    0
  • Cancelreply