查看 >> 记事本 >> Ruby China



查看 » 记事本 » Ruby China

转自:http://www.tuicool.com/articles/BJRJja
原文出处:http://blog.hongtium.com/feeds-timeline-design/

Facebook起源的NewsFeed,以及Twitter起源的Timeline,核心问题都是如何处理巨大的消息(活动,activity)分发。“推Push”和“拉Pull”或者“推拉结合”,是主要的处理方式。
以前各大网站陆续透露的文档,以及这次QCon2012 London和深圳的架构师会议,较大程度的公开了各自的实现方式。本文从 消息分发模式;内部通信工具、协议;存储方式 3方面总结。
各大网站都大量使用的Nginx, memcached, MySQL等开源产品,都标配了,文中不再提。实现技术上,异步消息队列的引入,来模块解耦和尖峰削平;Cache的精良设计等,也都是各家大量使用的技能,可看参看文档,不再详述。

推 Push, fan-out, Write-fanout 写时消息推送给粉丝。空间换时间
拉 Pull, fan-in, Read-fanout 读时拉取所有好友的消息,再聚合。时间换空间
混合 Hybrid 基于推,混入拉;基于拉,加速推。时空平衡

①Facebook
参考《Facebook news-feed QCon12.pdf》。典型的Pull方式,读时fanout,获得所有好友的活动,再进行聚合,rank,排序等操作(这几步后续动作,是feed和timeline的最大不同特点)。Facebook把这种模式叫做“Multifeed – Multi-fetch and aggregate stories at read time”。


Read full article from 查看 » 记事本 » Ruby China


No comments:

Post a Comment

Labels

Algorithm (219) Lucene (130) LeetCode (97) Database (36) Data Structure (33) text mining (28) Solr (27) java (27) Mathematical Algorithm (26) Difficult Algorithm (25) Logic Thinking (23) Puzzles (23) Bit Algorithms (22) Math (21) List (20) Dynamic Programming (19) Linux (19) Tree (18) Machine Learning (15) EPI (11) Queue (11) Smart Algorithm (11) Operating System (9) Java Basic (8) Recursive Algorithm (8) Stack (8) Eclipse (7) Scala (7) Tika (7) J2EE (6) Monitoring (6) Trie (6) Concurrency (5) Geometry Algorithm (5) Greedy Algorithm (5) Mahout (5) MySQL (5) xpost (5) C (4) Interview (4) Vi (4) regular expression (4) to-do (4) C++ (3) Chrome (3) Divide and Conquer (3) Graph Algorithm (3) Permutation (3) Powershell (3) Random (3) Segment Tree (3) UIMA (3) Union-Find (3) Video (3) Virtualization (3) Windows (3) XML (3) Advanced Data Structure (2) Android (2) Bash (2) Classic Algorithm (2) Debugging (2) Design Pattern (2) Google (2) Hadoop (2) Java Collections (2) Markov Chains (2) Probabilities (2) Shell (2) Site (2) Web Development (2) Workplace (2) angularjs (2) .Net (1) Amazon Interview (1) Android Studio (1) Array (1) Boilerpipe (1) Book Notes (1) ChromeOS (1) Chromebook (1) Codility (1) Desgin (1) Design (1) Divide and Conqure (1) GAE (1) Google Interview (1) Great Stuff (1) Hash (1) High Tech Companies (1) Improving (1) LifeTips (1) Maven (1) Network (1) Performance (1) Programming (1) Resources (1) Sampling (1) Sed (1) Smart Thinking (1) Sort (1) Spark (1) Stanford NLP (1) System Design (1) Trove (1) VIP (1) tools (1)

Popular Posts