I-TierïŒã¢ããªã¹åæ
æè¿ãç±³åœã§ã®Grouponã®å¹ŽéWebãã©ãã£ãã¯ç§»è¡ãããžã§ã¯ãããã¢ããªã·ãã¯ãªRuby on Railsã¢ããªã±ãŒã·ã§ã³ããæ°ããNode.jsã¹ã¿ãã¯ã«å®äºãã倧ããªææãäžããŸããã
æåãããã¢ã¡ãªã«ã®ããã³ããšã³ãWebããã³ããšã³ãå šäœãRubyã®åäžã®ãœãŒã¹ã³ãŒãã§ããã ããã³ããšã³ãã³ãŒãã¯æ¥éã«éçºããããããæ°ããæ©èœãè¿œå ããããã»ã¹ã®ç¶æãšè€éåãå°é£ã«ãªããŸããã ãã®å·šå€§ãªã¢ããªã¹ã®åé¡ã®è§£æ±ºçãšããŠãããã³ããšã³ããããå°ãããç¬ç«ããã管çããããããŒãã«åå²ããããšã«ãããããã³ããšã³ããåæ§ç¯ããããšã«ããŸããã ãã®ãããžã§ã¯ãã®åºæ¬ã¯ãã¢ããªã·ãã¯Webãµã€ããããã€ãã®ç¬ç«ããNode.jsã¢ããªã±ãŒã·ã§ã³ã«åé¢ããããšã§ããã ãŸããã€ã³ãã©ã¹ãã©ã¯ãã£ãåèšèšããŠããã¹ãŠã®ã¢ããªã±ãŒã·ã§ã³ãé£æºããããã«ããŸããã ãã®çµæãã€ã³ã¿ã©ã¯ã·ã§ã³å±€ïŒI-TierïŒãã§ããŸããã
ãã®ã°ããŒãã«ã¢ãŒããã¯ãã£ç§»è¡ã®ãã€ã©ã€ãã®äžéšã以äžã«ç€ºããŸãã
â¢ãµã€ãäžã®ããŒãžã®èªã¿èŸŒã¿ãã¯ããã«é«é
â¢éçºããŒã ã¯ãæ°ããæ©èœãããè¿ éã«éçºããã³è¿œå ã§ããä»ã®ããŒã ã«ããŸãäŸåããŸããã
â¢Grouponãå©çšå¯èœãªããŸããŸãªåœã§åãæ©èœãåéçºããããšãåé¿ã§ããŸãã
ãã®æçš¿ã¯ãGoogleããµã€ããåæ§ç¯ããæ¹æ³ãšãGroupon瀟ã®çºå±ã®åºç€ãšãªãå°æ¥çã«èŠããã倧ããªå©ç¹ã«é¢ããäžé£ã®æçš¿ã®æåã®ãã®ã§ãã
ç°¡åãªæŽå²
Grouponã¯ããšããšãã·ã«ãŽã®äœæ°ãžã®æ¯æ¥ã®ååŒã衚瀺ãã1ããŒãžã®ãµã€ãã§ããã ãã®ãããªå žåçãªååŒã®äŸãšããŠã¯ãå°å ã®ã¬ã¹ãã©ã³ã®å²åŒãå°å ã®ã³ã³ãµãŒãã®ãã±ããããããŸãã
åãã©ã³ã¶ã¯ã·ã§ã³ã«ã¯ã転æç¹ãããããŸããããã¯ããã©ã³ã¶ã¯ã·ã§ã³ãæå¹ã«ããããã«ãã©ã³ã¶ã¯ã·ã§ã³ãè³Œå ¥ããå¿ èŠãããæå°æ°ã§ãã ååãªæ°ã®äººã転æç¹ã«éããååŒãè³Œå ¥ããå Žåã誰ããå²åŒãåããŸããã ããã§ãªããã°ã誰ããæè ã§ããã
ãã®ãµã€ãã¯å ã ãRuby on Railsã¢ããªã±ãŒã·ã§ã³ãšããŠäœæãããŸããã Railsã¢ããªã±ãŒã·ã§ã³ã¯ãéçºããŒã ã«ãšã£ãŠããµã€ãããã°ããç«ã¡äžããŠç«ã¡äžããæãç°¡åãªæ¹æ³ã®1ã€ã§ãã£ããããæåã¯è¯ãéžæã§ããã ããã«ãRailsã䜿çšããŠæ°æ©èœãå®è£ ããã®ã¯ããªãç°¡åã§ããã ãã®æç¹ã§ã¯ãæ©èœã®ã»ãããåžžã«å¢å ããŠãããããç§ãã¡ã«ãšã£ãŠå€§ããªãã©ã¹ã§ããã
å ã®Railsã¢ãŒããã¯ãã£ã¯éåžžã«ã·ã³ãã«ã§ããã
ãã ããåäžã®ããŒã¿ããŒã¹ã¯ã©ã¹ã¿ãŒã察象ãšããåäžã®Railsã¢ããªã±ãŒã·ã§ã³ã§ã¯ããã¹ãŠã®ãã©ãã£ãã¯ãåŠçããèœåãããã«å€§ãããªããŸããã ããã³ããšã³ããµãŒããŒãšããŒã¿ããŒã¹ã¬ããªã«ãããã«è¿œå ãããã¹ãŠãCDNã®èåŸã«é 眮ããŸããããããã¯ããŒã¿ããŒã¹ãžã®æžã蟌ã¿ãéèŠãªèŠçŽ ã«ãªããŸã§ããæ©èœããŸããã§ããã 泚æåŠçã«ãããããŒã¿ããŒã¹ã«å€æ°ã®ãšã³ããªãçºçããŸããã ãã®çµæããã®ã³ãŒããRailsã¢ããªã±ãŒã·ã§ã³ããå¥ã®ããŒã¿ããŒã¹ã¯ã©ã¹ã¿ãŒã䜿çšããæ°ãããµãŒãã¹ã«ç§»åããããšã«ããŸããã
æ¢åã®ããã¯ãšã³ãã®å²ãåœãŠãæ°ãããµãŒãã¹ã«åå²ããåæ§ã®ãã¿ãŒã³ãç¶ç¶ããŸãããããŠã§ããµã€ãã®ä»ã®ãã¹ãŠïŒãã¥ãŒãã³ã³ãããŒã©ãŒããªãœãŒã¹ãªã©ïŒã¯å ã®Railsã¢ããªã±ãŒã·ã§ã³ã®äžéšã®ãŸãŸã§ããïŒ
ãã®ã¢ãŒããã¯ãã£ã®å€æŽã¯æéã皌ããŸãããããããé·ãã¯ç¶ããªãããšã¯ããã£ãŠããŸããã ãœãŒã¹ã³ãŒãã¯ã以åã®ããã«ãåœæã¯éçºè ã®å°ããªããŒã ã§ãã管çã§ããŸããã§ãããããã«ããããã©ãã£ãã¯ã®ããŒã¯æã«ãµã€ããæ··éããå®ãããšãã§ããŸããã
ã°ããŒããªãŒãŒã·ã§ã³
ãã®é ãGrouponã¯ã°ããŒãã«ã«æ¡å€§ãå§ããŸããã çæéã§ãç±³åœã®ã¿ã§ã®äºæ¥ãã48ãåœã§ã®äºæ¥ã«ç§»è¡ããŸããã ãã®éã«ãCityDealãªã©ã®åœéäŒæ¥ãè²·åããŸããã åè²·åã«ã¯ããã§ã«ç¬èªã®ãœãããŠã§ã¢ã¹ã¿ãã¯ãå«ãŸããŠããŸããã
CityDealã¢ãŒããã¯ãã£ã¯Grouponã¢ãŒããã¯ãã£ãšé¡äŒŒããŠããŸãããå¥ã®ããŒã ã«ãã£ãŠäœæãããå®å šã«èªåŸçãªå®è£ ã§ããã ãã®çµæãèšèšãšæè¡ã«éãããããŸãã-Rubyã®ä»£ããã«Javaãnginxã®ä»£ããã«ApacheãMySQLã®ä»£ããã«PostgreSQLã
ã芧ã®ããã«ãæ¥éã«çºå±ããŠããäŒæ¥ã®å Žåãç°ãªãã¹ã¿ãã¯ã®çµ±åã®ããŒã¹ãé ãããããäž¡æ¹ã®ã·ã¹ãã ããµããŒãããããéžæããå¿ èŠããããŸããã äŒç€Ÿã®ããæ¥éãªçºå±ãšåŒãæãã«ãã¢ã¡ãªã«ãšãšãŒãããã®è²©å£²ãåé¢ãããšããåœéçãªæ±ºå®ãåããŠè¡ããŸããã ãããŠãè²·åãå¢ããã«ã€ããŠãã¢ãŒããã¯ãã£ã«è€éããè¿œå ãããŸããã
ã¢ãã€ã«ã¢ããª
ãŸããiPhoneãiPadãAndroidãããã³Windows Mobileçšã®ã¢ãã€ã«ã¯ã©ã€ã¢ã³ããäœæããŸããã Grouponãå©çšã§ããåœããšã«åå¥ã®ã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ãäœæãããã¯ãããŸããã§ããã 代ããã«ãããã¯ãšã³ããœãããŠã§ã¢ãã©ãããã©ãŒã ã®ããããã®äžã«APIã¬ã€ã€ãŒãäœæããããšã«ããŸããã ã¢ãã€ã«ã¯ã©ã€ã¢ã³ãã¯ããŠãŒã¶ãŒã®åœã«å¯Ÿå¿ããAPIãšã³ããã€ã³ãã䜿çšããŸããã
ç§ãã¡ã®ã¢ãã€ã«ããŒã ã«ãšã£ãŠã¯ããŸããããŸããã 圌ãã¯ãç§ãã¡ã®åœã®ãã¹ãŠã§æ©èœããã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ã§ããŸãã
ãããããŸã åé¡ããããŸããã æ°ãã補åãŸãã¯æ©èœãäœæãããšãã¯ãã€ã§ããæåã«Webçšã«äœæããŠããAPIãäœæããã®ã§ããã®æ©èœã¯ã¢ãã€ã«ããã€ã¹ã§äœ¿çšã§ããŸãã
ç§ãã¡ã®äŒç€Ÿã¯ã¢ã¡ãªã«ã§ååã¢ãã€ã«ã«ãªã£ãã®ã§ããŸãã¢ãã€ã«ã®èãæ¹ãæ§ç¯ããå¿ èŠããããŸãã ãããã£ãŠãæå°éã®éçºåŽåã§ã¢ãã€ã«ã¯ã©ã€ã¢ã³ããšãã¹ã¯ãããã¯ã©ã€ã¢ã³ãã«åå¥ã®ããã¯ãšã³ãã察å¿ã§ããã¢ãŒããã¯ãã£ãäœæããããšèããŠããŸãã
è€åã¢ããªã¹
Grouponã¯æ°ãã補åã®éçºãšçºå£²ãç¶ããŸããããRubyããã³ããšã³ãã®ãœãŒã¹ã³ãŒãã®éã¯å¢å ããŠããŸããã åãã³ãŒãã«åãçµãã§ããéçºè ãå€ãããŸãã ããã¯ãéçºè ãã¢ããªã±ãŒã·ã§ã³ãããŒã«ã«ã§å®è¡ããã®ãå°é£ã«ããã»ã©ã§ããã ãã¹ãã¹ã€ãŒãã®é床ãäœäžããä¿¡é Œæ§ã®äœããã¹ããåé¡ã«ãªããŸããã ãŸãã1ã€ã®ã³ãŒãããŒã¹ã§ãã£ããããã¢ããªã±ãŒã·ã§ã³å šäœãç·æ¥ã«å±éããå¿ èŠããããŸããã 1ã€ã®æ©èœã§ã¯ãªããããŒã«ããã¯ãå¿ èŠãšããéçšç°å¢ã§ãšã©ãŒãçºçããå ŽåãåããŒã ãžã®å€æŽãè¿ãããŸãã ã€ãŸããã¢ããªã·ãã¯ã³ãŒãã«ã¯å€ãã®åé¡ããããŸããã
ããããç§ãã¡ã¯ç¹°ãè¿ãåæ§ã®åé¡ã«çŽé¢ããŠããŸãã ç±³åœã§ã³ãŒããåŠçããå¿ èŠããã£ãã ãã§ãªãããšãŒãããã®ã³ãŒãã§ãåãåé¡ã®å€ããçºçããŸããã ããã³ããšã³ããå®å šã«åæ§ç¯ããå¿ èŠããããŸããã
ãã¹ãŠæžãæãã
ããã³ããšã³ãå šäœãåæ§ç¯ããã®ã¯å±éºã§ãã ããã«ã¯å€ãã®æéãèŠããå€ãã®ç°ãªã人ã ãé¢äžããŸãããããŠãæçµçã«ã¯å€ãã·ã¹ãã ãããè¯ãçµæãåŸãããªã倧ããªå¯èœæ§ããããŸãã ãŸãã¯ãããã«æªãããšã«ãããã¯å€ãã®æéãèŠããããªãã¯éäžã§giveããããã«å€ãã®åªåãè²»ãããŸãããçµæã¯åŸãããŸããã
ããããã€ã³ãã©ã¹ãã©ã¯ãã£ã®å°ããªéšåãåæ§ç¯ãããšããéå»ã«å€§ããªæåãåããŸããã ããšãã°ãã¢ãã€ã«Webãµã€ããšã¯ã©ã€ã¢ã³ãããŒã¿ã«ã®äž¡æ¹ãåªããçµæã§åæ§ç¯ãããŸããã ãã®çµéšã¯è¯ãåºçºç¹ãšãªãããããããããžã§ã¯ãã®ç®æšãèšå®ãå§ããŸããã
ç®æš1ïŒããã³ããšã³ããçµã¿åããã
ããŸããŸãªåœã§åãæ©èœãå®è£ ããå€æ°ã®ãœãããŠã§ã¢ã¹ã¿ãã¯ããããããå¿ èŠãªé床ã§ç§»åã§ããŸããã§ããã ã¹ã¿ãã¯ã®åé·æ§ãæé€ããå¿ èŠããããŸããã
ç®æš2ïŒã¢ãã€ã«ã¢ããªããŠã§ããšåçã«ãã
ç±³åœã®äŒç€Ÿã®çŽååãã¢ãã€ã«ã«ãªã£ãããããã¹ã¯ããããšã¢ãã€ã«ã®ããŒãžã§ã³ãåå¥ã«äœæããäœè£ã¯ãããŸããã§ããã Webãã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ãšåãAPIã䜿çšããå¥ã®ã¯ã©ã€ã¢ã³ãã«ãªãã¢ãŒããã¯ãã£ãå¿ èŠã§ããã
ç®æš3ïŒãµã€ããé«éåãã
ç§ãã¡ã®ãµã€ãã¯ç§ãã¡ãæãã§ãããããé ãã£ãã æ¥ãã§ãµã€ãã®æé·ãå¶åŸ¡ããããšããŠããŸããããç±³åœã®ããã³ããšã³ãã¯æè¡çè² åµãèç©ããŠãããããæé©åãå°é£ã§ããã ãªã¯ãšã¹ããåŠçããããã«å€ãã®ã³ãŒããå¿ èŠãšããªããœãªã¥ãŒã·ã§ã³ãæ¢ããŠããŸããã ã·ã³ãã«ãªãã®ã欲ããã£ãã
ç®æš4ïŒããŒã ãç¬ç«ããŠåé²ã§ããããã«ãã
Grouponãæåã«ããŒã³ãããããšãããµã€ãã¯æ¬åœã«ã·ã³ãã«ã§ããã ãããããã以æ¥ãäžçäžã®ãããããµããŒãããããã«ãéçºããŒã ã«å€ãã®æ°è£œåãè¿œå ããŸããã åããŒã ããä»ã®ããŒã ãšã¯ç¬ç«ããŠãè¿ éã«æ©èœãäœæããã³å±éã§ããããã«ãããã£ãã®ã§ãã ããŒã éã®çžäºäŸåé¢ä¿ãæé€ããå¿ èŠããããŸããããã®çç±ã¯ããã¹ãŠã1ã€ã®ã³ãŒãã«å«ãŸããŠããããã§ãã
ã¢ãããŒã
æåã«ããµã€ãã®åäž»èŠæ©èœãåå¥ã®Webã¢ããªã±ãŒã·ã§ã³ã«å解ããããšã«ããŸããã
Node.jsã«ãã¬ãŒã ã¯ãŒã¯ãæ§ç¯ããŸãããããã«ã¯ããã¹ãŠã®ã¢ããªã±ãŒã·ã§ã³ã«å¿ èŠãªäžè¬çãªæ©èœãå«ãŸããŠãããããããŒã ã¯ãããã®åã ã®ã¢ããªã±ãŒã·ã§ã³ãç°¡åã«äœæã§ããŸããã
泚ïŒNode.jsã䜿çšããçç±
æ°ããããã³ããšã³ãã¬ã€ã€ãŒãæ§ç¯ããåã«ãããã€ãã®ç°ãªããœãããŠã§ã¢ã¹ã¿ãã¯ãè©äŸ¡ããŠãã©ããæé©ããå€æããŸããã
ç¹å®ã®ã¿ã¹ã¯ã®ãœãªã¥ãŒã·ã§ã³ãæ¢ããŠããŸãã-å€ãã®çä¿¡HTTPãªã¯ãšã¹ããå¹ççã«åŠçãããããã®åHTTPãªã¯ãšã¹ãã®ãµãŒãã¹ã«å¯ŸããŠäžŠåAPIãªã¯ãšã¹ããå®è¡ããŸãã çµæãHTMLã«è¿ããŸãã ãŸããèªä¿¡ãæã£ãŠç£èŠãå±éããµããŒãã§ãããã®ãå¿ èŠã§ããã
è€æ°ã®ãœãããŠã§ã¢ã¹ã¿ãã¯ã䜿çšããŠãããã¿ã€ããäœæãããã¹ãããŸããã 詳现ã«ã€ããŠã¯åŸã»ã©è©³çŽ°ãæ²èŒããŸãããäžè¬çã«Node.jsã¯ãã®ç¹å®ã®åé¡ã«é©ããŠããããšãããããŸããã
ã¢ãããŒããç¶ã...
次ã«ãäžéšã«ã«ãŒãã£ã³ã°ã¬ã€ã€ãŒãè¿œå ãããŠãŒã¶ãŒãã¢ã¯ã»ã¹ããããŒãžã«åºã¥ããŠé©åãªã¢ããªã±ãŒã·ã§ã³ã«ãªãã€ã¬ã¯ãããŸããã
Grouponã«ãŒãã£ã³ã°ãµãŒãã¹ïŒGroutãšåŒã°ããïŒãnginxã¢ãžã¥ãŒã«ãšããŠæ§ç¯ããŸããã ããã«ãããç°ãªããµãŒããŒäžã®åãã¢ããªã±ãŒã·ã§ã³ã®ç°ãªãå®è£ éã§A / Bãã¹ããå®è¡ãããªã©ãå€ãã®èå³æ·±ãããšãã§ããŸãã
ãããã®ç¬ç«ããWebã¢ããªã±ãŒã·ã§ã³ããã¹ãŠæ£åžžã«é£æºããããã«ãäžè¬çãªæ§æããµããŒãããA / Bãã¹ãã¢ãŒããå¶åŸ¡ããã¬ã€ã¢ãŠããšCSSã¹ã¿ã€ã«ãå ±æããããã®åå¥ã®ãµãŒãã¹ãäœæããŸããã ãããã®ãµãŒãã¹ã«é¢ãã詳现æ å ±ã¯åŸæ¥æ²èŒããŸãã
ãããã¯ãã¹ãŠAPIã®åã«ãããããã³ããšã³ãã¬ã€ã€ãŒã§ã¯ããŒã¿ããŒã¹ãŸãã¯ããã¯ãšã³ããµãŒãã¹ã«çŽæ¥ã¢ã¯ã»ã¹ããããšã¯ã§ããŸããã ããã«ããããã¹ã¯ãããã¢ããªã±ãŒã·ã§ã³ãšã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ã®äž¡æ¹ã«å¯Ÿå¿ããåäžã®çµ±åAPIã¬ã€ã€ãŒãäœæã§ããŸãã
ããã¯ãšã³ãã·ã¹ãã ã®çµ±åã«åãçµãã§ããŸãããçæçã«ã¯ç±³åœããã³æ¬§å·ã®ãµãã·ã¹ãã ããµããŒãããå¿ èŠããããŸãã ãããã£ãŠãåæã«ã2ã€ã®ããã¯ãšã³ãã§åäœããããã³ããšã³ããéçºããŸããã
çµæïŒ
ç±³åœã®ããã³ããšã³ãã®Rubyããæ°ããNode.jsãžã®ç§»è¡ãå®äºããŸããã å€ãã¢ããªã·ãã¯ããã³ããšã³ãã¯çŽ20ã®åå¥ã®Webã¢ããªã±ãŒã·ã§ã³ã«åå²ããããããããå®å šã«æžãçŽãããŸããã çŸåšã1åãããå¹³å50,000件ã®ãªã¯ãšã¹ããåŠçããŠããŸããããã®ãã©ãã£ãã¯ã¯ããªããŒã·ãŒãºã³äžã«å¢å ãããšäºæ³ãããŸãã ãããŠããã®æ°ã¯ä»ã®48ãåœãããã©ãã£ãã¯ã移åãããããå€§å¹ ã«å¢å ããŸãã
ãããã¯ç§éãæè¿ç¢ºèªããå©ç¹ã§ãïŒ
-ããŒãžã®èªã¿èŸŒã¿ãéããªããŸã-éåžžã¯50ïŒ ã ããã¯ãäžéšã¯ãã¯ãããžãŒã®å€æŽã«ãããã®ã§ãããäžéšã¯ããã¹ãŠã®WebããŒãžãæžãæããŠç©äºãé«éåããæ©äŒããã£ãããã§ãã ãŸããè¿œå ã®å€æŽãè¡ã£ãŠãããããããã§éèŠãªå€æŽãè¡ãäºå®ã§ãã
-å€ãã¹ã¿ãã¯ãããå°ãªãæ©åšã§åãéã®ãã©ãã£ãã¯ãåŠçããŸãã
-ããŒã ã¯ãã¢ããªã±ãŒã·ã§ã³ãžã®å€æŽãç¬ç«ããŠå±éã§ããŸãã
-å€ãã¢ãŒããã¯ãã£ã䜿çšãããããã¯ããã«é«éã«åã ã®æ©èœã®ã³ãŒããå€æŽã§ããŸãã
äžè¬ã«ããã®ç§»è¡ã«ãããéçºããŒã ã¯ããå°ãªãçžäºäŸåé¢ä¿ã§ããŒãžãããéãèªã¿èŸŒãããšãã§ããå€ããã©ãããã©ãŒã ã®ããã©ãŒãã³ã¹ã®å¶éãåãé€ãããŸããã ãã ããå°æ¥çã«ã¯ä»ã®å€ãã®æ¹åãè¡ãäºå®ã§ãããè¿ãå°æ¥ã«è©³çŽ°ãæ²èŒããäºå®ã§ãã
[engineering.groupon.comã®å ã®èšäº ]