SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 30 day free trial to unlock unlimited reading.
19.
=feed+ +
• mysql: relation.following
• fromuid, touid, addtime
• addtime desc
select * from following where fromuid=? order by
• addtime desc
select * from following where touid=? order by
• fromuid, touid
20.
=feed+ +
• mysql: relation.following relation.follower
• fromuid, touid, addtime
• addtime desc
select * from following where fromuid=? order by
• desc
select * from follower where touid=? order by addtime
•
28.
=feed+ +
•
• cache ? waste too much mem
• storage ?
• rdb may lost data
• aof r/w too slow, recover too slow
• all data in mem, waste money
• HA : master slave ? NO WAY
• memory fragment
43.
=feed+ +
•
• rediscounter @
• array , not linked list
• malloc all mem when start
• hash key to position
• write disk: asyn & slow down
• add position to aof file
44.
=feed+ +
•
• rediscounter + innodb
• auto roll cold data to disk
19.
=feed+ +
• mysql: relation.following
• fromuid, touid, addtime
• addtime desc
select * from following where fromuid=? order by
• addtime desc
select * from following where touid=? order by
• fromuid, touid
20.
=feed+ +
• mysql: relation.following relation.follower
• fromuid, touid, addtime
• addtime desc
select * from following where fromuid=? order by
• desc
select * from follower where touid=? order by addtime
•
28.
=feed+ +
•
• cache ? waste too much mem
• storage ?
• rdb may lost data
• aof r/w too slow, recover too slow
• all data in mem, waste money
• HA : master slave ? NO WAY
• memory fragment
43.
=feed+ +
•
• rediscounter @
• array , not linked list
• malloc all mem when start
• hash key to position
• write disk: asyn & slow down
• add position to aof file
44.
=feed+ +
•
• rediscounter + innodb
• auto roll cold data to disk