éçºè
ã¯æãå¥åŠãªããšã«å€¢äžã§ãã ç§ãã¡ã¯çãè¶
åççãªååšãèããããšã奜ã¿ãŸãããç¹å®ã®ãã¯ãããžãŒãéžæããããšã«ãªããšãããçš®ã®çæ°ã«é¥ããHackerNewsã®ã³ã¡ã³ãããããã€ãã®ããã°ã®æçš¿ã«ã¹ãããããŸããå
ã
æ¢ããŠãããã®ãå®å
šã«å¿ããŠããŸã£ãã®ã§ããã®åã«æãæããå
æºã«åãã£ãŠé 調ã«èªè¡ããŠããŸãã
ããã¯ãåççãªäººã
ã決å®ãäžãæ¹æ³ã§ã¯ãããŸããã ãããããŸãã«ãã®ãããéçºè
ã¯ãããšãã°MapReduceã䜿çšããããšã«ããŸããã
ãžã§ãŒã»ãã©ãŒã¹ã¿ã€ã³ãåŠå£«å·ããŒã¿ããŒã¹ã«é¢ããè¬çŸ©ã§ææããããã« ïŒ54åïŒïŒ
å®éããã®ãããªéå¿çãªã¿ã¹ã¯ãå®è¡ããäŒæ¥ã¯äžçã«çŽ5瀟ãããŸãã ä»ã®ãã¹ãŠã®äººãšåæ§ã«...圌ãã¯ã·ã¹ãã ã®åŒŸåæ§ã確ä¿ããããã«ä¿¡ããããªãã»ã©ã®ãªãœãŒã¹ãè²»ãããŸãã 2000幎代ã«ã¯ãGoogleãã®ãããªãã®ããããŸããããGoogleã¯äžçæ倧ã®ããŒã¿åŠçãµãŒãã¹ã管çããŠãããããGoogleãšãŸã£ããåãããã«ãã¹ãŠãè¡ããŸã...ã[ç®èãªããšã«é ãæ¯ã£ãŠèŽè¡ã®ç¬ã声ãåŸ
ã€]
ããŒã¿ã»ã³ã¿ãŒã®å»ºç©ã®äœéã§ããïŒ Googleã¯ãå°ãªããšããªã¯ã©ããå·ã¡ã€ãºé¡ã«ãããã®ç¹å®ã®ããŒã¿ã»ã³ã¿ãŒã§ã¯ã4ã«ãšã©ãŸãããšã«ããŸããã
ã¯ããããªãã®ã·ã¹ãã ã¯ããªããå¿
èŠãšãããããå埩åããããŸããããããäœãç ç²ã«ãããèããŠãã ããã ãã€ã³ãã¯ã倧éã®ããŒã¿ãåŠçããå¿
èŠãããã ãã§ã¯ãããŸããã ããããããã©ã³ã¶ã¯ã·ã§ã³ãã€ã³ããã¯ã¹ãã¯ãšãªæé©åãåããå®å
šãªã·ã¹ãã ããæ¯èŒç匱ããã®ãšäº€æããŠããã§ãããã ããã¯å€§ããªåŸéã§ãã äœäººã®HadoopãŠãŒã¶ãŒããããæèçã«è¡ããŸããïŒ æ¬åœã«ãã©ã³ã¹ã®ãšãã決å®ãäžãã®ã¯äœäººã§ããïŒ
MapReduce / Hadoopã¯éåžžã«ç°¡åãªäŸã§ãã ã«ãŒãŽã«ã«ãã®ä¿¡å¥è
ã§ãããé£è¡æ©ããã¹ãŠã®åé¡ã解決ããããã§ã¯ãªãããšããã§ã«èªèããŠããŸãã ããã«ãããããããMapReduceã䜿çšãããšãéèŠãªäžè¬åãè¡ãããšãã§ããŸãã倧äŒæ¥åãã«äœæããããã¯ãããžãŒã䜿çšããåæã«å°ããªåé¡ã解決ããå Žåã¯ã軜çã«è¡åããŠããå¯èœæ§ããããŸãã ããã§ãªããŠããGoogleãAmazonã®ãããªå·šäººãæš¡å£ãããšããç¥ç§çãªã¢ã€ãã¢ã«å°ãããå¯èœæ§ãæãé«ããåãé«ãã«å°éããŸãã
ã¯ãããã®èšäºã¯ã«ãŒãŽã«ã«ãã®å察è
ã§ãã ããããåŸ
ã£ãŠãã ãããç§ã¯ããªãã®ããã«ãããå€ãã®æ
å ±ã«åºã¥ãã決å®ãäžãããã«äœ¿çšã§ãã䟿å©ãªãã§ãã¯ãªã¹ããçšæããŠããŸãã
ã¯ãŒã«ãªãã¬ãŒã ã¯ãŒã¯ïŒUNPHAT
次åãã·ã¹ãã ãïŒåïŒåœ¢æããããã®æ°ããã¯ãŒã«ãªãã¯ããã¯ãGoogleã§æ€çŽ¢ãããšãã¯ãåæ¢ããŠUNPHATãã¬ãŒã ã¯ãŒã¯ã䜿çšããããšããå§ãããŸãã
- ïŒç解ïŒåé¡ãç解ããåã«ãå¯èœãªè§£æ±ºçã«ã€ããŠèããããšããããªãã§ãã ããã ããªãã®äž»ãªç®æšã¯ããœãªã¥ãŒã·ã§ã³ã®èŠ³ç¹ã§ã¯ãªããåé¡ã®èŠ³ç¹ããåé¡ãã解決ãããããšã§ãã
- ããã€ãã®å¯èœãªãœãªã¥ãŒã·ã§ã³ããªã¹ãïŒeNumerateïŒããŸãã ããã«ãæ°ã«å
¥ãã®ãªãã·ã§ã³ã«æãåããå¿
èŠã¯ãããŸããã
- å¥ã®è§£æ±ºçãæ€èšããããããã°ããã¥ã¡ã³ãïŒPaperïŒãèªãã§ãã ããã
- ãã®ãœãªã¥ãŒã·ã§ã³ãäœæãããå±¥æŽã³ã³ããã¹ããå®çŸ©ããŸã ã
- Flawsãšå©ç¹ãäžèŽãããŸãã ææ決å®è
ãç®æšãéæããããã«ç ç²ã«ããªããã°ãªããªããã®ãåæããŸãã
- èããïŒèããïŒ ïŒ ãã®ãœãªã¥ãŒã·ã§ã³ãããªãã®ããŒãºãæºããã®ã«ã©ãã ãé©ããŠããããèœã¡çããŠéãã«èããŠãã ããã å¿ãå€ããããã«äœãå€ããå¿
èŠãããã®ã§ããããïŒ ããšãã°ãHadoopã䜿çšããªãããã«ããã«ã¯ãããŒã¿ãã©ãã ãå°ãªãããå¿
èŠããããŸããïŒ
ããªãã¯ã¢ããŸã³ã§ã¯ãããŸãã
UNPHATã®äœ¿çšã¯ç°¡åã§ãã å€ã«ããŠã³ããŒãããããŒã¿ãéäžçã«èªã¿åãããã»ã¹ã«Cassandraã䜿çšããããšã«æ¥ãã§æ±ºããäŒç€Ÿãšã®æè¿ã®äŒè©±ãæãåºããŠãã ããã
ç§ã¯ãã§ã«Dynamoã®ããã¥ã¡ã³ãã«ç²ŸéããŠãããCassandraã掟çã·ã¹ãã ã§ããããšãç¥ã£ãŠããããããããã®ããŒã¿ããŒã¹ã§ã¯äž»ã«èšé²æ©èœã«çŠç¹ãåœãŠãŠããããšã«æ°ä»ããŸããïŒAmazonã¯ãã«ãŒãã«è¿œå ãã¢ã¯ã·ã§ã³ã倱æããŸããã§ããïŒã ãŸããéçºè
ãããŒã¿ã®æŽåæ§ãç ç²ã«ããããšããããŠå®éãåŸæ¥ã®RDBMSã«åºæã®ãã¹ãŠã®æ©èœãè©äŸ¡ããããšã«ãæè¬ããŠããŸãã çµå±ã®ãšãããç§ã話ãããäŒç€Ÿã§ã¯ãé²é³ããèœåã¯åªå
äºé
ã§ã¯ãããŸããã§ããã æ£çŽãªãšããããã®ãããžã§ã¯ãã¯1æ¥ã«1ã€ã®å€§ããªã¬ã³ãŒããäœæããããšãæå³ããŠããŸããã
ã¢ããŸã³ã¯ãã¹ãŠã販売ããŠããŸãã ããã¹ã±ããã«è¿œå ãæ©èœãçªç¶æ©èœããªããªã£ãå Žåãå€ãã®ãéã倱ããŸãã åãé åºã®åé¡ããããŸããïŒ
ãã®äŒç€Ÿã¯ãåé¡ã®PostgreSQLã¯ãšãªãå®äºããã®ã«æ°åããã£ããããCassandraã䜿çšããããšã決å®ãããããã¯ããŒããŠã§ã¢ã®æè¡çãªå¶éã§ãããšå€æããŸããã ããã€ãã®ç¹ãæ確ã«ããåŸãããŒãã«ã¯ãããã80ãã€ãã®çŽ5,000äžè¡ã§æ§æãããŠããããšãããããŸããã SSDããå®å
šã«èªã¿åãå¿
èŠãããå ŽåãSSDããèªã¿åãã®ã«çŽ5ç§ããããŸãã ããã¯äœéã§ããããã®æç¹ã§ã®ã¯ãšãªå®è¡é床ããã2æ¡é«éã§ãã
ãã®æ®µéã§ãç§ã¯å€ãã®è³ªåãããŸããïŒU =ç解ããåé¡ãç解ããŸãïŒïŒãããŠãå
ã®åé¡ã解決ã§ãã5ã€ã®ç°ãªãæŠç¥ãæ€èšãå§ããŸããïŒN = eNumerateãå¯èœãªè§£æ±ºçãããã€ãæããŠãã ããïŒïŒããããããããã«ããŠãCassandraã䜿çšããããšãæ ¹æ¬çã«ééã£ã決å®ã§ããããšã¯ãçŸæç¹ã§ã¯ãã§ã«æããã§ããã 圌ããå¿
èŠãšããã®ã¯ãèšå®ããããã®å°ãã®å¿èãããããããŒã¿ããŒã¹ã®æ°ããèšèšãšãããããïŒå¯èœæ§ã¯äœãã§ããïŒå¥ã®ãã¯ãããžãŒã®éžæã§ãã...ããããéäžçãªèšé²ãåããããŒããªã¥ãŒããŒã¿ã¹ãã¬ãŒãžã§ã¯ãããŸããAmazonããã¹ã±ããçšã«äœæãããã®ïŒ
ããªãã¯LinkedInã§ã¯ãããŸãã
ããåŠçã®ã¹ã¿ãŒãã¢ããããKafkaãäžå¿ã«ãã®ã¢ãŒããã¯ãã£ãæ§ç¯ããããšã決ããããšã«éåžžã«é©ããŸããã ããã¯ãããã£ãã ç§ãç¥ãéãã圌ãã®ããžãã¹ã¯1æ¥ã«æ°å件ã®éåžžã«å€§èŠæš¡ãªæ¥åããè¡ã£ãŠããŸããã§ããã ããããæãæåããæ¥ã«æ°çŸã ãã®åž¯åå¹
ã«ãããã¡ã€ã³ããŒã¿ãŠã§ã¢ããŠã¹ã¯æ®éã®æ¬ã®ææžãå
¥åã«ãªããŸãã
æ¯èŒã®ããã«ãKafkaã¯LinkedInã®ãã¹ãŠã®åæã€ãã³ããåŠçããããã«äœæãããããšãæãåºããŠãã ããã ããã¯èšå€§ãªéã®ããŒã¿ã§ãã æ°å¹Žåã§ãããããã¯1æ¥ã«çŽ1å
ã€ãã³ãã§ãããããŒã¯è² è·ã¯1ç§ããã1,000äžã¡ãã»ãŒãžã§ããã ãã¡ãããKafkaã䜿çšããŠããäœãè² è·ã§äœæ¥ã§ããããšãç解ããŠããŸããã10ãªãŒããŒå°ãªãã§ããïŒ
倪éœã¯éåžžã«å€§ããªç©äœã§ãããå°çããã6æ¡éãã ãã§ãã
ãããããéçºè
ã¯ãäºæ³ãããããŒãºãšKafkaã®ç®çã®ååãªç解ã«åºã¥ããŠãæ
éãªæ±ºå®ãäžããããšããããŸãã ãããã圌ãã¯ã«ãã«ã«å¯ŸããïŒéåžžã¯æ£åœåãããïŒã³ãã¥ããã£ã®ç±æã«ãã£ãŠããã掻æ°ã¥ãããããããæ¬åœã«åœŒããå¿
èŠãšããããŒã«ã§ãããã©ããã»ãšãã©çåã«æããªãã£ããšæããŸãã æ³åããŠã¿ãŠãã ãã... 10泚æïŒ
ãã§ã«èšã£ãïŒ ããªãã¯ã¢ããŸã³ã§ã¯ãããŸãã
Amazonã®åæ£ããŒã¿ãŠã§ã¢ããŠã¹ãããããã«äººæ°ãããã®ã¯ãã¹ã±ãŒã©ããªãã£ãæäŸããã¢ãŒããã¯ãã£èšèšã¢ãããŒããã€ãŸããµãŒãã¹æåã¢ãŒããã¯ãã£ã§ãã 2006幎ã®ãžã ã°ã¬ã€ãšã®ã€ã³ã¿ãã¥ãŒã§ Werner Vogelsãææããããã«ãAmazonã¯2001幎ã«ã€ã³ã¿ãŒãã§ãŒã¹ïŒããã³ããšã³ãïŒã®ã¹ã±ãŒãªã³ã°ãå°é£ã§ããããµãŒãã¹æåã¢ãŒããã¯ãã£ã圹ç«ã€å¯èœæ§ãããããšã«æ°ä»ããŸããã ãã®ã¢ã€ãã¢ã¯æ¬¡ã
ãšéçºè
ã«ææããŸããããã»ãã®æ°äººã®éçºè
ã§ã¯ã©ã€ã¢ã³ããã»ãšãã©ããªãã¹ã¿ãŒãã¢ããã¯ããœãããŠã§ã¢ããããµãŒãã¹ã«åå²ãå§ããŸããã§ããã
AmazonãSOAïŒãµãŒãã¹æåã¢ãŒããã¯ãã£ïŒã«åãæ¿ããããšã決å®ãããŸã§ã«ã çŽ7,800人ã®åŸæ¥å¡ãããã売ãäžãã¯30åãã«ãè¶
ããŠããŸãã ã
ãµã³ãã©ã³ã·ã¹ã³ã®ã³ã³ãµãŒãããŒã«ãã«ã°ã©ãã ãªãŒãã£ããªã¢ã ã«ã¯7,000人ãåžãæ§ããŠããŸãã Amazonã«ã¯ãSOAã«åãæ¿ãããšãã«çŽ7,800人ã®åŸæ¥å¡ãããŸããã
ããã¯ãäŒç€ŸãåŸæ¥å¡7800人ã®ã¬ãã«ã«éãããŸã§SOAãžã®ç§»è¡ã延æããå¿
èŠããããšããæå³ã§ã¯ãããŸãã... åžžã«èªåã®é ã§èããŠãã ãã ã ããã¯æ¬åœã«ããªãã®ã¿ã¹ã¯ã«æé©ãªãœãªã¥ãŒã·ã§ã³ã§ããïŒ ããªãã®åã®ä»äºã¯æ£ç¢ºã«äœã§ããïŒããã解決ããä»ã®æ¹æ³ã¯ãããŸããïŒ
50人ã®éçºè
ã§æ§æãããçµç¹ã®äœæ¥ãSOAãªãã§åçŽã«äžæããããšãæããŠãããå Žåããªãå€ãã®å€§äŒæ¥ãåäžã®ãããçµç¹ãããã¢ããªã±ãŒã·ã§ã³ã䜿çšããŠçŽ æŽãããæ©èœããã®ãçåã«æããŸããã
Googleã§ããGoogleã§ã¯ãããŸããã
è² è·ã®é«ãããŒã¿ã¹ããªãŒã ïŒHadoopãŸãã¯SparkïŒãåŠçããããã®ã·ã¹ãã ã®äœ¿çšäŸã¯ãæ¬åœã«æžæãå¯èœæ§ããããŸãã éåžžã«å€ãã®å ŽåãåŸæ¥ã®DBMSã¯è² è·ã«ããé©ããŠããŸãããŸããããŒã¿éãéåžžã«å°ãªãããã 䜿çšå¯èœãªã¡ã¢ãªã§ãååãªå ŽåããããŸãã ã©ããã§1TBã®RAMã10,000ãã«ã§è³Œå
¥ã§ããããšããåç¥ã§ããïŒ 10å人ã®ãŠãŒã¶ãŒããããšããŠããåãŠãŒã¶ãŒã«1 KBã®RAMãæäŸã§ããŸãã
ãã£ã¹ã¯ãžã®èªã¿åããšæžã蟌ã¿ãå¿
èŠã«ãªããããããããããã¯è² è·ã«å¯ŸããŠååã§ã¯ãããŸããã ããããå®éã«èªã¿æžãããã®ã«æ°åã®ãã£ã¹ã¯ãå¿
èŠã§ããïŒ å®éã«ã©ã®ãããã®ããŒã¿ãæã£ãŠããŸããïŒ GFSãšMapReduceã¯ãã€ã³ã¿ãŒãããå
šäœã®ã³ã³ãã¥ãŒãã£ã³ã°ã®åé¡ã解決ããããã«äœæãããŸãããããšãã°ã ã€ã³ã¿ãŒãããå
šäœã§æ€çŽ¢ã€ã³ããã¯ã¹ãåèšç®ããŸãã
ããŒããã©ã€ãã®äŸ¡æ Œã¯ãGFSã®ããã¥ã¡ã³ããçºè¡ããã2003幎ãããã¯ããã«äœããªããŸããã
GFSãšMapReduceã®ããã¥ã¡ã³ããèªãã§ãGoogleã®åé¡ã®1ã€ã¯ããŒã¿éã§ã¯ãªã垯åå¹
ïŒåŠçé床ïŒã§ããããšã«æ°ä»ããŸããããã£ã¹ã¯ãããã€ãã転éããã®ã«æéããããããããããåæ£ã¹ãã¬ãŒãžã䜿çšããŠããŸããã ããããä»å¹Žäœ¿çšããããã€ã¹ã®åž¯åå¹
ã¯ã©ããªããŸããïŒ Googleãå¿
èŠãšããã»ã©å€ãã®ããã€ã¹ãå¿
èŠãšããªãããšãèãããšãããããããæ°ãããã©ã€ãã賌å
¥ããæ¹ãè¯ãã§ããããïŒ SSDã䜿çšããã«ã¯ã©ããããã®è²»çšãããããŸããïŒ
äºåã«ã¹ã±ãŒã©ããªãã£ãæ€èšãããå ŽåããããŸãã å¿
èŠãªèšç®ã¯ãã¹ãŠå®äºããŠããŸããïŒ SSDã®äŸ¡æ Œãäžãããããæ©ãããŒã¿ãèç©ããŸããïŒ ãã¹ãŠã®å©çšå¯èœãªããŒã¿ã1ã€ã®ããã€ã¹ã«åãŸããªãããã«ãããžãã¹ãäœåæé·ãããå¿
èŠããããŸããïŒ 2016幎ã®æç¹ã§ãStack Exchangeã¯1æ¥ããã2å件ã®ã¯ãšãªãåŠçãã4å°ã®SQLãµãŒããŒã®ã¿ããµããŒãããŠããŸãããã¡ã€ã³ã¯Stack Overflowããã1ã€ã¯ãã¹ãŠããã2ã€ã¯ã³ããŒã§ãã
ç¹°ãè¿ããŸãããUNPHATã«é Œã£ãŠããHadoopãŸãã¯Sparkã䜿çšããããšã決å®ã§ããŸãã ãããŠã決å®ã¯æ£ãããããããŸããã äž»ãªããšã¯ãããªããæ¬åœã«ããªãã®åé¡ã解決ããããã«æ£ããæè¡ã䜿ããšããããšã§ãã ã¡ãªã¿ã«ãããã¯Googleã§ããç¥ãããŠããŸããMapReduceãã€ã³ããã¯ã¹ã«é©ããŠããªããšå€æããããã䜿çšãäžæ¢ããŸããã
ãŸãæåã«ãåé¡ãç解ãã
ç§ã®ã¡ãã»ãŒãžã¯æ°ãããã®ã§ã¯ãªããããããŸãããããã®åœ¢ã§ããªãã«è¿äºããããããããŸããããUNPHATãèŠããŠç掻ã«é©çšããã®ã¯ç°¡åãããããŸããã ããã§ãªãå Žåã¯ã ãã³ã¢ãã¯é§åéçºã«é¢ãããªããããããŒã®ã¹ããŒãããŸãã¯ããŒã«ã®æ¬ãããã解決ããæ¹æ³ ããŸãã¯ããã³ã°ã®ã³ãŒã¹ãç§åŠãšå·¥åŠã®å®è·µã®è¬åº§ãèŠãããšãã§ããŸãã ãªããªãç§ãã¡å
šå¡ãå°ããäž»ãªããšã¯èããããšã ããã§ãïŒ
ãããŠãããªãã解決ããããšããŠããåé¡ãæ¬åœã«ç解ããŠãã ããã ããŠãã®å¿ã«åŒ·ã蚎ããèšèã§ïŒ
ã ç解ã§ããªã質åã«çããã®ã¯æãã§ãã éæããããªãç®æšãç®æããŠåªåããã®ã¯æ²ããããšã§ããã
ãã·ã¢èªç¿»èš³
ç¿»èš³ïŒ ã¢ã¬ã¯ãµã³ããŒã»ãã¬ã°ãã
ã¢ã¬ã¯ã»ã€ã»ã€ã¯ãã ç·šé ïŒ@ponchiknewsïŒ
ã³ãã¥ããã£ïŒ @ponchiknews
å³ïŒ LucidChartã³ã³ãã³ãããŒã