ã»ã«ã²ã€ã»ãã¥ã¬ã³ãã§ãïŒTextMasterïŒ
ç§ã®ååã¯Sergey Tulentsevã§ããæ°å¹ŽåããNoSQLããŒã¿ããŒã¹ã«èå³ããããä»æ¥ã¯ç§ã®ç¥èãšçµéšãçãããšå ±æããããšæããŸãã
ãã®ã¬ããŒãã®æ©æµãåããã®ã¯èª°ã§ããïŒ ããã¯ãæ§é åãããŠãããšäž»åŒµããã¬ãã¥ãŒã¬ããŒãã§ãã ã©ããã§NoSQLã«ã€ããŠèããããšãããã°ã40ååŸã«ã¯ããã«å€ãã®ããšãç¥ãããã«ãªããçšèªã§ããã²ãŒããããããªãããããžã§ã¯ãã®ããŒã¿ããŒã¹ãããèªä¿¡ãæã£ãŠéžæã§ããããã«ãªããŸãã
ãŸããäžè¬çãªã¢ããªã±ãŒã·ã§ã³ã®äŸãšãNoSQLããŒã¿ããŒã¹ã®äœ¿çšæ¹æ³ã«ã€ããŠã説æããŸãã
å°ãæŽå²ã
ãã®çšèªã¯1998幎ã«åããŠç»å ŽããŸãããCarloStrozziãšããååã®ç·ã圌ã®ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ãšåœåããŸããã ãã ããããèªäœãæäœããããã®SQLã€ã³ã¿ãŒãã§ãŒã¹ã¯æäŸããããXMLãã¡ã€ã«ããœãŒã»ãŒãžããbashã¹ã¯ãªããã®ã»ããã§ããã ãŠã£ãããã£ã¢ã«ãããšããã®ããŒã¿ããŒã¹ã®æåŸã®ãªãªãŒã¹ã¯2010幎ã«ãªãªãŒã¹ãããäœããã®åœ¢ã§æ£åžžã«æ©èœããŸããã 圌女ã®ããšã¯å ±åæžã®æºåã®éçšã§ããç¥ããŸããã§ãããã以å圌女ã®ããšãç¥ããªãã£ãã®ã¯è¯ãããšã ãšæããŸãã
2009幎ã«ããµã³ãã©ã³ã·ã¹ã³ã®ä»ã®ç·ãã¡ãæ°ããåæ£ããŒã¿ããŒã¹ã«ã€ããŠè°è«ããäŒè°ãéå¬ãããã€ãã¿ãŒçšã®ããã·ã¥ã¿ã°ãé·ãçãããã·ã¥ã¿ã°ãå¿ èŠã«ãªããŸããã 誰ããNoSQLããã·ã¥ã¿ã°ãæãã€ããŠãSQLãACIDãããã³ããããçš®é¡ã®ã¯ãŒã«ãªãã®ãããããŒã¿ããŒã¹ãããããšã匷調ããŸãããããããæããªãä»ã®ããŒã¿ããŒã¹ã«ã€ããŠèª¬æããŸãã 人ã ã¯ããã·ã¥ã¿ã°ã奜ãã§ãããããã¯å¶åŸ¡äžèœã«ãªã£ãŠããŸã ã€ã³ã¿ãŒãããããµãŒãã£ã³ããŸãã
NoSQLãšããçšèªã 2ã€ã®è§£éããããŸãã1ã€ã¯å€ããã®ããã1ã€ã¯æ°ãããã®ã§ãã å ã®ãã®ã¯NoSQLã§ããã€ãŸããäžè¬ã«ãSQLã¯ãããŸãããããã®ããŒã¿ããŒã¹ãæäœããããã®ä»ã®ã¡ã«ããºã ããããŸãã ãããŠãæ°ãã解éã¯ãSQLã ãã§ã¯ãããŸããã-ããã¯SQLã ãã§ã¯ãããŸããã ããããSQLã§ãããä»ã«ãäœãããããŸãã
ãã®ãããªãµã€ãhttp://nosql-database.orgããããŸã-ããã¯ç°ãªãNoSQLããŒã¿ããŒã¹ã®ãªã¹ãã§ãã 説æãã¿ã€ããå ¬åŒãããžã§ã¯ããžã®ãªã³ã¯ãç¥ã£ãŠãã䟡å€ã®ããç°¡åãªéèŠäºé ãå«ãŸããŠããŸãã èªç±ã«ç»ã£ãŠèªãããšãã§ããŸãããæã人æ°ã®ãããã®ã«ã€ããŠèª¬æããŸãã
ããŒã¿ããŒã¹ã®æãäžè¬çãªåé¡ã¯ãããŒã¿åã«ãããã®ã§ãã
éèŠãªã¿ã€ãã¯ãããŒ/å€ã¹ãã¢ããŸãã¯ããŒãšå€ã®ãã¢ã®ã¹ãã¬ãŒãžã§ãã
ããã¯æãããã¥ã©ãŒãªã¿ã€ãã§ãããåæã«æãåçŽã§ããããŸããæãåå§çãªã€ã³ã¿ãŒãã§ã€ã¹ãåããŠããŸãã ãããŠãçè«çã«ã¯ããã®ãããªããŒã¿ããŒã¹ã®æå°ã€ã³ã¿ãŒãã§ãŒã¹ã¯ãååŸãèšå®ãåé€ã®3ã€ã®æäœã®ã¿ã§æ§æãããŠããŸãã ãããããã®ã€ã³ã¿ãŒãã§ãŒã¹ãæºããããŒã¿ããŒã¹ãããã€ããããŸãããéåžžãçŸä»£ã®äžè¬çãªããŒã¿ããŒã¹ã¯ããå€ãã®å©ç¹ãæäŸããŸããããšãã°ãäžåºŠã«å€ãã®ããŒãååŸããããããŒã®æå¹æéãèšå®ããããããŒã®æå¹æéãååŸãããããµãŒããŒã®ç¶æ ã確èªãããµãŒãã¹ããŒã ...
ãã®ã¯ã©ã¹ã®é¡èãªä»£è¡šã¯Memcashedã§ãã ãããŠãããã¯Redisã®ãããã§ãã ãªãã¹ãã¬ããã§ïŒ 圌ã¯å®éã«ã¯åœŒãåç¬ã§ããç¬èªã®ã«ããŽãªãæã£ãŠããããããã®ã«ããŽãªã¯ãããŒã¿æ§é ãµãŒããŒããšåŒã°ããŸãã ããã€ãã®ã¿ã€ãã®ããŒãšæ³åã絶ãããã®ãäœæããããã«äœ¿çšã§ããéåžžã«è±å¯ãªã³ãã³ãã»ããïŒ150以äžïŒãããããããã®ã«ããŽãªã«å±ããŸããããã®ã«ããŽãªãèæ ®ããªãå Žåã¯ãããŒ/å€ã§ããã«èµ·å ããããšãã§ããŸãã RiakããããŸãã
ããã¥ã¡ã³ãæåããŒã¿ããŒã¹ã
ããã¯ãåã®ã«ããŽãªã®éåžžã«è€éãªããŒãžã§ã³ã§ãã ããã«ããè€éããå¢ããŸãããŸããããŒãã¹ãæäŸãããŸããå€ã¯ãèªã¿åããŸãã¯åé€ä»¥å€ã®æäœãã§ããªãäžéæãªããã¹ãBLOBã®çš®é¡ã§ã¯ãªããªããå€ãããã«åŸ®åŠã«æäœã§ããããã«ãªããŸããã ããã¥ã¡ã³ãã®äžéšã®ã¿ãå¿ èŠãªå Žåã¯ããããèªãããäžéšã®ã¿ãæŽæ°ã§ããŸãã
éåžžããã®ã¿ã€ãã®ããŒã¿ããŒã¹ã«ã¯ãè±å¯ãªããã¥ã¡ã³ãæ§é ãå«ãŸããŠããŸãã æšã ãããŸãã«ä»»æã®JSONãæ³åãããšãæ³åã§ããããããJSONããã®ãããªããŒã¿ããŒã¹ã«æžã蟌ãããšãã§ããŸãã ãããŠãéåžžãåºåã§ã¯ããã¬ã¹ãªãªãŒã¹ã«ãããšãJSONãããŒã¿ããŒã¹ã«å ¥ããŠåæããããšãã§ããŸãã éåžžãåé¡ã¯æåã®é ç®ã ãã§çºçããã®ã§ã¯ãªããå®éã«ã¯ããŒã¿ããŒã¹å ã®JSONã®é 眮ã§çºçãããã®åŸåŸ®åŠãªéããå§ãŸããŸãã
å žåçãªä»£è¡šè ã¯ãMongoDBãCouchDBãElasticSearchãªã©ã§ãã
åããŒã¿ããŒã¹ã
圌ãã®é·æã¯ãå€æ°ã®å±æ§ãæã€å€§éã®ããŒã¿ãä¿åã§ããããšã§ãã æ°ååã®ã¬ã³ãŒãããããåã¬ã³ãŒãã«300ã®å±æ§ãããå Žåãããã¯åããŒã¿ããŒã¹ã«ãããŸãã
ããšãã°ããªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ãšã¯å°ãç°ãªãæ¹æ³ã§ããŒã¿ãä¿åããŸã-ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã¯è¡ã«ä¿åããŸãã 1ã€ã®è¡ã®ãã¹ãŠã®å±æ§ã¯æšªã«äžŠãã§ããŸãã ãããã¯éã®ããšãè¡ããåãåå¥ã«ä¿åããŸãã
ãã¡ã€ã«ããããŸã-ããã¯ãã¹ãŠã®30åã¬ã³ãŒããããã®åã®ãã¹ãŠã®ãã£ãŒã«ããä¿åããŸãããã¹ãŠã¯è¿ãã«ä¿åãããŸãã ãããã£ãŠãå¥ã®åã¯å¥ã®ãã¡ã€ã«ã«æ ŒçŽãããŸãã ãã®ãããåã®ããŒã¿åã«é¢ããæ å ±ã䜿çšããŠãæ¹åãããå§çž®ãé©çšã§ããŸãã ãŸããããšãã°300åã®ãã¡3åãå¿ èŠãªå Žåããªã¯ãšã¹ããé«éåã§ããŸããæ®ãã®297åãããŒãããå¿ èŠã¯ãããŸããã
代衚è ã¯HBaseãCassandraãVerticaã§ãã ã¡ãªã¿ã«ãVerticaã«ã¯SQLã€ã³ã¿ãŒãã§ã€ã¹ããããŸãããäŸç¶ãšããŠåããŒã¿ããŒã¹ã§ãã
ã°ã©ãããŒã¿ããŒã¹ã
ã°ã©ãåŠççšã«èšèšãããŠããŸãã 念ã®ããã«ãã°ã©ãã¯é¢æ£æ°åŠãã€ãŸããšããžã§æ¥ç¶ãããé ç¹ã®ã»ããããåŸããããã®ã§ããããšãæãåºãããŠãã ããã èå³æ·±ãå°é£ãªã¿ã¹ã¯ãèŠããšãããã«ã°ã©ããèŠã€ããå¯èœæ§ãé«ããªããŸãã ããšãã°ããœãŒã·ã£ã«ãããã¯ãŒã¯ã¯1ã€ã®å€§ããªã°ã©ãã§ãã éè·¯ãããã¯ãŒã¯ãšã«ãŒãã£ã³ã°ã補åã®æšå¥šã
ãããã®ããŒã¿ããŒã¹ã®é·æã¯ãç¹æ®åã®ããã«ãã°ã©ãã«å¯ŸããŠããããçš®é¡ã®æäœãå¹æçã«å®è¡ã§ããããšã§ãããåãç¹æ®åã®ãããããŸãäžè¬çã§ã¯ãããŸããã
ããã§ãããã¹ãŠã®ã¿ã¹ã¯ã«ã°ã©ããããããã§ã¯ãããŸãããã°ã©ããããå Žåãããã¯ããããããã»ã©å€§ãããªãããªãœãŒã¹ã«ãã£ãŠãæ°ããããŒã¿ããŒã¹å šäœããããžã§ã¯ãã«ãã©ãã°ããããããäœããã®çš®é¡ã®ã°ã©ãåŠçãã¢ããªã±ãŒã·ã§ã³ã§ã²ãã«ãããæ¹ãå®äŸ¡ã§ããåŸãå¿ èŠããããŸãã ãããŠããã®æ°ããããŒã¿ããŒã¹ã«ã¯å€ãã®åé¡ããããŸãã ç§ã®ç·Žç¿ã§ã¯ããã§ããã
ãã«ãã¢ãã«ããŒã¿ããŒã¹ã
ãããã¯ã以åã®ã«ããŽãªããã®2ã€ä»¥äžã®ã«ããŽãªãåæã«å«ãããŒã¿ããŒã¹ã§ãã
å¿ èŠã«å¿ããŠ-ææžãäœæããå¿ èŠã«å¿ããŠ-ã°ã©ããäœæããŸãã ããšãã°ãFoundationDBã«ã¯ã¡ã€ã³ã¬ã€ã€ãŒã§ããããŒ/å€ããããSQLã¬ã€ã€ãŒã¯ãã®ã¬ã€ã€ãŒã®äžã«äœããã®åœ¢ã§é©åããŠããŸãã é åžããããããŠã³ããŒãããŠãã¥ãŒã¹ã¬ã¿ãŒã«ãµã€ã³ã¢ããããæ¯é±ã¡ãŒã«ãéãããŸããããé ä¿¡ããããèµ·åããŠèµ·åããããšãã§ããããã®ä»çµã¿ãæããŸããã æ°ãæåã®3æã«Appleããããã®ãŠãŒã¶ãŒãè³Œå ¥ãããµã€ãããé åžããŠã³ããŒããžã®ãã¹ãŠã®ãªã³ã¯ãããã«åé€ãããããä»ã§ã¯æåããŸãããçŸåšããã®è£œåã¯ãããªãã¯ãã¡ã€ã³ã«å«ãŸããŠããªãããã§ãã 圌ãã¯è³Œå ¥ãããã®ã§ã圌女ã¯ããããããŸããã£ãã
誰ããããããè³Œå ¥ãããŸã§ãç§ãã¡ã觊ããæ©äŒããã2ã€ãããŸãã
ããŒã¿ã®ä¿åæ¹æ³ã«å¿ããåé¡ããŸã ãããŸãã
ããŒã¿ããŸã£ããä¿åããªãããŒã¿ããŒã¹ãããããã¹ãŠãã¡ã¢ãªã«ä¿åãããŸãã ãããã£ãŠãããã»ã¹ãåèµ·åãããšãããŒã¿ã倱ãããŸãã 解決æ¹æ³ã¯2ã€ãããŸãã埩å ã§ããªãéèŠãªããŒã¿ãä¿åããªãããã¬ããªã±ãŒã·ã§ã³ãç©æ¥µçã«äœ¿çšããŸãã éèŠã§ãªãããŒã¿-ããã¯ãããšãã°ããã£ãã·ã¥ã§ãããã£ãã·ã¥ãã©ããã«æ¶ããå Žåãã¢ããªã±ãŒã·ã§ã³ã¯èœã¡ãããã£ãã·ã¥ãå埩ããŠãŠã©ãŒã ã¢ãããããŸã§æžéããŸãããèŽåœçãªããšã¯äœãèµ·ãããŸããã
ãã®ã¢ãŒãã¯ãããã©ãŒãã³ã¹ãé«éåããããã«äœ¿çšãããå ŽåããããŸãã ããšãã°ãRedisãèŠãŠãã ããã 1ç§ãããæ°åãæ°åäžã®æäœãåŠçã§ããŸãã ãã¡ãããäžéšã®äººã ã¯ãããå©çšããŠæ倧éã«ããŒãããŸãããããŒã¿ã¹ãã¬ãŒãžã¢ãŒãã§åäœããå Žåãã€ãŸã ã¹ãããã·ã§ããããªã»ãããããããã°ã«æžã蟌ããšããã£ã¹ã¯ã¯ãããå®è¡ã§ããªããªãããã£ã¹ã¯ãæäœãããšãµãŒããŒã®é床ãäœäžããŸãã ãããã£ãŠããã®ããªãã¯ãé©çšã§ããŸãã3ã€ã®Redis'ovã1ã€ã®ãã¹ã¿ãŒã2ã€ã®ã¹ã¬ãŒãã®ã·ã¹ãã ã䜿çšããŸãã ãã¹ã¿ãŒã§ã¯ããã¹ãŠã®æ°žç¶æ§ããªãã«ãããã£ã¹ã¯ã«ãŸã£ãã觊ããŸããããã¹ã¿ãŒã§ãããããããã«æžã蟌ã¿ãŸãã æåã®ã¹ã¬ãŒãã§ã¯ãæ°žç¶æ§ãç¡å¹ã«ããããããèªã¿åããŸãã ãããŠãæåŸã®å¥Žé·-誰ãããã«è§Šããããããèªãã§ããªãããããŠããã§ç§ãã¡ã¯æ°žç¶æ§ããªã³ã«ããŸãã ãããŠã圌ã¯ãèšå®ã«åŸã£ãŠãããŒã¿ããã£ã¹ã¯ã«ä¿åããŸãã çœå®³ãçºçããå Žåã埩æ§å¯èœãªããŒã¿ã®ã³ããŒãäœæãããŸãã
Redisã«ã¯ãããŒã¿ããã£ã¹ã¯ã«ä¿åã§ãã2ã€ã®ã¢ãã«ããããŸãã ãŸããã¹ãããã·ã§ãããä¿åã§ããŸã-ããã¯çŸæç¹ã§ã®ããŒã¿ããŒã¹ã®ãã£ã¹ãã§ãã ãã®ãã£ã¹ããé©åã«ããããã«ãRedisã¯ããã»ã¹ã®ã³ããŒãäœæãããã¹ã¿ãŒã«çºçããã¬ã³ãŒãã«ãã£ãŠãã£ã¹ããç Žæããªãããã«ããŸãã ãããŠããã®ãã©ãŒã¯ã¯èª°ããã®ã¹ãããã·ã§ããã«æžã蟌ã¿ãããªãããããã§ã«ãã®ã¹ãããã·ã§ãããä¿åããŠããŸãã
ãã®ã¡ãœããã¯ãè¿œå ã®ã¡ã¢ãªãå¿ èŠãšããããšãé€ããŠéåžžã«åªããŠããŸãã ãµãŒããŒã§çºçããã¢ã¯ãã£ããã£ã«ãã£ãŠã¯ãæ倧2åã®ã¡ã¢ãªãå¿ èŠã«ãªãå ŽåããããŸãã 2 GBã®ããŒã¿ããŒã¹ãããå Žåãã¹ãããã·ã§ãããä¿åããããã«å¥ã®2 GBã空ããŠããå¿ èŠããããŸãã
ãã°ã«ããŒã¿ãæžã蟌ãããã«æ§æããããšãã§ããŸã-ããã¯å¥ã®ææ³ã§ãã ã€ãŸããæžã蟌ã¿ã³ãã³ãã圌ã«å±ããšã圌ã¯ããã«ããããã°ã«ããã«æžã蟌ã¿ãåäœãç¶ããŸãã ããã2ã€ã®ã¢ãŒãïŒã¹ãããã·ã§ãããšãã°ïŒã¯ç¬ç«ããŠããŸãããã©ã¡ããäžæ¹ããŸãã¯äž¡æ¹ãäžç·ã«æ§æã§ããŸãã äžè¬ã«ããã®ãã°ã¯ããã§ã®ã¿è¿œå ãããŸã-ããã¯ãã©ã¹ã§ããããã§ã«ãã°ã«å ¥åãããããŒã¿ã¯å€æŽããããç Žæããããšã¯ã§ããŸããã ãã®ãããéåžžããã®ãã°ã¯å¥ã®ããããæã€å¥ã®ãã£ã¹ã¯ã«ãã®ãã°ãé 眮ããŸãããã®ãã£ã¹ã¯ã§ã¯ãRedis以å€ã¯äœãããããã£ã¹ã¯ãããã«ã¯è§ŠããŸããã ãããŠããã®é ã¯åžžã«ãã¡ã€ã«ã®çµãããæããŠããŸãã ãŸãããã¡ã€ã«ã®æåŸã«æ°ããæäœãæžã蟌ãããšã¯ãä»ã®ã¢ã¯ãã£ããã£ãçºçããéåžžã®ã·ã¹ãã ã§çºçããå Žåãããã¯ããã«é«éã§ãã
MongoDBãªã©ã®ä»ã®ããŒã¿ããŒã¹ã«ã¯ãã€ã³ãã¬ãŒã¹æŽæ°ãšåŒã°ããç°ãªãã¢ãã«ããããŸãã ããŒã¿ããŒã¹ãããŒã¿ãã¡ã€ã«ã®ã³ããŒã1ã€ãããããããçŽæ¥ãã©ã€ããã§å€æŽããŸãã ããã¯ããŸãå®å šãªæ¹æ³ã§ã¯ãããŸãããããšãã°ãå€æŽäžã«é»æºãåããå Žåã¯ãããŒã¿ããŒã¹ãç ŽæããŠããããã責任ããããŸãã ãã®ãããããã€ãã®ããŒãžã§ã³ã®åã«ããã°ãæ·»ä»ããŠããŸãã-å¶åŸ¡ãã°ãåŒã³åºããããã©ã«ãã§æå¹ã«ããŸããã ãããã£ãŠã2ã€ã®ã¬ããªã«ãªãã§Mongoãå®è¡ã§ããããã«ãªããããŒã¿ãæãªãããªãå¯èœæ§ããããŸãã
NoSQLã«ã€ããŠèšãã°ãCAPå®çã«èšåããããšã¯ã§ããŸãããããã¯2ã€ã®ããŒãã®ãããªãã®ã§ãã
å®çã¯2001幎ã«å®åŒåããããã®åŠ¥åœæ§ã倱ããäžè¬çã«èªã䟡å€ããªããšèãã人ãããŸãããèšåãã䟡å€ã¯ãããŸãã ãã®ããã«èãããŸãïŒåæ£ã·ã¹ãã ã¯ã次ã®3ã€ã®ç¹æ§ã®ãã¡2ã€ä»¥äžãåæã«æã€ããšã¯ã§ããŸãã-å¯çšæ§ãäžè²«æ§ãããã³ããŒãã£ã·ã§ã³ã®èš±å®¹ç¯å²ã§ãã
å®éãããã©ã«ãã§ã¯ããŒãã£ã·ã§ã³ã®èš±å®¹ç¯å²ã¯ã©ãã«ã§ããããããã¢ã¯ã»ã·ããªãã£ãŸãã¯äžè²«æ§ã®2ã€ã®éžæè¢ãããããŸããã ç§ã¯ããããã¯ãŒã¯ãåæãããå Žåããããã¯ãŒã¯ãåæãããå Žåã«èªåã§åæããããããªãããã¯ãŒã¯åæã«èããããšãã§ããªãã·ã¹ãã ãç¥ããŸããã
å¯çšæ§ã¯ãåæ£ã·ã¹ãã ãããããã®ããŒãã®ããããã䜿çšããåçãåãåãããšãä¿èšŒãããŠããå Žåã§ãã ããŒã¿ããªã¯ãšã¹ããããšããã®ããŒã¿ã®å€ãããŒãžã§ã³ãååŸã§ããŸããããšã©ãŒã§ã¯ãªãããŒã¿ãåä¿¡ãããããã®ãµãŒããŒã«å°éããªãå¯èœæ§ããããŸãã ããŒã¿ãåãåã£ãå Žåãã·ã¹ãã ã¯å©çšå¯èœã§ãã
å¯Ÿç §çã«ãã·ã¹ãã ã¯èª¿åãããããšãã§ããŸãã äžè²«æ§ãšã¯ã©ãããæå³ã§ããïŒ ããããŒãã§ããŒã¿ãèšé²ãããã°ããããŠå¥ã®ããŒãã§ãã®ããŒã¿ãèªã¿åãããšãããšãã·ã¹ãã ã«äžè²«æ§ãããå Žåãä»ã®å Žæã§èšé²ããããŒã¿ã®æ°ããããŒãžã§ã³ãååŸãããŸãã
ãããã£ãŠãåæ£ã·ã¹ãã ã¯ãAPãŸãã¯CPã®2ã€ã®ãã£ã³ãã®ããããã«é¢é£ããŸãã
å®éã«ã¯ã3çªç®ã®ç§å¯ã¯ã©ã¹ããããŸã-ããã¯åãªãPã§ããã圌ã®ã·ã¹ãã ããã®ãããªãã®ã§ããããšãèªãããã£ãŠããããŒã¿ããŒã¹ã¡ãŒã«ãŒã¯ãããŸããã ã€ãŸããPã ãã®å Žåãã¢ã¯ã»ã·ããªãã£ãäžè²«æ§ããããŸããã
ãããã£ãŠãã·ã¹ãã ãCPïŒã€ãŸããäžè²«æ§ãšããŒãã£ã·ã§ã³èš±å®¹å€ïŒèªäœãåŒã³åºãå Žåãäžææã«ïŒããšãã°ãã¯ã©ã¹ã¿ãŒãããã2ã€ã®ããŒã¿ã»ã³ã¿ãŒéã«ééããããããŒã¿ã»ã³ã¿ãŒéã®æ¥ç¶ãåããŠããå ŽåïŒäžè²«ããã·ã¹ãã ã§ããïŒ ããŒãã«ç®ãåãããšãããŒãã¯ããã®ã¬ã³ãŒãã確å®ã«æäŸã§ããªãããšãããšãã°ã·ã¹ãã ã®ã»ãšãã©ã®ããŒããšéä¿¡ããŠããªãããšãããããšããã®ã¬ã³ãŒãã®ã¢ããªã±ãŒã·ã§ã³ãåã«æåŠãã倱æããŸãã ãã®åŸãæ¥ç¶ã埩å ããããšãã¢ããªã±ãŒã·ã§ã³ã¯åè©Šè¡ã§ããæåããå¯èœæ§ããããŸãã
ãŸããã·ã¹ãã ãAPãšåŒã°ããå Žåãå€ãããŒã¿ãè¿ãããšã§ã¢ããªã±ãŒã·ã§ã³ã®èŠæ±ãæºããããã«æåãå°œãããŸããæžã蟌ã¿èŠæ±ãåãå ¥ããŠã©ããã«æžã蟌ã¿ãã¯ã©ã¹ã¿ãŒå šäœã§å®è¡ã§ããŸãã ããã«ã¯åŸ®åŠãªéãããããŸãã ããšãã°ãã¯ã©ã¹ã¿ãŒã2ã€ã«åå²ããäž¡æ¹ã®éšåã«æžã蟌ãå Žåã競åãçºçããå¯èœæ§ããããŸãã ããéšåã§ã¯1ã€ã®ããŒã«1ã€ã®ããŒã¿ãæžã蟌ã¿ãå¥ã®éšåã§ã¯å¥ã®ããŒã¿ãæžã蟌ã¿ãŸãããæ¥ç¶ã埩å ããããšãåé¡ãçºçããŸããããŒã¿ã®ã©ã®ããŒãžã§ã³ãæ£ããã®ã§ããããã
ç¹ã«APã·ã¹ãã ã®å Žåããã·ã¢èªãžã®å€§ãŸããªç¿»èš³ã§-æçµçãªäžè²«æ§-ãšããçšèªãæãä»ããŸãããããã¯ã競åãããšã³ããªããªããã°ããã€ãã¯ã©ã¹ã¿ãŒã調æŽãããç¶æ ã«ãªãããšãæå³ããŸãã ã
ããããçŸå®ã®ç掻ã§ã¯ãçŽäºã®äžåšã«é Œãå¿ èŠã¯ãªããçŽäºã«ã©ã®ããã«å¯ŸåŠããããäºåã«èããªããã°ãªããŸããã
競åãããšã³ããªã2ã€ããå Žåã®æãç°¡åãªãªãã·ã§ã³ã¯ãæéã®ç«¶åã解決ããããšã§ãã倧ãŸãã«èšãã°ãæåŸã®ãšã³ããªããã¹ãŠã®åè ãããé ããªããŸãã
ããã«ããã€ãã®ã·ã¹ãã ã¯ããã®ãã¹ãŠãã¢ããªã±ãŒã·ã§ã³ã«ãã³ãããŸãã ã¢ããªã±ãŒã·ã§ã³ãããŒã¿ãèªã¿åãããšãããšãããŒã¿ããŒã¹ã¯ç«¶åãããããšãèªèãããšã競åãããã¹ãŠã®ããŒãžã§ã³ãã¢ããªã±ãŒã·ã§ã³ã«è¿ããŸããã¢ããªã±ãŒã·ã§ã³èªäœã¯ãç¬èªã®ããžãã¯ã«ãã£ãŠå°ãããæ£ããããŒãžã§ã³ãéžæããŠããŒã¿ããŒã¹ã«æäŸããå¿ èŠããããŸãã
ããã¹ããŒããªã¢ãããŒãã¯ãäžå¯èœã§ã¯ãªãã«ããŠãéåžžã«é£ãã競åãåŒãèµ·ããããŒã¿åã䜿çšããããšã§ãã ããšãã°ãããŒã¿åã¯è€æ°ã§ãã ã¯ã©ã¹ã¿ãŒãå£ããŠããŠãååã«ã¡ã³ããŒAãè¿œå ããæ®ãã®ååã«BãšCãè¿œå ããå Žåãæ¥ç¶ã埩å ããããããããã®ã¬ã³ãŒããä¿æããã®ã¯éåžžã«ç°¡åã§ããçµæã»ããïŒAãBãCïŒã
å¥ã®äŸã¯ã«ãŠã³ã¿ãŒã§ãã ã«ãŠã³ã¿ãŒãåå¥ã«ã€ã³ã¯ãªã¡ã³ãããæ¥ç¶ã埩å ãããããããããè¿œå ããŠãçµæã®ã«ãŠã³ã¿ãŒãååŸããŸãã RiakããŒã¿ããŒã¹ã«ã¯ç¹å¥ãªçšèªããããŸã-CRDT-競åã®ãªãè€è£œããŒã¿åãè¡šããŸãã ç¥èªã«ãããèå³ãããå Žåã¯ã°ãŒã°ã«ã§æ€çŽ¢ã§ããŸãã
NoSQLã®äœ¿çšã«ã€ããŠè©±ããŸãããã ãã€äœ¿çšããŸããïŒ
- é«ãã¹ã±ãŒã©ããªãã£ãå¿
èŠãªå Žåã
ãã®ã¿ã€ãã®ããŒã¿ããŒã¹ã䜿çšããæãéèŠãªçç±ã§ã¯ãªãã«ããŠããããã¯æãéèŠãªçç±ã®1ã€ã§ããè€éãã軜æžãããŠãããããæ¡åŒµã容æã ããã§ãã 以åã«ã¹ã±ãŒãªã³ã°ã®äž»ãªè² æ ãã¢ããªã±ãŒã·ã§ã³ã«ããã£ãŠããå Žåãããšãã°ã20åã®memcacheããããã¢ããªã±ãŒã·ã§ã³ããããã1ã€ã®ããã·ã¥ãªã³ã°ã«åéããŠä¿¡é Œæ§ãšã¹ã±ãŒã©ããªãã£ã確ä¿ããŠããå Žåãææ°ã®ããŒã¿ããŒã¹ã¯ãã¹ãŠãè¡ããŸããäœãèšå®ããå¿ èŠãããããŸããã ããŒããå®è¡ããã ãã§ãã¯ã©ã¹ã¿ãŒèªäœãæ€åºãããã¯ã©ã¹ã¿ãŒã«å ¥ããããŒã¿ã®äžéšãããŠã³ããŒããããããŒã¿ã®äžéšã®æäŸãéå§ãããŸãã ãããã£ãŠãæãŸããç·åœ¢ã¹ã±ãŒã©ããªãã£ãå®çŸããŸããããã¯ãNoSQLã®äžçã®èæ¯ã®1ã€ã§ããããŸãã
ç·åœ¢ã¹ã±ãŒã©ããªãã£ãšã¯ãã¯ã©ã¹ã¿ãŒãªãœãŒã¹ãå¢ããããšã§ãã¯ã©ã¹ã¿ãŒã®ç¹æ§ãæ¯äŸçã«åäžãããããšã§ãã ãµãŒããŒã®æ°ã2åã«ããŸãããçç£æ§ã¯2åã«ãªããŸããã ç·åœ¢ã«ã¹ã±ãŒãªã³ã°ããå Žåãéåžžã«ã¯ãŒã«ã§ãã
- ãããã¿ã€ãã³ã°ãéèŠãªãã€ã³ãã§ãã
åŸæ¥ããªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã§ã¯ããããžã§ã¯ãã®åãšãããžã§ã¯ãäžã®äž¡æ¹ã§ãäžå®éã®ã¡ã³ããã³ã¹ãå¿ èŠã§ãã ã€ãŸã ãããžã§ã¯ããéå§ããåã«ãããŒã¿ããŒã¹ã¹ããŒããæ€èšããäœæããããã䜿çšããŠããŒã¿ããŒã¹ãèµ·åããŠããããããžã§ã¯ãã®å®è¡äžã«æ°ããããžãã¹èŠä»¶ãçºçããããäœããã®èª€ããããããšãããã£ãå Žåã¯ãåãè¿œå ããå¿ èŠããããŸã...å€ãã®å Žåãããã¯ããããã³ã°æäœã§ãã ããã¯ã©ãããæå³ã§ããïŒ ã¢ããªã±ãŒã·ã§ã³ãé 眮ããå¿ èŠããããŸãã æ°æ¥éã1åéãªãã«ããã®ã¯ãç¶æ³ã®è€éãã«äŸåããããã¹ããŒã ã®æŽæ°ããã»ã¹ãæåã§å®è¡ããŸãã ã€ãŸã åè·¯ãã¹ã¬ãŒãã«ããŒã«ãããã¹ã¿ãŒã«ã¢ããã°ã¬ãŒãããä»ã®ãã¹ãŠã®ã¹ã¬ãŒããããã«åãæ¿ããŠãåè·¯ã1ã€ãã€ããŒã«ããŸãã ãã®åã«ãã¢ããªã±ãŒã·ã§ã³ã®ãšã©ãŒãçºçããªãããã«ãæ°ããããŒãžã§ã³ãšå€ãããŒãžã§ã³ã®ããŒã¿ããŒã¹ãåæã«äœ¿çšã§ããã³ãŒããããŒã«ã¢ãŠãããããšãå¿ããªãã§ãã ããã ããã¯ãã¹ãŠå®äºããŸããããé¢åã§ãã ã§ããªããšãã«ã©ãããŠïŒ ãããã£ãŠãåè·¯å³ã®ãªãããŒã¿ããŒã¹ãç¹ã«ããã¥ã¡ã³ãã®åãã¯ãããã«é äºãããæ°ããããŒã¿ã¹ããŒã ã䜿çšããã ãã§ããã¡ã€ã«ããŒã¿ã«è¡šç€ºãããã ãã§ãã 倧ãŸãã«èšã£ãŠããã£ãŒã«ããè¿œå ããŠããŸã£ããåé¡ã¯ãããŸããã , , . MongoDB , Postgres .
- â .
: , , , - , , , .
- .
, , . Mongo , .. , , 20- join', Mongo, Mongo. å©ç
- â .
, , . , , Redis. . Redis' , 10 , , .
- â .
, e-mail. . , e-mail. , , e-mail' . , - worker e-mail.
- .
, â , , . facebook, , , . , Amazon S3 . Riak' Mongo .
. , Riak' â 2-3- , Mongo â 16 , , 16 .
- .
- Redis, Riak Casandra .
- â « ».
, , ? , , , SELECT COUNT(DISTINCT) â . , -, - , Hadoop Hadoop' .
â . . â HyperLogLog. , . Salvatore ( Redis'), . , , , , 12 , 0,8%. â , .. 2 7 â 12 . , . ( ).
- â .
. , , .
- .
, - , Sphinx ElasticSearch.
NoSQL ?
- .
, , . , : « » « , », .. , - . , , . Hacker News Redis', , , , - .
- , « MongoDB» â Sarah Mei.
MongoDB â . , â , â , â , , , â ! , , , . â , , , , â , 5 â .
, , , , . ID', ID' . , .
- Embedding â .
â . , e-mail, , . â ⊠â .
, , , , ( ) â , 10 . 5 .
TextMaster' . , â , â . , .. . . .
2 , , , . , .. , . ã€ãŸã Embedding' .
- Embedding- â Embedding.
1- â MongoDB â - . , , Mongo , , , « «ruby»», ««ruby» «nosql»» ««ruby», «nosql»» â . , , â , . -, 2- , ID' , , .
, , .. . ID' , .. .
- .
« JSON, ». â . , , , .
- .
Stack Overflow ( ) « 5- , ?». . , « ?». ã€ãŸã , , - , . , MongoDB â â , . - .
.
, . , â , . , -. . , - , . â . - â , , , - , - , - 3- service pack'a. , , .
é£çµ¡å
» sergei.tulentsev@gmail.com
» twitter
» tech.tulentsev.com
â HighLoad++ Junior .
ãŸãããããã®è³æã®äžéšã¯ãé«è² è·ã·ã¹ãã HighLoadã®éçºã«é¢ãããªã³ã©ã€ã³ãã¬ãŒãã³ã°ã³ãŒã¹ã§äœ¿çšãããŸãã¬ã€ãã¯ãç¹å¥ã«éžæãããæåãèšäºãè³æããããªã®ãã§ãŒã³ã§ãã ç§ãã¡ã®æç§æžã«ã¯ãã§ã«30以äžã®ãŠããŒã¯ãªè³æããããŸãã æ¥ç¶ããŠãã ããïŒ
â " - ", , HighLoad++ Junior . NoSQL ? 確ãã«ïŒ