翻蚳è
ã®ã¡ã¢ïŒãã®èšäºã¯éåžžã«å€ãïŒ2幎åã«å
¬éãããïŒæåã§ããããªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ãšNoSQLããŒã¿ããŒã¹ã®éãããããã®é·æãšçæãããã³éãªã¬ãŒã·ã§ãã«ãªããžããªã®ç°¡åãªæŠèŠãæäŸããŸãã
æè¿ãå€ãã®éãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ãç»å ŽããŸããã ããã¯ããªã³ããã³ãã§å®è³ªçã«ç¡å¶éã®ã¹ã±ãŒã©ããªãã£ãå¿
èŠãªå Žåãéãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ãå¿
èŠã§ããããšã瀺åããŠããŸãã
ãããåœãŠã¯ãŸãå Žåãããã¯åŒ·åãªãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ãè匱ã«ãªã£ãããšãæå³ããŸããïŒ ããã¯ããªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã®æ代ãéãå»ãããŸããªãå®å
šã«éãå»ãããšãæå³ããŸããïŒ ãã®èšäºã§ã¯ãããŸããŸãªç¶æ³ã«é¢é£ããéãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã®äžè¬çãªåŸåãæ€èšããããããªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã®å°æ¥ã«åœ±é¿ãäžãããã©ããã確èªããŸãã
ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã¯çŽ30幎åããååšããŠã
ãŸã ã ãã®éã«ãããã€ãã®é©åœãåçºãããªã¬ãŒã·ã§ãã«ãªããžããªãçµããããããšã«ãªã£ãŠããã ãã¡ããããããã®é©åœã¯ã©ããèµ·ãããããã®ãã¡ã®1ã€ã¯ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã®äœçœ®ãæºããããŸããã§ããã
åºæ¬ããå§ããŸããã
ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã¯ãããŒãã«ïŒãšã³ãã£ãã£ïŒã®ã³ã¬ã¯ã·ã§ã³ã§ãã ããŒãã«ã¯åãšè¡ïŒã¿ãã«ïŒã§æ§æãããŸãã å¶çŽã¯ããŒãã«å
ã§å®çŸ©ã§ããããŒãã«éã«é¢ä¿ãååšããŸãã SQLã䜿çšãããšã1ã€ä»¥äžã®ããŒãã«ããååŸããããŒã¿ã»ãããè¿ãã¯ãšãªãå®è¡ã§ããŸãã 1ã€ã®ã¯ãšãªã§ã¯ãè€æ°ã®ããŒãã«ããããŒã¿ãçµåïŒJOINïŒããŠååŸããŸããã»ãšãã©ã®å Žåãåãåã䜿çšããŠçµåããããŒãã«éã®é¢ä¿ã決å®ããŸãã
æ£èŠåã¯ãããŒã¿ã®æ¥ç¶æ§ãšåé·æ§ã®æ¬ åŠãæäŸããããŒã¿ã¢ãã«ãæ§é
åããããã»ã¹ã§ãã
ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ãžã®ã¢ã¯ã»ã¹ã¯ã
ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ç®¡çã·ã¹ãã ïŒRDBMSïŒãä»ããŠè¡ãã
ãŸã ã ç§ãã¡ã䜿çšããã»ãšãã©ãã¹ãŠã®ããŒã¿ããŒã¹ã·ã¹ãã ã¯ãOracleãSQL ServerãMySQLãSybaseãDB2ãTeraDataãªã©ã®ãªã¬ãŒã·ã§ãã«ã·ã¹ãã ã§ãã
ãã®åªäœæ§ã®çç±ã¯æããã§ã¯ãããŸããã ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã®ååšãéããŠãããŒã¿ç®¡çã®åéã§ã·ã³ãã«ããå®å®æ§ãæè»æ§ãããã©ãŒãã³ã¹ãæ¡åŒµæ§ãäºææ§ã®æè¯ã®çµã¿åãããåžžã«æäŸããŠããŸããã
ãã ãããããã®æ©èœããã¹ãŠæäŸããããã«ããªã¬ãŒã·ã§ãã«ã¹ãã¢ã¯å
éšã§éåžžã«è€éã§ãã ããšãã°ãåçŽãªSELECTã¯ãšãªã«ã¯ãã¯ãšãªã®å®è¡äžã«ãªããã£ãã€ã¶ãçŽæ¥è©äŸ¡ããæœåšçãªå®è¡ãã¹ãäœçŸãããå ŽåããããŸãã ãããã¯ãã¹ãŠãŠãŒã¶ãŒããé ãããŠããŸãããRDBMSå
ã§ã¯ãã³ã¹ãèšç®ã¢ã«ãŽãªãºã ãªã©ã«åºã¥ããŠå®è¡èšç»ãäœæãããããèŠæ±ã«æãé©åããŸãã
ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã®åé¡
ãªã¬ãŒã·ã§ãã«ã¹ãã¬ãŒãžã¯ãã·ã³ãã«ããå®å®æ§ãæè»æ§ãããã©ãŒãã³ã¹ãã¹ã±ãŒã©ããªãã£ãäºææ§ã®æé©ãªçµã¿åãããæäŸããŸããããããã®åã¢ã€ãã ã®ããã©ãŒãã³ã¹ã¯ãç¹å®ã®æ©èœã«çŠç¹ãåœãŠãåæ§ã®ã·ã¹ãã ã®ããã©ãŒãã³ã¹ãããå¿
ãããé«ããšã¯éããŸããã ãªã¬ãŒã·ã§ãã«DBMSã®å
šäœçãªåªäœæ§ãæ¬ é¥ãäžåã£ãŠãããããããã¯å€§ããªåé¡ã§ã¯ãããŸããã§ããã ãã ããåŸæ¥ã®RDBãããŒãºãæºãããŠããªãå Žåã代æ¿æ段ãåžžã«ååšããŠããŸããã
ä»æ¥ãç¶æ³ã¯å°ãç°ãªããŸãã ããŸããŸãªã¢ããªã±ãŒã·ã§ã³ãæé·ããŠãããããã«äŒŽãããããã®æ©èœã®éèŠæ§ãé«ãŸã£ãŠããŸãã ããŒã¿ããŒã¹ã®æ°ãå¢ãããšã1ã€ã®æ©èœãä»ã®ãã¹ãŠã®æ©èœãèŠãé ãå§ããŸãã ãããã¹ã±ãŒã©ããªãã£ã§ãã WebãµãŒãã¹ãªã©ã®é«è² è·æ¡ä»¶äžã§åäœããã¢ããªã±ãŒã·ã§ã³ãå¢ããã«ã€ããŠãã¹ã±ãŒã©ããªãã£èŠä»¶ã¯æ¥éã«å€åããæ¥éã«æ¡å€§ããå¯èœæ§ããããŸãã ç¬èªã®ãµãŒããŒã«ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ãããå Žåãæåã®åé¡ã解決ããã®ã¯éåžžã«å°é£ã§ãã ãµãŒããŒã®è² è·ãäžæ©ã§3åã«ãªã£ããšããŸãã ããŒããŠã§ã¢ãã©ããããéãã¢ããã°ã¬ãŒãã§ããŸããïŒ 2çªç®ã®åé¡ã®è§£æ±ºçã¯ããªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã䜿çšããå Žåã«ãåé¡ãåŒãèµ·ãããŸãã
ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã¯ãåäžã®ãµãŒããŒäžã«ããå Žåã«ã®ã¿é©åã«æ¡åŒµãããŸãã ãã®ãµãŒããŒã®ãªãœãŒã¹ãäžè¶³ããå Žåãããã«ãã·ã³ãè¿œå ãããããã®éã§è² è·ãåæ£ããå¿
èŠããããŸãã ãããŠãããã§ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã®è€éããã¹ã±ãŒã©ããªãã£ã«åãå§ããŸãã ãµãŒããŒã®æ°ãæ°å°ã§ã¯ãªããæ°çŸå°ãŸãã¯æ°åå°ã«å¢ãããšãè€éããäžæ¡å€§ãããªãããªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ãé
åçãªãã®ã«ããç¹æ§ãæ¥éã«äœäžãã倧èŠæš¡ãªåæ£ã·ã¹ãã ã®ãã©ãããã©ãŒã ãšããŠäœ¿çšãããå¯èœæ§ããªããªããŸãã
競äºåãç¶æããããã«ãã¯ã©ãŠããµãŒãã¹ãã³ããŒã¯ãã®å¶éã«äœããã®æ¹æ³ã§å¯ŸåŠããå¿
èŠããããŸããããã¯ãã¹ã±ãŒã©ãã«ãªããŒã¿ã¹ãã¬ãŒãžãæããªãã¯ã©ãŠããã©ãããã©ãŒã ã®çš®é¡ã ããã§ãã ãããã£ãŠãããŒã¿ãæ ŒçŽããã¹ã±ãŒã©ãã«ãªå ŽæããŠãŒã¶ãŒã«æäŸããå Žåããã³ããŒã«ã¯1ã€ã®ãªãã·ã§ã³ãããããŸããã ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã§å©çšå¯èœãªä»ã®æ©èœãç ç²ã«ããŠã¯ããŸãããã¹ã±ãŒã©ããªãã£ã®é«ãä»ã®çš®é¡ã®ããŒã¿ããŒã¹ã䜿çšããå¿
èŠããããŸãã
ãããã®å©ç¹ã¯ããããã«å¯Ÿããæ¢åã®éèŠãšãšãã«ãæ°ããããŒã¿ããŒã¹ç®¡çã·ã¹ãã ã®æ³¢ããããããŸããã
ãã¥ãŒãŠã§ãŒã
ãã®ã¿ã€ãã®ããŒã¿ããŒã¹ã¯ãäžè¬ã«ããŒå€ã¹ãã¢ãšåŒã°ããŸãã å®éãæ£åŒãªååã¯ãªãã®ã§ãããã¥ã¡ã³ãæåãå±æ§æåã
åæ£ããŒã¿ããŒã¹ ïŒãªã¬ãŒã·ã§ãã«ã§ãå¯èœïŒãã·ã£ãŒããœãŒãé
åã
åæ£ããã·ã¥ããŒãã« ãã¹ãã¬ãŒãžã®ã³ã³ããã¹ãã§èŠã€ããããšãã§ããŸããããŒå€ã¿ã€ãã ãŸãããããã®ååã¯ããããã·ã¹ãã ã®ç¹å®ã®æ©èœã瀺ããŠããŸããããããã¯ãã¹ãŠããŒããªã¥ãŒã¹ãã¬ãŒãžãšåŒã°ãããããã¯ã®ããªãšãŒã·ã§ã³ã§ãã
ããããããªãããããäœãšåŒãã§ãããã®ãæ°ãããã¿ã€ãã®ããŒã¿ããŒã¹ã¯ããã»ã©æ°ãããã®ã§ã¯ãªããäž»ã«ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã®äœ¿çšãäžé©åãªã¢ããªã±ãŒã·ã§ã³ã«äž»ã«äœ¿çšãããŠããŸããã ãã ããã¹ã±ãŒã©ããªãã£ã®ããã«Webãšã¯ã©ãŠããå¿
èŠãšããã«ããããã®ã·ã¹ãã ã¯ããŸãéèŠããããŸããã§ããã ããã§ã®ã¿ã¹ã¯ã¯ãç¹å®ã®ã·ã¹ãã ã«é©ããã¹ãã¬ãŒãžã®ã¿ã€ãã決å®ããããšã§ãã
ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ãšããŒããªã¥ãŒã¹ãã¬ãŒãžã¯æ ¹æ¬çã«ç°ãªããããŸããŸãªåé¡ã解決ããããã«èšèšãããŠããŸãã ç¹æ§ã®æ¯èŒã§ã¯ãç¹æ§ã®éããç解ããããšããã§ããŸããããããããå§ããŸãããã
ã¹ãã¬ãŒãžæ©èœ
ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ | ããŒããªã¥ãŒã¹ãã¬ãŒãž |
---|
ããŒã¿ããŒã¹ã¯ããŒãã«ã§æ§æãããããŒãã«ã«ã¯åãšè¡ãå«ãŸããè¡ã¯åã®å€ã§æ§æãããŸãã 1ã€ã®ããŒãã«ã®ãã¹ãŠã®è¡ã«ã¯ãåäžã®æ§é ããããŸãã
| ãã¡ã€ã³ã®å ŽåãããŒãã«ãšã®é¡äŒŒæ§ãåŒãåºãããšãã§ããŸããããã¡ã€ã³ã®ããŒãã«ãšã¯ç°ãªããããŒã¿æ§é ã¯å®çŸ©ãããŠããŸããã ãã¡ã€ã³ãšã¯ã奜ããªãã®ãå
¥ããããšãã§ããããã¯ã¹ã§ãã åããã¡ã€ã³å
ã®ãšã³ããªã¯ãç°ãªãæ§é ãæã€ããšãã§ããŸãã
|
ããŒã¿ã¢ãã«1ã¯äºåå®çŸ©ãããŠããŸãã 匷ãåä»ããããããŒã¿ã®æŽåæ§ã確ä¿ããããã®å¶éãšé¢ä¿ãå«ãŸããŠããŸãã
| ã¬ã³ãŒãã¯ããŒã§èå¥ãããåã¬ã³ãŒãã«ã¯ããã«é¢é£ä»ããããåçãªå±æ§ã»ããããããŸãã
|
ããŒã¿ã¢ãã«ã¯ãã¢ããªã±ãŒã·ã§ã³ã®æ©èœã§ã¯ãªããå«ãŸããããŒã¿ã®èªç¶ãªè¡šçŸã«åºã¥ããŠããŸãã
| äžéšã®å®è£
ã§ã¯ãå±æ§ã¯æååã®ã¿ã§ãã ä»ã®å®è£
ã§ã¯ãå±æ§ã«ã¯ãããã°ã©ãã³ã°ã§äœ¿çšãããåïŒæŽæ°ãæååã®é
åããªã¹ãïŒãåæ ããåçŽãªããŒã¿åããããŸãã
|
ããŒã¿ã¢ãã«ã¯ãããŒã¿ã®éè€ãé¿ããããã«æ£èŠåãããŸãã æ£èŠåã«ãããããŒãã«éã®é¢ä¿ãçãŸããŸãã ãªã¬ãŒã·ã§ã³ã¯ãç°ãªãããŒãã«ã®ããŒã¿ãé¢é£ä»ããŸãã
| ãã¡ã€ã³éããã³åããã¡ã€ã³å
ã§ã¯ãé¢ä¿ã¯æ確ã«å®çŸ©ãããŠããŸããã
|
åå ããªã
ããŒããªã¥ãŒã¹ãã¬ãŒãžã¯ã¬ã³ãŒãæåã§ãã ããã¯ããã®ã¬ã³ãŒãã«é¢é£ãããã¹ãŠã®æ
å ±ãäžç·ã«ä¿åãããããšãæå³ããŸãã ãã¡ã€ã³ïŒããŒãã«ãšèããããšãã§ããŸãïŒã«ã¯ãç¡æ°ã®ç°ãªãã¬ã³ãŒããå«ããããšãã§ããŸãã ããšãã°ããã¡ã€ã³ã«ã¯é¡§å®¢ãšæ³šæã«é¢ããæ
å ±ãå«ãŸããå ŽåããããŸãã ã€ãŸããããŒã¿ã¯éåžžãç°ãªããã¡ã€ã³éã§è€è£œãããŸãã ãã£ã¹ã¯å®¹éãå®ããããããã¯åãå
¥ããããã¢ãããŒãã§ãã äž»ãªããšã¯ãé¢é£ãããã¹ãŠã®ããŒã¿ã1ãæã«ä¿åã§ããããšã§ããããã«ãããç°ãªãããŒãã«ã®ããŒã¿ãçµåããå¿
èŠããªããªããããã¹ã±ãŒã©ããªãã£ãåäžããŸãã ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã䜿çšããå Žåãæ¥ç¶ã䜿çšããŠå¿
èŠãªæ
å ±ã1ãæã«ã°ã«ãŒãåããå¿
èŠããããŸãã
ããŒãšå€ã®ãã¢ãä¿åããããã®é¢ä¿ã®å¿
èŠæ§ã¯åçã«äœäžããŸãããé¢ä¿ã¯äŸç¶ãšããŠå¿
èŠã§ãã ãã®ãããªé¢ä¿ã¯éåžžãã³ã¢ãšã³ãã£ãã£éã«ååšããŸãã ããšãã°ã泚æã·ã¹ãã ã«ã¯ã顧客ã補åã泚æã«é¢ããããŒã¿ãå«ãã¬ã³ãŒãããããŸãã ãã®ããŒã¿ãåããã¡ã€ã³ã«ããããè€æ°ã®ãã¡ã€ã³ã«ãããã¯é¢ä¿ãããŸããã äžçªäžã®è¡ã¯ãè²·ãæã泚æãããšãã«ãã»ãšãã©ã®å Žåãè²·ãæãšæ³šæã«é¢ããæ
å ±ã1ã€ã®ã¬ã³ãŒãã«ä¿åããããªããšããããšã§ãã
代ããã«ã泚æå
¥åã«ã¯ã察å¿ãã顧客ããã³è£œåã¬ã³ãŒããæãããŒãå«ãŸããŠããå¿
èŠããããŸãã æ
å ±ã¯ã¬ã³ãŒãã«æ ŒçŽã§ããããŒã¿ã¢ãã«èªäœã«ã¯é¢ä¿ãå®çŸ©ãããŠããªããããããŒã¿ããŒã¹ç®¡çã·ã¹ãã ã¯é¢ä¿ã®æŽåæ§ãå¶åŸ¡ã§ããŸããã ããã¯ã顧客ãšæ³šæãã補åãåé€ã§ããããšãæå³ããŸãã ããŒã¿ã®æŽåæ§ã®ç¢ºä¿ã¯ãã¢ããªã±ãŒã·ã§ã³ã«å®å
šã«ããã£ãŠããŸãã
ããŒã¿ã¢ã¯ã»ã¹
ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ | ããŒããªã¥ãŒã¹ãã¬ãŒãž |
---|
ããŒã¿ã¯ãæ§é åç
§äŒèšèªïŒSQLïŒã䜿çšããŠäœæãæŽæ°ãåé€ãããã³ç
§äŒãããŸãã
| APIã¡ãœããåŒã³åºãã䜿çšããŠãããŒã¿ãäœæãæŽæ°ãåé€ãããã³ç
§äŒãããŸãã
|
SQLã¯ãšãªã¯ãæ¥ç¶ïŒçµåïŒã䜿çšããŠãåäžã®ããŒãã«ãŸãã¯è€æ°ã®ããŒãã«ã®äž¡æ¹ããããŒã¿ãååŸã§ããŸãã
| äžéšã®å®è£
ã¯ããã£ã«ã¿ãŒæ¡ä»¶ãèšå®ããããã®SQLã®ãããªæ§æãæäŸããŸãã
|
SQLã¯ãšãªã«ã¯ãéèšãšè€éãªãã£ã«ã¿ãŒãå«ããããšãã§ããŸãã
| å€ãã®å Žåãåºæ¬çãªæ¯èŒæŒç®åïŒ= ã! =ã<ã>ã<= And =>ïŒã®ã¿ã䜿çšã§ããŸãã
|
éåžžããªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã«ã¯ãããªã¬ãŒãã¹ãã¢ãããã·ãŒãžã£ãé¢æ°ãªã©ã®åã蟌ã¿ããžãã¯ãå«ãŸããŠããŸãã
| ãã¹ãŠã®ããžãã¹ããžãã¯ãšããŒã¿ã®æŽåæ§ããµããŒãããããžãã¯ã¯ãã¢ããªã±ãŒã·ã§ã³ã³ãŒãã«å«ãŸããŠããŸãã
|
ã¢ããªã±ãŒã·ã§ã³ã®çžäºäœçš
ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ | ããŒããªã¥ãŒã¹ãã¬ãŒãž |
---|
ã»ãšãã©ã®å ŽåãOLE DBãODBCãªã©ã®ãã€ãã£ãAPIã䜿çšãŸãã¯äžè¬åãããŠããŸãã
| ã»ãšãã©ã®å ŽåãããŒã¿ãžã®ã¢ã¯ã»ã¹ã«ã¯SOAPããã³/ãŸãã¯REST APIã䜿çšãããŸãã
|
ããŒã¿ã¯èªç¶ãªæ§é ã衚瀺ãã圢åŒã§ä¿åããããããã¢ããªã±ãŒã·ã§ã³æ§é ãšãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹æ§é ã®ãããã³ã°ãå¿
èŠã§ãã
| ã¢ããªã±ãŒã·ã§ã³ã®æ§é å
ã§ããŒã¿ãããå¹ççã«è¡šç€ºã§ããŸãããªããžã§ã¯ãã«ããŒã¿ãæžã蟌ãããã«å¿
èŠãªã®ã¯ã³ãŒãã®ã¿ã§ãã
|
Key-Valueã¹ãã¬ãŒãžïŒå©ç¹
ãã®ãããªã·ã¹ãã ã«ã¯ããªã¬ãŒã·ã§ãã«ã¹ãã¬ãŒãžã«æ¯ã¹ãŠ2ã€ã®æ確ãªå©ç¹ããããŸãã
ã¯ã©ãŠããµãŒãã¹ã«é©ããŠããŸã
ããŒãšå€ã®ã¹ãã¬ãŒãžã®æåã®å©ç¹ã¯ãã·ã³ãã«ãªããšã§ããã€ãŸãããªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ãããæ¡åŒµæ§ãé«ãããšã§ãã ç¬èªã®ã·ã¹ãã ãäžç·ã«ãã¹ãããããŒã¿ãŠã§ã¢ããŠã¹ã®èåŸã§ãå¢å ããè² è·ã«å¯ŸåŠããå¿
èŠã®ããæ°åãŸãã¯100å°ã®ãµãŒããŒããã¹ãããèšç»ãããå ŽåãããŒããªã¥ãŒã¹ãã¬ãŒãžãéžæãããŸãã
ãã®ãããªã¹ãã¬ãŒãžã¯ç°¡åãã€åçã«æ¡åŒµãããããããã«ããŠãŒã¶ãŒWebã¹ãã¬ãŒãžãã©ãããã©ãŒã ãæäŸãããã³ããŒã«ã圹ç«ã¡ãŸãã ãã®ãããªããŒã¿ããŒã¹ã¯ãããŒã¿ã¹ãã¬ãŒãžã®æ¯èŒçå®äŸ¡ãªæ段ã§ãããã¹ã±ãŒã©ããªãã£ã®å€§ããªå¯èœæ§ããããŸãã ãŠãŒã¶ãŒã¯éåžžã䜿çšããåã ãæéãæ¯æããŸãããããŒãºã¯å¢å€§ããå¯èœæ§ããããŸãã ãã³ããŒã¯ãè² è·ã«åºã¥ããŠããã©ãããã©ãŒã ã®ãµã€ãºãå¶éãªãåçãã€å®éçã«å¢ããããšãã§ããŸãã
ããèªç¶ãªã³ãŒãçµ±å
ãªã¬ãŒã·ã§ãã«ããŒã¿ã¢ãã«ãšã³ãŒããªããžã§ã¯ãã¢ãã«ã¯ãéåžžãããŸããŸãªæ¹æ³ã§æ§ç¯ãããŸããããã«ãããéäºææ§ãçããŸãã éçºè
ã¯ããªã¬ãŒã·ã§ãã«ã¢ãã«ããªããžã§ã¯ãã¢ãã«ã«
ãããã³ã°ããã³ãŒããèšè¿°ããããšã«ããããã®åé¡ã解決ããŸãã ãã®ããã»ã¹ã«ã¯æ確ã§è¿
éã«éæã§ãã䟡å€ã¯ãªããã¢ããªã±ãŒã·ã§ã³èªäœã®éçºã«è²»ããããšãã§ããããªãã®æéããããå¯èœæ§ããããŸãã äžæ¹ãå€ãã®ããŒããªã¥ãŒã¹ãã¢ã¯ãããèªç¶ã«ãªããžã§ã¯ãã«ãããã³ã°ãããæ§é ã§ããŒã¿ãä¿åããŸãã ããã«ãããéçºæéã倧å¹
ã«ççž®ã§ããŸãã
ããªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ãäžåšçšã«ãªãå¯èœæ§ãããããªã©ã®ãããŒãšå€ã®ã¹ãã¬ãŒãžã䜿çšããããšãæ¯æããä»ã®è°è«ïŒããã¯ã©ãããæå³ãããããŸããïŒã¯ããŸã説åŸåããããŸããã ãããããã®ãããªãªããžããªã®ææ¡è
ã«ãªãåã«ã次ã®ã»ã¯ã·ã§ã³ããã§ãã¯ããŠãã ããã
Key-Valueã¹ãã¬ãŒãžïŒæ¬ ç¹
ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã®å¶çŽã¯ãæäœã¬ãã«ã§ã®ããŒã¿ã®æŽåæ§ãä¿èšŒããŸãã ç©ççã«å¶éãæºãããªãããŒã¿ã¯ãããŒã¿ããŒã¹ã«ã¢ã¯ã»ã¹ã§ããŸããã ããŒãšå€ã®ã¹ãã¬ãŒãžã«ã¯ãã®ãããªå¶éã¯ãªããããããŒã¿æŽåæ§ã®å¶åŸ¡ã¯å®å
šã«ã¢ããªã±ãŒã·ã§ã³ã«ãããŸãã ãã ããã³ãŒãã«ã¯ãšã©ãŒããããŸãã éåžžãæ£ããèšèšããããªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã®ãšã©ãŒãããŒã¿ã®æŽåæ§ã®åé¡ã«ã€ãªãããªãå ŽåãããŒå€ã¹ãã¢ã®ãšã©ãŒã¯éåžžãã®ãããªåé¡ã«ã€ãªãããŸãã
ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã®ãã1ã€ã®å©ç¹ã¯ãããŒã¿ã¢ãã«ã®éçºããã»ã¹ã匷å¶çã«å®è¡ããããšã§ãã ã¢ãã«ãé©åã«èšèšããå ŽåãããŒã¿ããŒã¹ã«ã¯ãæ ŒçŽãããããŒã¿ã®æ§é ãå®å
šã«åæ ããããã¢ããªã±ãŒã·ã§ã³ã®æ§é ãšã¯ç°ãªãè«çæ§é ãå«ãŸããŸãã ãããã£ãŠãããŒã¿ã¯ã¢ããªã±ãŒã·ã§ã³ã«äŸåããªããªããŸãã ããã¯ãå¥ã®ã¢ããªã±ãŒã·ã§ã³ãåãããŒã¿ã䜿çšã§ããããŒã¹ã¢ãã«ãå€æŽããã«ã¢ããªã±ãŒã·ã§ã³ããžãã¯ãå€æŽã§ããããšãæå³ããŸãã ããŒãšå€ã®ã¹ãã¬ãŒãžã§åãããšãè¡ãã«ã¯ããªã¬ãŒã·ã§ãã«ã¢ãã«ãèšèšããããã»ã¹ããèªç¶ãªããŒã¿æ§é ã«åºã¥ããŠå
±éã®ã¯ã©ã¹ãäœæããã¯ã©ã¹èšèšã«çœ®ãæããŠã¿ãŠãã ããã
äºææ§ã«ã€ããŠãå¿ããªãã§ãã ããã ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ãšã¯ç°ãªããã¯ã©ãŠãäžå¿ã®ã¹ãã¬ãŒãžã«ã¯äžè¬çãªæšæºãã¯ããã«å°ãªãã æŠå¿µçã«ã¯éãã¯ãããŸãããããããã¯ãã¹ãŠç°ãªãAPIãã¯ãšãªã€ã³ã¿ãŒãã§ã€ã¹ãããã³ç¬èªã®ä»æ§ãæã£ãŠããŸãã ãããã£ãŠããã³ããŒãä¿¡é Œããæ¹ãé©åã§ãããã®å Žåãå¥ã®ãµãŒãã¹ãããã€ããŒã«ç°¡åã«åãæ¿ããããšãã§ããªãããã§ãã ãããŠãã»ãšãã©ãã¹ãŠã®ææ°ã®ããŒããªã¥ãŒã¹ãã¢ãããŒã¿
2ã«ãããšããäºå®ãèãããšãä¿¡é Œã¯ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã䜿çšããå Žåãããããã«å±éºã«ãªããŸãã
éå®çãªããŒã¿åæ
éåžžããã¹ãŠã®ã¯ã©ãŠãã¹ãã¬ãŒãžã¯ã
è€æ°ã®ãªãŒã¹ã®ã¿ã€ãã«åºã¥ããŠæ§ç¯ãããŸããã€ãŸããåãã·ã¹ãã ãå€æ°ã®ãŠãŒã¶ãŒãšã¢ããªã±ãŒã·ã§ã³ã«ãã£ãŠäœ¿çšãããŸãã ã·ã¹ãã å
šäœã®ããã£ããã£ããé²ãããã«ããã³ããŒã¯éåžžããªã¯ãšã¹ãã®å®è¡ãäœããã®åœ¢ã§å¶éããŸãã ããšãã°ãSimpleDBã§ã¯ãã¯ãšãªã5ç§ããé·ãå®è¡ããããšã¯ã§ããŸããã Google AppEngine Datastoreã§ã¯ã1åã®ãªã¯ãšã¹ãã§1000件ãè¶
ããã¬ã³ãŒããååŸããããšã¯ã§ããŸãã
3 ã
ãããã®å¶éã¯ãåçŽãªããžãã¯ïŒå°æ°ã®ã¬ã³ãŒãã®äœæãæŽæ°ãåé€ãããã³ååŸïŒã«ãšã£ãŠæããã®ã§ã¯ãããŸããã ããããã¢ããªã±ãŒã·ã§ã³ã人æ°ã«ãªã£ããã©ãã§ããããïŒ ããããã®æ°ãããŠãŒã¶ãŒãšããããã®æ°ããããŒã¿ãæã«å
¥ããã®ã§ãä»åºŠã¯ãŠãŒã¶ãŒã«æ°ããæ©äŒãæäŸããããäœããã®åœ¢ã§ããŒã¿ã掻çšããããšèããŠããŸãã ããã§ã¯ãããŒã¿åæã®ããã®åçŽãªã¯ãšãªã§ãããåå²ããã®ãé£ããå ŽåããããŸãã ã¢ããªã±ãŒã·ã§ã³ã®äœ¿çšãã¿ãŒã³ã®è¿œè·¡ãããŠãŒã¶ãŒã®å±¥æŽã«åºã¥ããæšå¥šã·ã¹ãã ãªã©ã®æ©èœã¯ãå®è£
ãå°é£ãªå ŽåããããŸãã ãããŠææªã®å Žåããããã¯åã«äžå¯èœã§ãã
ãã®å Žåãåæã®ããã«ãããŒãšå€ã®ã¹ãã¬ãŒãžããã®ããŒã¿ãå
¥åãããå¥ã®ããŒã¿ããŒã¹ãäœæããããšããå§ãããŸãã ãããã©ã®ããã«è¡ãããšãã§ããããäºåã«èããŠãã ããã ãµãŒããŒãã¯ã©ãŠããŸãã¯èªå®
ã§ãã¹ãããŸããïŒ ããªããšããªãã®ãããã€ããŒãšã®éã®ä¿¡å·é
延ã«ããåé¡ã¯ãããŸããïŒ ã¹ãã¬ãŒãžã¯ãã®ãããªããŒã¿è»¢éããµããŒãããŠããŸããïŒ 1å件ã®ã¬ã³ãŒãããããäžåºŠã«1,000件ã®ã¬ã³ãŒããååŸã§ããå Žåããã¹ãŠã®ããŒã¿ã転éããã«ã¯ã©ããããããããŸããïŒ
ãã ããã¹ã±ãŒã©ããªãã£ãåªå
ããªãã§ãã ããã ãŠãŒã¶ãŒãå¥ã®ãµãŒãã¹ã®ãµãŒãã¹ã䜿çšããããšã«æ±ºããå Žåã¯ãããå€ãã®ãªãã·ã§ã³ãšèšå®ãæäŸãããããã圹ã«ç«ã¡ãŸããã
ã¯ã©ãŠãã¹ãã¬ãŒãž
å€ãã®WebãµãŒãã¹ãããã€ããŒã¯ããã«ãããã³ãã®ããŒãšå€ã®ã¹ãã¬ãŒãžãæäŸããŠããŸãã ãããã®ã»ãšãã©ã¯äžèšã®åºæºãæºãããŠããŸãããããããã«ç¬èªã®ç¹åŸŽããããäžèšã®æšæºãšã¯ç°ãªããŸãã SimpleDBãGoogle AppEngine DatastoreãSQL Data Servicesãªã©ã®ç¹å®ã®ãµã³ãã«ãªããžããªãèŠãŠã¿ãŸãããã
AmazonïŒSimpleDB
SimpleDBã¯ãAmazon WebServicesã®äžéšã§ããå±æ§ããŒã¹ã®ããŒãšå€ã®ã¹ãã¬ãŒãžã§ãã SimpleDBã¯ããŒã¿çã§ãã ãŠãŒã¶ãŒã¯ãããŒãºãç¹å®ã®å¶éãè¶
ããªãéããç¡æã§äœ¿çšã§ããŸãã
SimpleDBã«ã¯ããã€ãã®å¶éããããŸãã ãŸããã¯ãšãªã®å®è¡æéã¯5ç§ã«å¶éãããŠããŸãã 第äºã«ãæåå以å€ã®ããŒã¿åã¯ãããŸããã ãã¹ãŠãæååãšããŠä¿åãååŸãæ¯èŒããããããæ¥ä»ãæ¯èŒããã«ã¯ãããããISO8601圢åŒã«å€æããå¿
èŠããããŸãã 3çªç®ã«ãè¡ã®æ倧ãµã€ãºã¯1024ãã€ãã§ããããã«ãããå±æ§ãšããŠä¿åã§ããããã¹ãã®ãµã€ãºïŒè£œåã®èª¬æãªã©ïŒãå¶éãããŸãã ãã ããããŒã¿æ§é ã¯æè»ã§ãããããå±æ§ãProduct Description1ãããProduct Description2ããªã©ãè¿œå ããããšã«ããããã®å¶éãåé¿ã§ããŸãã ãã ããå±æ§ã®æ°ãå¶éãããŠããŸã-æ倧256åã®å±æ§ã SimpleDBã¯ããŒã¿çã§ããããã¡ã€ã³ãµã€ãºã¯10ã®ã¬ãã€ãã«å¶éãããŠãããããŒã¿ããŒã¹å
šäœã1ãã©ãã€ããè¶
ããããšã¯ã§ããŸããã
SimpleDBã®éèŠãªæ©èœã®1ã€ã¯ã
çµææŽåæ§ã¢ãã«ã®äœ¿çšã§ãã ãã®ã¢ãã«ã¯ãã«ãã¹ã¬ããäœæ¥ã«é©ããŠããŸãããäžéšã®ã¬ã³ãŒãã®å±æ§å€ãå€æŽããåŸããããã®å€æŽã¯åŸç¶ã®èªã¿åãæäœã§è¡šç€ºãããªãå¯èœæ§ãããããšã«æ³šæããŠãã ããã ãã®ãããªã€ãã³ãã®çºçã®å¯èœæ§ã¯éåžžã«äœãã§ãããèŠããŠããå¿
èŠããããŸãã 販売æã«ããŒã¿ã«äžè²«æ§ããªãã£ããšããçç±ã ãã§ãæåŸã®ãã±ããã5人ã®é¡§å®¢ã«è²©å£²ããããããŸããã
Google AppEngineããŒã¿ã¹ãã¢
Googleã®AppEngine Datastore㯠ã
Googleã®å
éšæ§é åããŒã¿ã¹ãã¬ãŒãžã·ã¹ãã ã§ããBigTableã®äžã«æ§ç¯ãããŠããŸãã AppEngine Datastoreã¯BigTableãžã®çŽæ¥ã¢ã¯ã»ã¹ãæäŸããŸããããBigTableãšããåãããããã®åçŽåãããã€ã³ã¿ãŒãã§ã€ã¹ãšããŠèªèã§ããŸãã
AppEngine Datastoreã¯ãåäžã¬ã³ãŒãå
ã§SimpleDBãããå€ãã®ããŒã¿åããµããŒãããŠããŸãã ããšãã°ãã¬ã³ãŒãå
ã«ã³ã¬ã¯ã·ã§ã³ãå«ããªã¹ãã
ã»ãšãã©ã®å ŽåãGoogle AppEngineã䜿çšããŠéçºãããšãã«ããã®ç¹å®ã®ããŒã¿ãŠã§ã¢ããŠã¹ã䜿çšããŸãã ãã ããSimpleDBãšã¯ç°ãªããGoogleã®ãŠã§ããµãŒãã¹ä»¥å€ã§ã¯AppEngine DatastoreïŒãŸãã¯BigTableïŒã䜿çšã§ããŸããã
MicrosoftïŒSQL Data Services
SQL Data Servicesã¯ãMicrosoft
Azureãã©ãããã©ãŒã ã®äžéšã§ãã SQL Data Servicesã¯ç¡æã§ããŒã¿çã§ãããããŒã¿ããŒã¹ãµã€ãºã®å¶éããããŸãã SQL Data Servicesã¯ç¬ç«ããã¢ããªã±ãŒã·ã§ã³ã§ããããŒã¿ãä¿åããå€ãã®SQLãµãŒããŒã®ã¢ããªã³ã§ãã ãããã®ã¹ãã¬ãŒãžã¯ãªã¬ãŒã·ã§ãã«ã«ããããšãã§ããŸãããSDSã¯ããŒããªã¥ãŒã¹ãã¬ãŒãžã§ãããäžèšã®è£œåã§ããããŸãã
ã¯ã©ãŠãã¹ãã¬ãŒãž
ãŸããã¯ã©ãŠãã®å€éšã§ç¬èªã«ã€ã³ã¹ããŒã«ããããšã§äœ¿çšã§ããã¹ãã¬ãŒãžãå€æ°ãããŸãã ãããã®ãããžã§ã¯ãã®ã»ãšãã©ãã¹ãŠã¯è¥ããã¢ã«ãã¡çãŸãã¯ããŒã¿çã§ããããªãŒãã³ãœãŒã¹ã§ãã ãªãŒãã³ãœãŒã¹ã䜿çšãããšãããããã¯ããŒãºã補åãããæœåšçãªåé¡ãå¶éãããããç解ããã§ãããã
Couchdb
CouchDBã¯ãç¡æã®ãªãŒãã³ãœãŒã¹ã®ããã¥ã¡ã³ãæåããŒã¿ããŒã¹ã§ãã ããŒã¿ã¹ãã¬ãŒãžåœ¢åŒãšããŠãJSONã䜿çšãããŸãã CouchDBã¯ãããã¥ãŒãã䜿çšããŠããã¥ã¡ã³ãæåããŒã¿ããŒã¹ãšãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã®ã®ã£ãããåããããã«èšèšãããŠããŸãã ãã®ãããªãã¥ãŒã«ã¯ãè¡šã®ãããªåœ¢åŒã®ããã¥ã¡ã³ãã®ããŒã¿ãå«ãŸããŠãããã€ã³ããã¯ã¹ãäœæããŠã¯ãšãªãå®è¡ã§ããŸãã
CouchDBã¯
çŸåš ãçã«åæ£ãããããŒã¿ããŒã¹ã§ã¯ãããŸããã ãµãŒããŒéã§ããŒã¿ãåæã§ããã¬ããªã±ãŒã·ã§ã³æ©èœããããŸãããããã¯éåžžã«ã¹ã±ãŒã©ãã«ãªç°å¢ãæ§ç¯ããããã«å¿
èŠãªãã®ãšåããã£ã¹ããªãã¥ãŒã·ã§ã³ã§ã¯ãããŸããã ãã ããCouchDBéçºè
ã¯ããã«åãçµãã§ããŸãã
ãŽã©ã«ãã¢ãŒããããžã§ã¯ã
Voldemortãããžã§ã¯ãã¯ãå€æ°ã®ãµãŒããŒã§ã®æ°Žå¹³ã¹ã±ãŒãªã³ã°çšã«èšèšãããåæ£Key-ValueããŒã¿ããŒã¹ã§ãã LinkedInã®éçºããã»ã¹ã§çãŸãããã®è£œåã¯ãé«ãã¹ã±ãŒã©ããªãã£ãèŠæ±ãããããã€ãã®ã·ã¹ãã ã§äœ¿çšãããŠããŸããã ãŽã©ã«ãã¢ãŒããããžã§ã¯ãã§ã¯ãæéäžè²«æ§ã¢ãã«ã䜿çšããŠããŸãã
ã¢ã³ãŽ
Mongoã¯ãGeir MagnussonãšDwight MerrimanïŒDoubleClickããç¥ãããšãã§ããïŒã«ãã£ãŠ10genã§éçºãããããŒã¿ããŒã¹ã§ãã CouchDBãšåæ§ã«ãMongoã¯ããŒã¿ãJSON圢åŒã§ä¿åããããã¥ã¡ã³ãæåã®ããŒã¿ããŒã¹ã§ãã ãã ããMongoã¯çŽç²ãªããŒå€ã¹ãã¬ãŒãžããããªããžã§ã¯ãããŒã¹ã§ããå¯èœæ§ãé«ããªããŸãã
ãã©ã€ãã³
Drizzleã¯ãKey-Valueã¹ãã¢ã察åŠããããã«èšèšãããåé¡ã解決ããããã®ãŸã£ããç°ãªãã¢ãããŒããæ瀺ããŸãã Drizzleã¯ãMySQL 6.0ãã©ã³ãã®1ã€ãšããŠå§ãŸããŸããã éçºè
ã¯åŸã§ãããã·ã³ãã«ã§é«éãªDBMSãäœæããç®çã§ãå€ãã®é¢æ°ïŒãã¥ãŒãããªã¬ãŒãã³ã³ãã€ã«åŒãã¹ãã¢ãããã·ãŒãžã£ãã¯ãšãªãã£ãã·ã¥ãACLãããã³äžéšã®ããŒã¿åãå«ãïŒãåé€ããŸããã ãã ããDrizzleã¯ãªã¬ãŒã·ã§ãã«ããŒã¿ã®ä¿åã«åŒãç¶ã䜿çšã§ããŸãã éçºè
ã®ç®æšã¯ã16以äžã®ã³ã¢ãæã€ã·ã¹ãã ã§å®è¡ãããWebã¢ããªã±ãŒã·ã§ã³ããã³ã¯ã©ãŠãã¢ããªã±ãŒã·ã§ã³åãã«èšèšãããæºãªã¬ãŒã·ã§ãã«ãã©ãããã©ãŒã ãæ§ç¯ããããšã§ãã
解決ç
æçµçã«ãã¢ããªã±ãŒã·ã§ã³ã«éãªã¬ãŒã·ã§ãã«ããŒããªã¥ãŒã¹ãã¬ãŒãžãéžæã§ããçç±ã¯4ã€ãããŸãã
- ããŒã¿ã¯ããã¥ã¡ã³ãæåæ§ãé«ãããªã¬ãŒã·ã§ãã«ã¢ãã«ãããããŒããªã¥ãŒããŒã¿ã¢ãã«ã«ããé©ããŠããŸãã
- ãã¡ã€ã³ã¢ãã«ã¯é«åºŠã«ãªããžã§ã¯ãæåã§ãããããããŒå€ã¹ãã¬ãŒãžã䜿çšãããšãããŒã¿å€æçšã®è¿œå ã³ãŒãã®ãµã€ãºãåæžãããŸãã
- ããŒã¿ãŠã§ã¢ããŠã¹ã¯ããã³ããŒã®WebãµãŒãã¹ãšå®äŸ¡ãã€ç°¡åã«çµ±åã§ããŸãã
- äž»ãªé¢å¿äºã¯ããªã³ããã³ãã§ã®é«ãã¹ã±ãŒã©ããªãã£ã§ãã
ãã ãã決å®ãè¡ãéã«ã¯ãç¹å®ã®ããŒã¿ããŒã¹ã®å¶éãšãéãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã䜿çšããããšãéžæããéã«ééãããªã¹ã¯ã«æ³šæããŠãã ããã
ä»ã®ãã¹ãŠã®èŠä»¶ã«ã€ããŠã¯ãå€ãè¯ããªã¬ãŒã·ã§ãã«DBMSãéžæããããšããå§ãããŸãã ããã§åœŒãã¯éåœã¥ããããŠããã®ã§ããããïŒ ãã¡ããéããŸãã å°ãªããšããŸã ã
1-ç§ã®æèŠã§ã¯ãããã§ã¯ãããŒã¿æ§é ããšããçšèªã®æ¹ãé©ããŠããŸãããå
ã®ããŒã¿ã¢ãã«ã¯ãã®ãŸãŸã§ãã
2-ãããããèè
ã¯ãéãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã®æ©èœããªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ãããå£ã£ãŠããããšã念é ã«çœ®ããŠããŸããã
3-ããŒã¿ã¯ãã§ã«å€ããªã£ãŠããå¯èœæ§ããããŸããèšäºã®æ¥ä»ã¯2009幎2æã§ãã