Build High Performance
Weibo Platform
@TimYang
Background
• Weibo introduction
• 140 Chinese characters
• With photo/video/comments/repost
chain
Agenda
3 4
2 1
Part 1
()
MySQL
•
•
MySQL
• id hash
•
• user_timeline index
MySQL
•
•
•
• 5
MySQL + cache
•
•
•
NoSQL?
•
• Redis
• MongoDB
•
• Cassandra
• HBase
• MongoDB
• Redis
• HBase
• Cassandra
Redis
• snapshot/vm/cache disk/aof
• string/hash/list
• Replication
•
•
•
• list/set(optional)
Data Structure
•
• RDBMS => JSON key value => binary
• DB
• JSON/XML
• Binary
JSON
• DB
• Cache
• Message Queue
• API
Binary Data Structure
• Numeric: varint, from 1 byte
•
• Java, C++, Python...
•
Data Structure
Case Study
•