More Related Content
Similar to 微博cache设计谈 (20)
微博cache设计谈
- 4. Feed
• feed
• Push( )
• Pull( )
•
- 5. Push
• feed
• Inbox:
• Outbox:
• inbox( )
• Inbox( )
- 7. Pull
• outbox( )
• Inbox( )
• Online computation
- 10. Cache
memory is the new disk,
and disk is the new tape.
for "real-time" web applications,
and systems that require massive scalability
- Jim Gray
- 12. cache
Weibo cache arch
Inbox hot cache
Outbox Vector cache Archive cache
Social Following Followers users
Graph
Content Hot cache Total
- 13. Inbox
• “ ”
• cache id list
• (hot cache)
• get set
• redis list/set
- 18. Update Workflow
Update status
Content cache Hot Inbox Vector Outbox vector
Content cache
replication
- 19. • outbox hot vector
• followers list
• inbox
- 20. feed
Home timeline Workflow
home_timeline
aggregator
Content hot
Inbox cache Outbox Vector
cache
Inbox archive Inbox archive Content cache
- 21. feed
• inbox cache
•
• , following
• id list feed
- 23. • Content cache
• multi get n feed(n = items/ , e.g. 50)
• cache = n * (feed + ,
e.g. 2k)
• 1,000 /
- 25. • 1G 300~400Mbps
•
• local cache
•
•
- 26. hot keys
• content cache of
• create local cache
1. get user_yaochen_local
2. get user_yaochen
1. set user_yaochen_local:value
3. delete all
- 27. cache
• key
memcache
•
• LRU cache,
• Memory storage
- 28. mutex
• content item cache
• db
• db
• key_mutex key
• mutex
- 30. S2
• Web 2.0 Social
• What’s S2
• Social Platform &
• Social Applications
• www.s2forum.org