欢迎来到天天文库
浏览记录
ID:34527386
大小:10.30 MB
页数:65页
时间:2019-03-07
《互联网公司技术架构资料.新浪微博.构建高性能的微博系统new》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、BuildHighPerformanceWeiboSystem@TimYang•µQìNJ•140•āÔ6ď6ŋçÉƛ•ÚÏŷŴǂƇZWuġǂŮƹń*IJ6Ěų•DŽü§_ÆݵQŋŕDžQCon2010•DŽµQþü`5DžWDC2010Agenda3421Part1ēƥ3ĉƐúãŲ¯Ljơ?Ų¯ïƵŬRçYëDJŋŕ(ŧ»)Lj+ů;NJMySQL•ƙdēƥ3Lj_âÌ?Æ•ŒşƾÌ?Ņĭ•ÒhashÌ?•ŗ¥Lj6ŋ•ŏō¬Ljuser_timelineindexƪƺ•Pù»ťƮEǂƵŬÏŖÌ?•ŶƪƝ¥Ƶċ•īÄ•6ŋLjĉ
2、ĺ5Ą•¦ƖMySQL+cacheƪƺ•ƴ•ŧ»•cacheßÔʼnyLjƵŬ¡AN•ƻ~¨Ƨ•ĖIW0ÛƪƺNoSQL“Databasesarespecializing–the“onesizefitsall”approachnolongerapplies.”MongoDBŵűoNoSQL?•PùºƆ•Redis•MongoDB•?«ºƆ•Cassandra•HBaseīƨęmİFØú#ìĕ4ůİ(ǃģ»ĊƉ•MongoDB•Redis•HBase•CassandraRedis-Ïä«•ÏN3ă«Ĩů•snapshot- Đ•v
3、m-,ŠÜª•diskstore-,Šãäh•aof-Ƥ§¿Redis-ßÔʼny•string:keyvalueredisObject16bytes/item•list:XhƦū40bytes/item•hash:zipmap(<64)•set/sortedsetRedis-Replication•Ƥżrdbá#ƪƺ•ĵħņPRedis-ƥŭ@Redis-(•ƵŬǀƝż:Ŷƪ•ť¶Ĵõ_īLjåÁğfailoveräĂ•ólist/setßÔœüƵċ(optional)ēƥ3•MySQLLjŒşƾİēƥ3•NoSQLLj{ŪMySQLcac
4、heƫĿƲLj'ìƵŬódƙİƽƼťGPart2çűҵQþü(ŃĢ)$30%5)/.*#(4#,!0,86)&"7+'4- 521,ôJ→Õ]→£īƪƺơ?WebŋŕĩƸwcacheßÔŶƪLjīUŚìiƄNJ_īİcacheƀęÜÅóĝěßÔLjŧßÔIƈæƃŘ¿•ÆNJ•=ŽNJ“Webŋŕījsonû3WcacheƶĒſǃúµQījsonßÔœüûÅóĈ(MÎ,Š/¼)LjƵŬ2~5KŨa,īxmlƵŬ10ka,īprotobuf¡ANgLjŎ^ó500Ũǃ
5、”3ò6æ00:47ƇZ(495)
6、ŷŴ(134)TļRDBMS→Keyvalue(JSON)→Protocolbuffers(binary)JSONĜ½•DB•Cache•MessageQueue•APIPB$L•Numeric:varint,from1byte•&ƊřbLj&ƊĈfĻ•ÚÏŻŰljJava,C++,Python...•řůĵǀÞ•cacheñőœýDƫœýLjƓćŨŎĿƫ•“192.168.0.1”→“0xc0a80000”→varintBenchmarkTextText(http://code.googl
7、e.com/p/thrift-protobuf-compare/wiki/Benchmarking)“WewouldliketoprovidepublicAPIsthatacceptprotocolbuffersaswellasXML,bothbecauseitismoreefficientandbecausewe'rejustgoingtoconvertthatXMLtoprotocolbuffersonourendanyway.”-GoogleßÔœüLjRìŝ©ć}ĨƵċ•µQİZūì©ć}Ĩ•ưij`£ī
8、Lj£īIJ6ßÔÙ,ƚėƇh©
9、ćä«•7ƵŬ©ćİÙ,NJƪƺưijŋŕ
10、Lj“Ő>ƪƺ”¾<
11、LjƗľVr²ơ?ìĬ¨Zj©ć}Ĩśĕ¥Ĩůǃ•&ŕLAMP£īLjPÙ,ćƿ
12、W}Ĩçƫ
13、à*»ť±nǃ•©ćƬA}Ĩļ¡1msİ}Ĩçƫ¦Ʃ_ť%¬ƂƕƨY£WJÝƳǃ•çıÖƬA}Ĩ»ťÑÿßÔǃ©ćıÖ•MQstat•MQProcessorstatƪƺèêīÄįŊLjßÔ+çÉƛDÅóīÄ?íķó“1úãŷŴ”Ljě¨SČóßÔNJç»ŧ»•TimelineĔ¼ĐLjűßLj6ŋïńJƵŬWçÉƛŔÅóīÄ•ůƯŢdLjHťĬeôJÁ•©
14、ć}Ĩ•:cacheßÔ¢?¨•RAMNŞİZūĐļ1.ØZū2.4ƬA3.ƬA}Ĩļ¡ż>4.:cacheWßÔ¢master5.ßÔ¢replicationDÅóŨěƪƺ
此文档下载收益归作者所有