BuilHigh Performance Weibo Platform-Qcon2011

978 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

BuilHigh Performance Weibo Platform-Qcon2011

  1. 1. Build High Performance Weibo Platform @TimYang
  2. 2. Background• Weibo introduction • 140 Chinese characters • With photo/video/comments/repost chain
  3. 3. Agenda3 42 1
  4. 4. Part 1
  5. 5. ( )
  6. 6. MySQL••
  7. 7. MySQL• id hash•• user_timeline index
  8. 8. MySQL•• • • 5
  9. 9. MySQL + cache•••
  10. 10. NoSQL?• • Redis • MongoDB• • Cassandra • HBase
  11. 11. • MongoDB• Redis• HBase• Cassandra
  12. 12. Redis• snapshot/vm/cache disk/aof• string/hash/list• Replication
  13. 13. •••• list/set (optional)
  14. 14. Data Structure•• RDBMS => JSON key value => binary
  15. 15. • DB• JSON/XML• Binary
  16. 16. JSON• DB• Cache• Message Queue• API
  17. 17. Binary Data Structure• Numeric: varint, from 1 byte•• Java, C++, Python...•
  18. 18. Data Structure
  19. 19. Case Study• 500 • •
  20. 20. • MySQL• NoSQL•
  21. 21. Part 2
  22. 22. ?
  23. 23. •• RAM
  24. 24. • Timeline, • e.g. “ 5 ” comments_timeline
  25. 25. 1001 1002 1003 1004 1005 One Data Center1002 1001 1004 1003 1005 Region 11001 1003 1002 1004 1005 Region 2
  26. 26. Part 3
  27. 27. app
  28. 28. • • • spam••
  29. 29. Part 4
  30. 30.
  31. 31. ••
  32. 32. Timeline Memcached MySQL Redis
  33. 33. Q&A @TimYanghttp://timyang.net/

×