System Design 系统设计

Pull Model vs Push Model

  • 以Twitter为例

  • Pull Model:每当用户发了一条Tweet,只需要在Tweet Table里新加一条记录,表示谁发了什么。其他什么也不用做。当好友需要看你的Tweet的时候,主动去找你发过的最近10条Tweets。

  • Push Model:每当用户发了一条Tweet,系统会主动地把你发的Tweet写入到 News Feed Table里,如果你有3个好友A、B、C,那么就会存入3条记录 [A+你的帖子],[B + 你的帖子],[C + 你的帖子]。

Reference: https://yq.aliyun.com/articles/224132

Last updated