16é±é以å ã«æ°ãããŠã§ãRSSãªãŒããŒãäœæããæ¹æ³ã®æè¡çãªåŽé¢ãã話ãããŸãããã»ãšãã©å€¢äžã«ãªããŸããã
é·ãæŽå²ããé¢ããŠããããããšç§ïŒ dmiloshev ãUIãã¶ã€ããŒïŒãäžç·ã«ç§ãã¡ã®é è³ã®ãããã¿ã€ããäœãããšã«ãããšããããã¯ä»å¹Ž2æã«ãã¹ãŠå§ãŸã£ããšä»®å®ããŸãã
ãåç¬ã-å·è·¡ãäŒè°ããéå£ççç±ãããªããæè¡çãªéšåããã¹ãŠèªåã§ãããªããã°ãªããªãã£ãããã§ãã
èšäºå šäœã1ã€ã®æã§èª¬æããããã«æ±ããããå Žåãçµæã¯æ¬¡ã®ããã«ãªããŸãã
No-SQLãmongodbãnode.jsãç§ã®é è³ãEvented I / Oããã¥ãŒãåºåãgitãnginxãmemcachedãGoogle ReaderãAtomãTTLãPHPãZFãjQueryãçµè«ã
I.ãã¯ãããžãŒ
1. PHP / ZendFramework +ãã®ä»
ç§ãæåããæã£ãŠããã®ã¯ãzfã§ã®äœæ¥ãããå°ã䟿å©ã«ããå°ããªãã¬ãŒã ã¯ãŒã¯ã ãã§ãã äŸåæ§æ³šå ¥ãããŒãã«ããŒã¿ã²ãŒããŠã§ã€ã転éãªããžã§ã¯ããèšå®ã䜿çšãããã䟿å©ãªäœæ¥ãã»ãŒãã¹ãŠã®å Žåã«ç»é²æžã¿ã®ã¿ã¹ã¯ã¿ã¹ã¯ã§Phingãæ§æããŸãã äžè¬çã«ãããããã¹ãŠã®äœæ¥ã¯éåžžã«å¿«é©ã§ãã
ã¢ãŒããã¯ãã£äžã®phpã¢ããªã±ãŒã·ã§ã³ã¯ã次ã®ã¬ã€ã€ãŒã§æ§æãããŠããŸãã
- ã«ãŒãã£ã³ã°/ã³ã³ãããŒã©ãŒ/ãã¥ãŒ-ãªãã»ã©..
- ãµãŒãã¹-ããã§ã¯ãACLãæ€èšŒããã£ãã·ã¥ããã®ã³ã°ã RESTãå®å šã«åºå®ã§ããåªããAPIãæäŸãããŸãã
- ã²ãŒããŠã§ã€ã¯ããžãã¹ããžãã¯ã®æ¬äœã§ãã ã·ã¹ãã å ã®åãšã³ãã£ãã£ã«ã¯ãç¬èªã®ã²ãŒããŠã§ã€ããããŸãã ããŒã¿ããŒã¹ããå®å šã«æœè±¡åãããŠããŸãã
- ããããŒ-å®éãããã§ã¯ããŒã¿ããŒã¹ãçŽæ¥æäœããŸãã
- ããã¹
- èªè»¢è»ãªã
- ã·ã¹ãã ã®è«çéšåã¯æ°Žå¹³æ¹åã«ã¹ã±ãŒãªã³ã°ã§ããå¿ èŠããããŸã
- å€éšãœãŒã¹ãæ±ããã¹ãŠã®æé ã¯ããã¯ã°ã©ãŠã³ãã§å®è¡ãããŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ãããªãŒãºããªãã§ãã ããã
- é«è² è·ã¯ãããã»ã¹ã®æ°ãéããŠããæ¥ç¶ã§ã¯ãªãããã¥ãŒãããã»ããµã®é»åãã¿ã€ã ã¢ãŠãã«äŸåããå¿ èŠããããŸã
- ãã¹ãŠã®ããŒã¿ãå埩ã§ããŸãã
- ãšã©ãŒã ãã§ãªãã絶察ã«ãã¹ãŠãèšé²ããå¿ èŠããããŸã
- ããã£ãã·ã¥ã§ããŸãã
- DavidïŒããã®ãã¬ãŒãã¯å·Šã«1ãã¯ã»ã«ã§ããå¿ èŠããããŸã..ã=ïŒ
2. nginxã³ã¡ã³ããªã
3. git㯠ãç§ãæã£ãã»ã©é ãè¯ããªãããšãæããã«ããã
4.ã¢ã³ãŽãã
以åã¯ãå¥ã®ãããžã§ã¯ãã§æ¬çªçšã«äœ¿çšããŠããŸããããéåžžã«æ éã§ãã£ããããå®å šã«è©Šãããšã¯ã§ããŸããã§ããã æè¿ãNo-SQLãshardingãmap-reduceãããã³No-SPOF modãç¹ã«éçºãããŸããã ç§ã¯åäŸã®ãºãã³ããæãåºãæã ãšæ±ºããŸããã å°ãªããšããããã¯äžè¬çãªã«ãŒãã³ãéåžžã«åžéããç§ãå°ãæºãã¶ããŸããã
ã¿ããªã®ããã¥ã¡ã³ãã¯éåžžã«è©³çŽ°ã§ãããããæåã®2é±éã§mongodbã®æ·±ããŸã§æµžéããããšãã§ããŸããã ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ãé·å¹Žäœ¿çšããåŸãé ãå°ãè£è¿ããªããã°ãªããŸããã§ããã ãããããã¹ãŠã®éèŠãªã¿ã¹ã¯ã¯ããã©ãŒã©ã ã§è³ªåããããšã«é Œãããšãªããç¬ç«ããŠè§£æ±ºãããããšãå€æããŸããã
æ¬çªç°å¢ã§èµ·åããã®ãå°ãæãã§ãã èµ·ããããåé¡ã«é ããªãããã«ãç§ã¯å®æçã«ã°ã«ãŒããèªã¿ãä»ã®äººãçŽé¢ããŠããåé¡ãç 究ããŠããŸãã
çŸæç¹ã§ã¯ãå®å šã«ãµããŒããããŠããªãmaster-masterãšããŠæ§æãããŠããŸããããã®å Žåã¯æ£åžžã«æ©èœããã¯ãã§ãã å°æ¥çã«ã¯ã·ã£ãŒãããåãmysqlã䜿çšãããããééããªãç°¡åã«ãªããŸãã
5. Memcached
ããã§èšãããšã¯ãããŸããã ãã¢ã®ããã«ã·ã³ãã«ã å°æ¥çã«ã¯ãUDPã§è©ŠããŠã¿ãããšæããŸãã...楜ãã¿ã®ããã ãã§ãã
6. Memcacheq
ä»æ¥ãããã«ã¯å€ãã®éžæè¢ããããŸããã圌ã¯åã®ãããžã§ã¯ãã®å¶äœã§éåžžã«ããèªåèªèº«ã瀺ãããšèšããŸãã
ãããŠãè¯ãããšã¯ã圌ãç¹å¥ãªãã©ã€ããŒãå¿ èŠãšããªãããšã§ã-ããã¯memcachedäžã§åäœããŸãïŒæ¬¡ã®æ®µèœã§åœ¹ç«ã¡ãŸããïŒã
7. node.js
ããã¯ããããããã®4ãæã§ç§ã«èµ·ãã£ãæãèå³æ·±ãããšã§ãã ãµãŒããŒã€ãã³ãI / Oã¯éåžžã«ãšããµã€ãã£ã³ã°ã§ã å·®å以äžã®ãã®ã§ãã ç§ã¯ããã«ãã¹ãŠã®phpãã ãŒãã®ããrubyã«æžãæããããšæããŸããã ãããã¯ç§ã®å€¢ã§ãã
äºå®ãæè¿å¶ç¶çºèŠããããšããããŸãã ãã®åŸãã·ã¹ãã èªäœãšç§ã®é ã®äž¡æ¹ã§ãããªãã®æ°ã®ããšãèµ·ãããŸããã äœåºŠãæžãçŽããªããã°ãªããŸããã§ããããçµæã¯éã«ãšã£ãŠéåžžã«æ¥œãããã®ã§ãããå°æ¥ã®ãŠãŒã¶ãŒãåã°ããããšãé¡ã£ãŠããŸãã
ãã£ã«ã¿ãŒã䜿çšããåã«ã ãã®ããŒãžã䜿çšããŸãããmongooseãkiwiãstepãmemcacheãstreamloggerãhashlibãconsolelogãeyesãdaemon
圌ã®ã©ã€ãã©ãªããã圌ã¯jsonsocketãæžããã æã¯åœŒã®github-threadã«å±ããŸããã ãããŠä»ãç§ã¯ããããbsonsocketãäœãããšã倢èŠãŠããŸãã ãã¡ããããã¥ãŒãæäœããããã®ãã®ãšãPHPã§Gatewayã¬ã€ã€ãŒãæäœããããã®ã¬ã€ã€ãŒãäœæããå¿ èŠããããŸããïŒããã«ã€ããŠã¯åŸã§èª¬æããŸãïŒã
ãŸãã prowlãè¿œå ããŸãããããã¯ã°ã©ãŠã³ãã¯1æéã«1åãbashorgããã©ã³ãã ã¡ãã»ãŒãžãéä¿¡ããæºåž¯é»è©±ã«ããã·ã¥ã¡ãã»ãŒãžãéä¿¡ããŸãïŒåæã«ãã¡ã¢ãªäœ¿çšéãªã©ã®çµ±èšããããŸãïŒã
å€ãã®ã©ã€ãã©ãªïŒã¢ãžã¥ãŒã«ïŒã¯éåžžã«æªå å·¥ã§ããããã誰ãã®ã³ãŒããçŽæ¥ç·šéããªããã°ãªããªãå ŽåããããŸããïŒããããäœæããæéã¯ãããŸããïŒã ãããŠã玳士ã®çãããnode.jsã¯åŸæ¹äºææ§ãå¿ èŠãšããŠããã®ã§ããã°ãã°æ©èœããªãã©ã€ãã©ãªãèŠã€ããããšãã§ããŸãã
8. jQuery
ç§ã«ãšã£ãŠãããã¯ã»ãšãã©ã¯ã©ã€ã¢ã³ãåŽã®JavaScriptã®å矩èªã§ãã
䜿çšãããŠãããã©ââã°ã€ã³ïŒblockUIãvalidateãformãtooltipãhotkeysãeasingãscrollToãtext-overflowããã®ä»ããã€ãã®å°ããªãã©ã°ã€ã³ã
IIã éçº
ãµãŒãã¹èªäœã®è©³çŽ°ã«ã€ããŠã¯è©³ãã説æããŸããããæè¡çã«ã¯ã»ãŒGoogleãªãŒã㌠ïŒGRïŒã§ãã
Davidã¯Photoshopã§ç°è²ã®åè§ããé転ãããããžãã¹ããžãã¯ã«ã€ããŠèããªãããåºæ¬çãªã¢ããªã³ã°ããå§ãããã®åŸããã«ãã£ãŒããã³ãã·ã¹ãã ã«åãæ¿ããŸããã
1.ãã£ãŒããã«
ããã§ã¯ãã¹ãŠãåçŽãªããã«æããŸã-ã¢ãã¬ã¹ãååŸããxmlãparsimãåºåããããŒã¿ããŒã¹ã«æžã蟌ã¿ãŸãã ãããã埮åŠãªéãããããŸãã
- ã·ã¹ãã ã«ä¿åã§ããããã«ããã«ã¯ãåãã£ãŒããäžæã«èå¥ããå¿ èŠããããŸãã
- ãŸããéè€ãé¿ããããã«åãšã³ããªãèå¥ããå¿ èŠããããŸãã
- if-modified-sinceãetagãªã©ã®ãµããŒã
- ãªãã€ã¬ã¯ãåŠç
- RSS / Atomã®ç°ãªãããŒãžã§ã³
- grïŒdate-publishedãªã©ã®ããŸããŸãªãµãŒãã¹ã®æ¡åŒµ
- åã¬ã³ãŒãå ã®HTMLã¯ãããã«ããå¿ èŠããããŸãããå®å šã§ã¯ãªããè¯ãã¿ã°ãæ®ããç°ç«¯ãæé€ããå¿ èŠããããŸã
- ã¢ã€ã³ã³ãèŠã€ããŠåŠçããããšã¯ãæã楜ããããšã§ã¯ãªãããšãå€æããŸãã...ããšãã°ãlivejournalã¯ã³ã³ãã³ãã¿ã€ããäžããªãã®ã§ãmagic.mimeã䜿çšããå¿ èŠããããŸã
- ã©ããããä»æ§ãèªãã§ãã人ã¯ã»ãšãã©ããªãã®ã§ãxmlãæå¹ã§ãªããããŸã£ããæå¹ã§ã¯ãªãå¯èœæ§ããããŸã
å€éšãœãŒã¹ã¯éåžžã«ç°ãªã£ãŠããããã®å€ãã¯åã«æšæºã«èšåããŠããŸãã ãããŠããããã¯ä¿¡é Œã§ããŸãã-ã³ã³ãã³ãã®æ€èšŒã¯ããŠãŒã¶ãŒãšããåããããšããšåããããå³å¯ã§ãªããã°ãªããŸããã
å®å šãªã³ãŒãã¯æ©èœããŸããã§ããã å€ãã®æ¡ä»¶ãšäŸå€ã§å€§ãããªããŸããã
åã¢ã€ãã ã«ã¯å€ãã®æéãããããŸããã ããã¯äžèŠãããšæãããããããŸããã
2.ã¢ããããŒã¿ãŒ
ããã§ãæ¢åã®ãã¹ãŠã®ã¹ã¬ãããèªåçã«æŽæ°ããããšæããŸãã ããã«ãåã ã®ã¹ããªãŒã ã®TTLïŒãªãã¬ãã·ã¥ã¬ãŒãïŒãèæ ®ããããšãæãŸããã§ãã ãŸãããã®TTLãæå»ããšã«å¡ãä»ããããšæããŸãã ç§ã®ç 究ã«ãããšããããã³ã«ããŸã£ããååšããªãããçŸå®ã«å¯Ÿå¿ããŠããªãããããããã³ã«ã«äŸåããŸããã§ããã ãããã«ãããããã ãã§ã¯ååã§ã¯ãããŸããã
ç§ã¯ãã¹ããªãŒã ã®æŽæ°é »åºŠã決å®ããããã®ç¬èªã®ã·ã¹ãã ã«ã€ããŠèãå§ããŸããã
- TTL-1æéã®ã¹ããªãŒã ã®èšé²éã®å¹³åæéééïŒç§åäœïŒïŒæå°2åãæ倧1æéïŒ
- åã¹ããªãŒã ã«ã¯ãéå»10æ¥éã®24æéããšã®å¹³åTTLã®ãªã¹ãããããŸãã
- éå»10æ¥éã®å®éã®ããŒã¿ã«åºã¥ããŠãç¿æ¥ã®äºæž¬ã圢æãããŸããããã¯ãåæéã®å¹³åTTLå€ãè¡šããŸã
- ã¹ããªãŒã ãæŽæ°ããããã³ã«ãã·ã¹ãã ã¯çŸåšã®æéïŒ0ã23ïŒã®å¹³åå®éTTLãåã«ãŠã³ãããŸã
å®éãæŽæ°æé èªäœã¯åè¿°ã®ãã£ãŒããã«ã§ãããéèŠã§ã¯ãªããäœãæŽæ°ãããã§ãã
ãããŠããã§ãããããã¹ãŠããã¥ãŒã«å ¥ãããããšãã¹ã ãŒãºã«ç解ããŸãã ããããç§ã¯åœŒãã®çµç¹ã«ã€ããŠå°ãåŸã§è©±ããŸãã
ã¡ãªã¿ã«ã PubSubãåºå®ãããããèµ·åããããšãèšç»ããŠããŸãã
3.çºèŠ
確ãã«ã䟿å©ãªrssãªãŒããŒã®ã¹ãã«ã®ãªã¹ãã«ã¯ãhtmlããŒãžã§rss / atomãã£ãŒãã®æ€çŽ¢ãå«ããå¿ èŠããããŸãã ãŠãŒã¶ãŒãWebãµã€ãã®ã¢ãã¬ã¹ïŒããšãã°www.pravda.ru ïŒãå ¥åããã ãã§ãã·ã¹ãã ã¯å®éã«ããã«ã¢ã¯ã»ã¹ããŠã賌èªå¯èœãªãã£ãŒããæ€çŽ¢ããå¿ èŠããããŸãã
ãããããã®æé ã¯ãŠãŒã¶ãŒã®ãªã¯ãšã¹ãã§çŽæ¥è¡ãããšã¯ã§ããªããšããäºå®ã«ãã£ãŠè€éã«ãªããŸããããã¯WebãµãŒããŒã®ã¿ã¹ã¯ã§ã¯ãªããããéåæã«å®è¡ããå¿ èŠãããããã§ãã ãŠãŒã¶ãŒã®èŠæ±ã«å¿ããŠãæåã«ãã®ãããªã¹ããªãŒã ãããŒã¿ããŒã¹ã«ååšãããã©ãããçŽæ¥ç¢ºèªãããã£ã¹ã«ããªãã£ãã·ã¥ïŒ2æéç¶ãïŒã調ã¹ãäœãèŠã€ãããªãå Žåã¯ãã®åé¡ããã¥ãŒã«å ¥ããæ倧5ç§åŸ ã¡ãŸãïŒæ¹æ³ã«ã€ããŠåŸ ã£ãŠãåŸã§èª¬æããŸãïŒã ãã®æéå ã«ã¿ã¹ã¯ãå®äºããªãå Žåã{waitïŒtrue}ã®ã¹ã¿ã€ã«ã§jsonãè¿ãããšã§ã¹ã¯ãªãããçµäºããŸãã ãã®åŸãäžå®ã®ã¿ã€ã ã¢ãŠãåŸãã¯ã©ã€ã¢ã³ãåŽã¯ãµãŒããŒã«åããªã¯ãšã¹ããè¡ããŸãã ã¿ã¹ã¯ãããã¯ã°ã©ãŠã³ãã§å®äºãããšããã«ããã®çµââæããã£ã¹ã«ããªãã£ãã·ã¥ã«æ ŒçŽãããŸãã
ãã®æé ã«é¢é£ããããã€ãã®ãã¥ã¢ã³ã¹ïŒ
- ç°ãªããšã³ã³ãŒãã£ã³ã°-ããããŒãŸãã¯ããããŒã®ãããã«ããšã³ã³ãŒãã£ã³ã°ã瀺ãããŠããªãå ŽåããããŸã...ãã€ãã§æ±ºå®ããå¿ èŠããããŸãïŒåžžã«æ©èœãããšã¯éããŸããïŒ
- 1ã€ã®ããŒãžã«2ã€ã®åäžã®ãã£ãŒããããã1ã€ã®RSSãå¥ã®Atomã§ããå ŽåããããŸã-ãã®å Žåããããããéžæããå¿ èŠããããŸã
- ãããæ©èœããããšã確èªããããã«åãã£ãŒããè¿œå ã§ãªã¯ãšã¹ãããå®éã®ã¿ã€ãã«ãšèª¬æãååŸããå¿ èŠããããŸã
- ãªãã€ã¬ã¯ã
- ã¢ã€ã³ã³ïŒåãåé¡ïŒ
- æšæºãšæå¹æ§ïŒåãïŒ
ã¡ãªã¿ã«ããã®ããŒãžã«ã¯å ·äœçã«ã¯ä»£æ¿ç©ã¯ãããŸããããåããµã€ãã®ä»ã®ããŒãžã«ã¯ã©ããã«ããããšããããããŸãã ãŠãŒã¶ãŒãé »ç¹ã«å ¥åãããµã€ãäžã®rss / atomã¹ããªãŒã ããµã€ã¬ã³ãã«æ€çŽ¢ããããã¯ã¢ããã¯ããŒã©ãŒãäœæãããšããã¢ã€ãã¢ããããŸããã
çµè«ïŒ
ããŸããŸãªçš®é¡ã®å€éšãœãŒã¹ãåŠçããå Žåãã©ã³ãã ã«ã¹ããŒãããããã¥ã¡ã³ããæ¢ããŠå·šå€§ãªãŽããæã£ãŠããããã§ãã
ç¹å®ã®æ¹è¯ãå¿ èŠã§ãã 䜿ããããã®èŠ³ç¹ããããã®ããŒãžã§ã®ä»£æ¿ã®åçŽãªæ€çŽ¢ã§ã¯ååã§ã¯ãããŸããã ãã£ãšæ®éçãªäœããããå¿ èŠããããŸãã
4.ã€ã³ã¿ãŒãã§ãŒã¹
次ã«ç§ãæ¬åœã«æ¬²ããã£ãã®ã¯ãã¹ããªãŒã ããµãã¹ã¯ã©ã€ãã§ããã€ã³ã¿ãŒãã§ãŒã¹ãèŠãŠããããããã¯ããŒã¯ãšããŠå·Šã®åã«è¿œå ãããã®ã³ã³ãã³ããã¯ãªãã¯ããŠèªãããšã§ããã
ã€ã³ã¿ãŒãã§ãŒã¹ã®å®è£ ã®è©³çŽ°ã«ã€ããŠã¯èª¬æããŸããããã¹ãŠã®ã¬ã€ã¢ãŠããšUIãèªåã§äœæãããšèšãããã ãã§ãã ããã¯éåžžã«äžæ¡ç®ã§ãããä»ã®ã¿ã¹ã¯ãã泚æãããããŸããã ããããjqueryã¯æéãç¯çŽããŸããã
èªè ãšäžè¬çãªã€ã³ã¿ãŒãã§ã€ã¹ã§ã¯ãåèš2é±éãè²»ãããŸããïŒããã¯ãå°æ¥ã®ããªãã®ä¿®æ£ãšå€æŽãé€ããŸãïŒã ãã®åŸãç§ãã¡ã¯ã¢ãã¿ãŒã«å ããç®ãšéãåã°ããããããããã¡ããæã«å ¥ããŸããã
ãã©ã«ããŒ
ãã¡ãããç§ãã¡ã¯æå°éã®äººã§ããããã©ã«ãããªããã°ãèªè ãšäžç·ã«ä»äºãããããšã¯æ³åã§ããŸããã ãããŠã玳士ãç³ãèš³ãããŸããããGoogleãªãŒããŒã§ã¯äœ¿ãåæãæªãã§ãã ã§ããã ãã¢ã¯ã»ã¹ããããã·ã³ãã«ã«å®è£ ããããã«ããŸããã
ããããæè¡çã«ã¯ããããã®ãããªåé¡ã«ãªããšã¯æããŸããã§ããã ã€ã³ã¿ãŒãã§ãŒã¹ã¯ã€ã³ã¿ãŒãã§ãŒã¹ã§ããããµãŒããŒåŽã§ã¯ãå¿ èŠãªåäœãããããã«ããªãã®åªåãããªããã°ãªããŸããã§ãã-次ã®æ®µèœãåç §ããŠãã ããã
å¯èœãªéããç§ã¯cssã¹ãã©ã€ãã䜿çšããããšããŸããïŒå€æãããšããã§ïŒã
ãã¹ãŠã®jsããã³cssã¯1ã€ã®ãã¡ã€ã«ã«åéãããgzipã§çž®å°ããã³å§çž®ãããŸãã äžå€®ã®ããŒãžïŒãã¹ãŠã®çµ±èšãå«ãïŒã¯300ãããã€ãã§ãã ãã£ãã·ã¥ãã-100kbã
IE6ã«ã¯ç¹å¥ãªããŒãžããããŸãã
çµè«ïŒ
ã€ã³ã¿ãŒãã§ã€ã¹èªäœã¯éåžžã«ç°¡åã«èŠããŸããããã®å®è£ ã«ã€ããŠã¯åãããšãèšããŸããã
æçµçã«ããã¹ãŠãå§çž®ãããfirebugããªãã«ãªã£ãŠããå Žåãã¹ããŒãã«æ©èœããŸãã
åèšã§ãçŸæç¹ã§ã¯28åã®ã¹ã¯ãªãŒã³ãš100äžã®ãŠãŒã¹ã±ãŒã¹ãã«ãŠã³ãããŸããã
5.æ¢èª/æªèªã®ãšã³ããª
ããã¯ãã¹ã¬ããã®åæ¢ãããã«å€ãã®ãµãã¹ã¯ã©ã€ããŒãæœåšçã«ååšããå¯èœæ§ãããã·ã¹ãã ã«ãšã£ãŠãããªãéèŠãªã¿ã¹ã¯ã§ããããšãå€æããŸããã æãéèŠãªããšã¯ãæ°Žå¹³æ¹åã«ã¹ã±ãŒãªã³ã°ã§ããããšã§ãã
åãšã³ããªãšã³ãã£ãã£ã§ã¯ããããèªãã ãŠãŒã¶ãŒã®ãªã¹ããä¿æããŠããŸãã ãã®ãªã¹ãã«ã¯å°ãªããšã100äžåã®èå¥åãååšããå¯èœæ§ããããŸãããmongodbã¢ãŒããã¯ãã£ã®ãããã§ããã©ãŒãã³ã¹ã«åœ±é¿ã¯ãããŸããã ãŸããå¥ã®ã³ã¬ã¯ã·ã§ã³ã«ã¯ãèªã¿åãæéãªã©ã®è¿œå æ å ±ãæ ŒçŽãããŸãã ã€ã³ããã¯ã¹ã¯ä»ããããŠããããçµ±èšã®ããã ãã«å¿ èŠã§ããããããã¹ãŠãè¿ éã«æ©èœããŸãã
ãŠãŒã¶ãŒããšã«ããŠãŒã¶ãŒããµãã¹ã¯ã©ã€ãããŠãããã¹ãŠã®ã¹ã¬ããã«ã€ããŠãã«ãŠã³ã¿ãŒã®æçµæŽæ°æ¥ãä¿åãããŸãã
ãŠãŒã¶ãŒãããŒãžãæŽæ°ãããšãã·ã¹ãã ã¯ãã®æ¥ä»ãããåŸã«è¡šç€ºãããåã¹ããªãŒã ã®æ°ããã¬ã³ãŒãã®æ°ãèŠã€ãããããæªèªã®æ°ã«è¿œå ããŸãïŒåçŽãªå¢åïŒã ãŠãŒã¶ãŒãã¬ã³ãŒããèªã¿åããšãåçŽãªãã¯ãªã¡ã³ããçºçããŸãã
å¥ã®ã¹ããªãŒã ã«ããæªèªãšã³ããªã®ååŸãéåžžã«ç°¡åã§ãã
ãããããã©ã«ãå ã®æªèªã®ã¿ãéžæããããšã¯ãã§ã«åé¡ã§ãã ãã¥ã¢ã³ã¹ãæ確ã«ããããããŸããããããã¯mongodbã«ã¯åçŽã«çµåããªããšããäºå®ã«ãããã®ã§ãã åçŽãªèŠæ±ãŸãã¯ããã€ãã®èŠæ±ã§ã¯ãCodeWScopeãä»ããŠã®ã¿è§£æ±ºã§ããŸãã ã€ã³ããã¯ã¹ãã¹ã±ãŒã«ããããšã¯äžå¯èœã§ã-m / rã ããã¯çŸåšãæœåšçãªããã«ããã¯ã§ãã
5.1ã äžã«æªèª
GoogleãªãŒããŒã䜿çšããŠãããŠãŒã¶ãŒãããå Žåã¯ããããããæªèªã®ã¿ãèŠããæ©èœã«ã€ããŠç¥ã£ãŠããã§ãããã ãããã£ãŠãã¹ããªãŒã å ã«ãŸã èªãã§ããªãã¬ã³ãŒãããªãå Žåã¯ã空çœã®ããŒãžãèŠãŠããŸãã æåã¯ããããã£ãã®ã§ããããã¹ãã®çµæããŠãŒã¶ãŒã¯ãã®æ©èœãæå¹ã«ãªã£ãŠããããšããç¥ããªãããšãããããŸããã 圌ãã¯ããªãã¹ããªãŒã ã空ã§ããã®ãããªãã¬ã³ãŒãããªãã®ãããããŠã©ãã«è¡ãã®ããç解ããŠããŸããã
Davidã¯ãéåžžã«èå³æ·±ã解決çãææ¡ããŸãããæªè§£æ±ºã®ãšã³ããªãäžçªäžã«è¡šç€ºãããèªã¿åããããšã³ããªãåçŽã«è¡šç€ºãããªããªããŸãã ãããŠããããæé©ã«ãã€ãŸããã©ã«ãã«å®è£ ããæ¹æ³ã«ã€ããŠé è³ãå£ãã®ã«æ°æ¥ããããŸããã
çµè«ïŒ
No-SQLã¯ãé床ãšã¹ã±ãŒã©ããªãã£ã®ç¹ã§åªããŠããŸãã ããããäžèŠäºçŽ°ãªããšã®ããã«æããŸããã圌ãšã®ããåãã¯éåžžã«é£ããããšãããããŸããã
éæ£èŠåã¯è¯ãã§ãã äžéšã®ã«ãŠã³ã¿ãŒãããã¯ããŠã³ããããšããåé¡ãèæ ®ããå¿ èŠã¯ãããŸããã ãã ããéæ£èŠåããŒã¿ã®å Žåã¯ãå®å šãªåèšç®æ©èœãå¿ èŠã§ãïŒãã¡ãããããã¯ã°ã©ãŠã³ãã§ïŒã
mongodbã®M / Rã¯ãŸã çç£çšã®ãŸãŸã§ãã å°ããã¹ãããåŸãåäœäžã«ãã¹ãŠãå°çã«ãããã¯ããããšãå€æããŸããã ããŒãžã§ã³1.6ã§ã¯ãéçºè ã¯ãããæ¹åããããšãçŽæããŸãã ãããŸã§ã®ãšããã圌ãªãã§ã
ã¹ããŒãã¬ã¹ã決å®ããŸãã
8.å ±æ
ããã¯ãèªã¿åãå¯èœãªã¹ããªãŒã ããããŒãžãžã®ã¬ã³ãŒããåãé€ãããšãã§ããé¢æ°ã§ãã ç°¡åã«èšãã°ãããã¯ãããŸããŸãªãã£ãŒããèªãã§ããæš©åšè AããGRã®å ±æã¢ã€ãã ãšåæ§ã«ãç¹å®ã®ãšã³ããªïŒãã¡ãããæãèå³æ·±ãæçšãªãã®ïŒãã¹ããªãŒã ã«å³åº§ã«ä¿åã§ããããšãæå³ããŸãã ãŸããä»ã®ãŠãŒã¶ãŒã¯ããå ±æã¢ã€ãã ãã¹ããªãŒã ãšä»»æã®ãã£ãŒããçŽæ¥è³Œèªãããªãã·ã§ã³ãéžæã§ããŸãã
åœç€Ÿã®ãµãŒãã¹ã®äž»ãªæŠå¿µã®1ã€ã¯ãæ å ±ã®äŸ¿å©ãªé åžã§ãã ç§ã«ãšã£ãŠæè¡çã«éåžžã«èå³æ·±ãä»äºã¯ãå ±æãã§ãŒã³ã®æ§ç¯ãå®è£ ããããšã§ããã Mongodbã¯ããã®ã¹ããŒãã¬ã¹ããããã£ãæ¬åœã«å©ããŸããã
èå³æ·±ãç¹ïŒ
Googleã¯æè¿ãããºã®æ°ããReShareæ©èœãçºè¡šããŸããã ããã§ããããå°ãèæ¯ããšãããã®èšäºïŒåç §ïŒã§ã4ãæåã«Davidãšç§ãå¯æ¥ã«è°è«ããç¹ã«åºäŒããåãçµè«ã«éããŸããã å ±æã®å®è£ ã¯éåžžã«è¿ãã§ãã
9. Node.jsãããã¯ã°ã©ãŠã³ãããã¥ãŒ
åœåãããŒã¢ã³ã¯PHPã§äœæãããŠããŸããããéåžžã«æ²ãã£ãŠããŸããã ãããŠãmongodbãé€ãã°ãããã¯ã¢ããªã±ãŒã·ã§ã³ã§ç§ã«ãšã£ãŠæãæããªå Žæã§ããããªããªããerenerã¯ãã®ãããªããšãæå³ããŠããªãããã§ãã
ããããnode.jsã«åºäŒã£ããšãïŒãã£ã2é±éåïŒãéãæãå§ããåã³éãã«ãç ãããŸããã ãããåé¡ã¯ãPHPã«æ¢ã«å®è£ ãããŠãããã¹ãŠã®ããã¯ã°ã©ãŠã³ãã³ãŒãïŒãã£ãŒããã«ããã£ã¹ã«ããªãŒããã£ãŒãæ å ±ïŒãæžãæãããšãã§ã¯ãªãã£ããšããããšã§ããã
ããŒãã®æ©èœãéåžžã«ç°¡åã«éžãã çµæã劥åæ¡ã§ããåããã»ã¹ã«è³ããŸããã
9.1ã ãã¥ãŒãããŒãžã£ãŒ
ãããæåã®ããŒãããŒã¢ã³ã§ãã ãã®ã¿ã¹ã¯ã¯ãè¡ãèªã¿åããã¿ã¹ã¯ãã¯ãŒã«ãŒã«é åžããäœæ¥ã®ããã»ã¹ãç£èŠããããšã§ãã
- 1人ã®ãããŒãžã£ãŒãå€ãã®ãã¥ãŒãåŠçã§ããŸã
- ã·ã¹ãã å ã®ãããŒãžã£ãŒã¯ããµãŒããŒããšã«1ã€ãå¿ èŠãªæ°ã ãå®è¡ã§ããŸãã
- ããããç¬èªã®æ¹æ³ã§æ§æã§ããŸããããšãã°ãç°ãªããããŒãžã£ãŒãç°ãªããã¥ãŒã®ã»ãããæäœã§ããŸãã
- ãã¥ãŒã®æ§æã¯ç°ãªãå Žåãããã次ã®ãã©ã¡ãŒã¿ãŒããããŸã
- åæã«åãã¯ãŒã«ãŒã®æ倧æ°ïŒå®éã®æ°ã¯è² è·ã«å¿ããŠèª¿æŽãããŸãïŒ
- ã¿ã¹ã¯ãããã¡ãŒã®ãµã€ãºïŒã¿ã¹ã¯ã®çš®é¡ãšã¯ãŒã«ãŒã®æ°ã«å¿ããŠæ§æããå¿ èŠããããŸãïŒ
- ã¯ãŒã«ãŒã®æ倧ã¢ã€ãã«æéïŒã¢ã€ãã«æéã®å Žåãèªåçã«ã¡ã¢ãªãåé€ããŠè§£æŸããŸãïŒ
- ã¯ãŒã«ãŒã®æ倧寿åœïŒphp-cliã®å Žåãé·ãçããŠã¯ãããŸãããæã åèµ·åããæ¹ãè¯ãã§ãããïŒ
- ã¯ãŒã«ãŒã®æ倧ã¡ã¢ãªäœ¿çšéïŒè¶ éãããšããã«ãkillïŒ
- ã¿ã¹ã¯å®è¡ã®ã¿ã€ã ã¢ãŠãïŒã¿ã¹ã¯å®è¡äžã«ã¯ãŒã«ãŒãã¹ã¿ãã¯ããå Žåãããã匷å¶çµäºããã¿ã¹ã¯ããã¥ãŒã«æ»ããŸãïŒ
- ã¿ã¹ã¯ã倱æããå¯èœæ§ã®ããåæ°
- ãã¥ãŒããã¿ã¹ã¯ãéžæããããšãããã¯ãèšå®ãããŸãïŒããã¯ã«ã¯memcacheã䜿çšãããŸãïŒ
- ã¿ã¹ã¯ã«çµæãããå Žåãmemcacheã«ä¿åãããŸã
- åãã¥ãŒã«ã¯ç¬èªã®ã¯ãŒã«ãŒããããç¹å®ã®ã€ã³ã¿ãŒãã§ã€ã¹ãæã€jsã¯ã©ã¹ã§ããå¿
èŠããããŸã
- çŸæç¹ã§ã¯ããã®ãããªãã®ã1ã€ã ãåäœããŸã-ã€ã³ããŒãïŒããã«å ã«ãªããŸãïŒ
- php-cliãåããã»ã¹ãšããŠå®è¡ããjsonã§éä¿¡ããWorkerPhp.jsããããŸã
- ãã®ãããªåŽåè ïŒããã»ã¹ïŒã®å¯¿åœã¯1ã€ã®ã¿ã¹ã¯ã§çµããããã§ã¯ãããŸããããããŒãžã£ãŒã¯ããèèªãå¢ããããšæ°ä»ããŠè§£éããããŸã§ã1ã€ãã€å®è¡ã§ããŸãã
- å®éã«ã¯ããã¥ãŒããšã«4ã€ãè¶ ããphpããã»ã¹ãåæã«éå§ãããŸãã
- POSIXã·ã°ãã«ãç解ãã
- æ£ããå®äºããå ŽåïŒ-9ã匷å¶çµäºããªãã§ãã ããïŒããã¹ãŠã®ã¿ã¹ã¯ãã¡ã¢ãªãããã¥ãŒã«ãã¡ããšè¿ããŸã
- åãããŒãžã£ãŒã¯ãREPLã€ã³ã¿ãŒãã§ãŒã¹ã§ããŒããéããŸããããŒããéããŠãã©ã®ããã«äœæ¥ããŠããããå°ããããšãã§ããŸãã ãŸãããã®å Žã§åèµ·åããã«æ§æãå€æŽããããšãã§ããŸãã
ãããŠããã®ãã¹ãŠ-500è¡ã®ã³ãŒãïŒã³ã¡ã³ãä»ãïŒã
çµè«ïŒ
ã€ãã³ãI / Oã¯ãã»ãšãã©ã®ãµãŒããŒã¢ããªã±ãŒã·ã§ã³ãåäœããããã«å¿ èŠãªæ¹æ³ã§ãã ããã¯ã¯ãæ¬åœã«å¿ èŠãªå Žæã«ã®ã¿é 眮ããå¿ èŠããããŸãã
ããŒããä»ããŠphpããããã·ãããšãè¯ãçµæãåŸãããæéãç¯çŽã§ããŸããã
å€æ°ã®äœæ¥ã¯1ã€ã®ããã»ã¹ã®ã¿ã§åŠçãããŸãïŒphp-cliã¯ã«ãŠã³ãããŸããïŒã JSã¯ãŒã«ãŒã¯ããã§éåæã«éåžžã«çªç¶äœæ¥ããŸãã
9.2ã ã³ã³ãããŒã©ãŒ-ãããªãã·ã¥/ãµãã¹ã¯ã©ã€ããã
å€ãã®å Žåããã«ã¯ã¿ã¹ã¯ïŒããšãã°100ïŒã䞊åã§ãããã«ã¯éåæã§å®è¡ããå¿ èŠããããŸãã ããããç·ã¯ãã©ãã¯ããŒã«ã§ãã ããã«100åã®ã¿ã¹ã¯ãéä¿¡ããŸã...ãããŠãçµæãåŸãããã«2åç®ã«memcacheã«é£çµ¡ããããšããããäžå©çã§ãã
ããã§ããã¥ãŒããã€ãã¹ã§ããŸãããœã±ããã䜿çšããŠãããŒãžã£ãŒã«çŽæ¥é£çµ¡ãããããŒãžã£ãŒã«ãããã®ã¿ã¹ã¯ãå®äºããããã«äŸé ŒããŠãåãæ¥ç¶ã§å¿çãåŸ ã€ããšãã§ããŸãã ãããããã®ãªãã·ã§ã³ã¯é©åã§ã¯ãããŸãããäœå人ãã®ãããŒãžã£ãŒãããå¯èœæ§ããããã©ã®ãããŒãžã£ãŒã«é£çµ¡ã§ãããããããŸãã...èŠããã«ãããã¯ééã£ãŠããŸãã
ãããŠãã³ã³ãããŒã©ãŒïŒããŒãïŒãäœæããŸããã éåžžãã·ã¹ãã å šäœã§å¯äžã®ãã®ã§ãããã¹ããŒã«ãšåããããã·ã³ãã«ã§ãïŒ
- ãã¹ãŠã®ãããŒãžã£ãŒãã³ã³ãããŒã©ãŒãšã®æ°žç¶çãªæ¥ç¶ãéããŸã
- ã¿ã¹ã¯ã®çµæãŸãã¯ãã¡ã€ã«ã®å ŽåããããŒãžã£ãŒã¯ã³ã³ãããŒã©ãŒã«è©³çŽ°ãéç¥ããŸã
- ãäžæ¹ã§ãããã«æ¥ç¶ããç¹å®ã®ã¿ã¹ã¯ãŸãã¯ã¿ã¹ã¯ãªã¹ãããµãã¹ã¯ã©ã€ãã§ããŸãã
- ã¿ã¹ã¯ã«é¢ããæ å ±ãå°çãããšãã³ã³ãããŒã©ãŒã¯ãã¹ãŠã®ãµãã¹ã¯ã©ã€ããŒã«éç¥ããŸã
- å å ¥è ãå€ãã®ã¿ã¹ã¯ãæåŸ ããŠããå Žåãã³ã³ãããŒã©ãŒã¯å°çæã«éç¥ããŸã
- PHPçšã®ã¯ã©ã€ã¢ã³ãããããŸãïŒããããã³ã°ïŒ
- ã¬ããŒãžã³ã¬ã¯ã·ã§ã³
çµè«ïŒ
ãããªãã·ã¥/ãµãã¹ã¯ã©ã€ãã¹ããŒã ã¯ãéããããã³ã°ç°å¢ã§éåžžã«å¹æçã§ãã
100ããŒã»ã³ãã®çµæã¯å¿ èŠãããŸããã çµå±ã100ã®ãã¡5ã€ã®ã¿ã¹ã¯ãäœããã®çç±ã§å®äºããªãã£ãå ŽåãååãšããŠããã¯æããããªããäœæ¥ãç¶ããŸãã
9.3ã Feed-updaterïŒããã¯ã°ã©ãŠã³ãæŽæ°ïŒ
ããŒãããã»ã¹ãã·ã¹ãã å šäœã«1ã€ã å®æçã«ããŒã¿ããŒã¹ã«æ¥ç¶ããæŽæ°ãå¿ èŠãªãã£ãŒãã®ãªã¹ããïŒTTLããŒã¿ã䜿çšããŠïŒåä¿¡ãããããããã¥ãŒã«ã¹ããŒããŸãã
9.4ã ãã¥ãŒ
競åç¶æ ãåé¿ããããã«ãåã¿ã¹ã¯ã«å¯ŸããŠäžæã®md5èå¥åãçæãããŸãã ãã®èå¥åã¯ãã¥ãŒã«é 眮ããããã®ã¿ã¹ã¯èªäœã®ããŒã¿ã¯memcachedã«ãããŸãã ã»ãŒãã¹ãŠã®ã¿ã¹ã¯ã®ãµã€ãºã¯åºå®ãããŠããããmemcacheqã¯ããã«å¯Ÿå¿ããŠããªãããããããã¹ãã§ã¯ãããŸããã ãããŒãžã£ãŒãã¿ã¹ã¯ãååŸãããšãããã¯ãèšå®ããŸããããã¯ãmemcachedãšã³ããªã§ããããŸãã ããã«ãããå®è¡äžã«åãã¿ã¹ã¯ã®ãã¥ãŒã«çŽæ¥åå ¥ããããšãåé¿ã§ããŸãã
ãã®å Žåã®memcachedã¯ä»ã®ç®çã§äœ¿çšããããããRedisããã®ãã¹ãŠã®ä»£æ¿ãšããŠæ€èšããäºå®ã§ãã 圌ãåããå Žåãè¡å šäœã倱ãããŸãã
ãŸãããã¥ãŒããŠãŒã¶ãŒãšã·ã¹ãã ã®2ã€ã®ã°ã«ãŒãã«åããŸããã æåã¯åªå äºé ã§ãã
ããã«ããããŠãŒã¶ãŒã¿ã¹ã¯ã劚ããããšãªããããã¯ã°ã©ãŠã³ãã¢ããããŒã¿ã§äœ¿çšãããfeed-pull-sysãè¿œå ãããŸããã
çµè«ïŒ
ãã®å®è£ ã¯ãŸã éåžžã«ç²éã§ãã
ãã¥ãŒã¯ããããããããã³ã«åŸ©å ããå¿ èŠããããŸãã
ããé«åºŠãªããã¯ã·ã¹ãã -ãã¥ãŒããã¯ã¹ã䜿çšããå¿ èŠããããŸããïŒ
ãŠãŒã¶ãŒããã»ã¹ãšããã¯ã°ã©ãŠã³ãããã»ã¹ã«ã¯ãç°ãªãåªå é äœãå¿ èŠã§ãã
10.ã€ã³ããŒã/ãšã¯ã¹ããŒã
ããã§ç§ãã話ããããå¥ã®èå³æ·±ãç¹ããããŸãã OPML圢åŒã§ã®ã€ã³ããŒã/ãšã¯ã¹ããŒãããµããŒãããã«ã¯ããã¹ãŠã®é©åãªãªãŒããŒãå¿ èŠã§ãã ããããå®éã«ã¯ãäžéšã®ãŠãŒã¶ãŒã¯ãŸã ã·ã¹ãã ã«ãªãæ°çŸã®ãã£ãŒãã§opmlãã¢ããããŒãã§ããŸãã ãããŠã圌ã¯ãããããã¹ãŠããŒãããããŸã§åŸ ããªããã°ãªããŸããã ããã§ããåæã«åæ°äººã®ãã®ãããªäººã ããããããããŸããã
ããŒããä¿åãããŸãã ãã€ã³ããŒãããšåŒã°ããæ°ããã¯ãŒã«ãŒããããŸãïŒçŸæç¹ã§ã¯ãäžåºŠã«æ倧10ãŸã§åäœã§ããŸãïŒã opmlãã¡ã€ã«ãããŠã³ããŒãããŠæ€èšŒããåŸãphpã¯ã¿ã¹ã¯ããã¥ãŒã«æå ¥ãããŠãŒã¶ãŒãã€ã³ã¿ãŒãã§ã€ã¹ã®é²è¡ç¶æ³ããŒã«æ»ããŸãã äžæ¹ããã€ã³ããŒããã¯ãããã£ãŒããã«ããã¥ãŒå ã®å°ããªã¿ã¹ã¯ãããã¯ã¢ããããŠåæ£ããããã®åŸãã«ãŠã³ã¿ãŒãæŽæ°ããªããã³ã³ãããŒã©ãŒããå®è¡ãããã®ãåŸ ã¡ãŸãã ãŸãããŠãŒã¶ãŒã«ã¯ãã¹ã ãŒãºã«é²è¡ããé²è¡ç¶æ³ããŒã衚瀺ãããŸãã äœã§ã圌ã¯ãã®ããŒãžãé¢ããŠãæ£æ©ãããŠããããŠæ»ãããšãã§ããŸãã ããã
IIIã çµè«
- èªè»¢è»ãäœããªãã§ãã ããã ã»ãšãã©ãã¹ãŠã®ã¿ã¹ã¯ã«ã€ããŠããããã«é©åãããå¿ èŠãããæ¢è£œã®ãœãªã¥ãŒã·ã§ã³ãæ¢ã«ååšããŸãã
- æçµçã«ãŠãŒã¶ãŒã«ãšã£ãŠè£œåãåçŽã«ãªãã»ã©ããã®å®è£ ã¯é£ãããªããŸãã ãšããã§ãæ¶è²»è ã¯ããã«æ°ä»ããªãã§ãããã
- èªåãé倧è©äŸ¡ããªãã§ãã ããã æ人åã補åãã1é±éã§ãç¬ç«ããŠäœæããããšã¯ã§ããŸããïŒãã®èšèã¯å¥œãã§ã¯ãããŸãããïŒã
- åæ©ã¯ãããããæã«ã¯äžå¯èœãè¡ããŸãã
- 補åãå®ç§ã«ãªãããšã¯ãããŸããã åäœããã¢ããªã±ãŒã·ã§ã³ã¯ãåžžã«æéãšå質ã®åŠ¥åç¹ã§ãã
- èªåã§äœæ¥ããå ŽåãããŒã ã®ãã¬ã€ã³ã¹ããŒãã³ã°ã¯éåžžã«äžè¶³ããŠããŸãã å¯èœãªéãéåçãªå¿ã䜿ã䟡å€ããããŸãã
- ã³ã³ããã¹ãã®åãæ¿ãã«ã¯æéãããããŸãã 1人ã®éçºè ãããé¡äŒŒããã¿ã¹ã¯ã«åŸäºããŠããå Žåãããã¯ã¯ããã«å¹æçã§ãã
- ã¹ã¿ãŒãã¢ãããããŠãã¢ã€ãã¢ãããããã«å ã«é²ãã€ãããªããç§ç掻ãšéææ¥ã®ããŒã«ãå¿ããŠãã ããã
䞊è¡ããŠãæ¥é±äžã«åééã®æã¡äžããçºè¡šããããšæããŸãã
ç§ã®ååã¯ãå æ¥å¥ã®èšäºã§ãããžã§ã¯ãã«ã€ããŠæžããŸãã
æè¡çãªã³ã¡ã³ããã¢ããã€ã¹ã建èšçãªæ¹å€ã«æè¬ããŸãã