æ¦è¦ VPSã®ãæ軽ãã¨ã¯ã©ã¦ãã®æ¡å¼µæ§ãåããConoHaã¨å ¨ææ¤ç´¢ã¨ã³ã¸ã³Groongaï¼ããããï¼ãã³ã©ãããåå¼·ä¼ã§ãã ConoHaãéå¶ããGMOã¤ã³ã¿ã¼ãããããã®ä¼å ´æä¾ã§éå¬ãã¾ãï¼å½æ¥ã¯ãç¾é²ãã®ã¯ããä¼å ´ã«é§ãã¤ãã¾ããåå¼·ä¼ã®éä¸ã§ç¾é²ãã®ã¯ããæ¯åãããããããããã大ä¼ãå®æ½ãã¾ããGroongaã®åå¼·ãã§ããä¸ã«ç¾é²ãã®ã¯ã«ãä¼ãã¦ãå¾ã§ããï¼ ãã®åå¼·ä¼ã®ããã·ã¥ã¿ã°ã¯ã#groongaãã§ããåå è ã®æ¹ã¯ãã¤ã¼ãããã¨ãã«ãã®ããã·ã¥ã¿ã°ãã¤ãã¦ãã ãããåå ãããã£ããã©ã§ããªãã£ãæ¹ã¯ãã®ããã·ã¥ã¿ã°ã追ãããã¦ãã ããã å½æ¥ã®ãã¤ã¼ãã®ã¾ã¨ãï¼ConoHa presents - Groonga "How-To" Talks #groonga ã¿ã°ã¾ã¨ã ãã¼ã ãã®åå¼·ä¼ã®ãã¼ãã¯ãHow-Toãã§ããåå è ãGroongaã®å ·ä½çãªä½¿ãæ¹ãåå¼·ã§
@ITã«ä»¥ä¸ã®ãããªè¨äºãåºã¦ã ä»åãããã°ããã®éã¯ãã¾ã£ããéã®ä¾ãã¤ã¾ã使ãã¨ããã°ã©ã ã®å¦çæ§è½ãä¸ããã¨ããã·ã¹ãã ã³ã¼ã«ãç´¹ä»ãã¦ãããã·ã¹ãã ã³ã¼ã«ãå¼ã¶åæ°ã¯å°ãªãæ¹ãå¦çæ§è½ã¯é«ããªãã¨ããååã¯å¤ãããªãããå¼ã³åºãã¦ããã¨å¦çæ§è½ãåä¸ããã·ã¹ãã ã³ã¼ã«ã¨ãããã®ãåå¨ããã®ã ãããããã·ã¹ãã ã³ã¼ã«ã使ããªãã§ãããã¨ã¯ãã¨ã¦ããã£ãããªãã ä»åç´¹ä»ããã·ã¹ãã ã³ã¼ã«ã¯ãmmap(2)ãã ãããã§ã¯è©³ããä»çµã¿ã解説ããªãããmmap(2)ã¯ãããã°ã©ã ã®å¦çæ§è½ã«å¿ ãè¯ãå½±é¿ãä¸ããã ãã¯ããã£ãï¼ é«éåã«å¹ãã·ã¹ãã ã³ã¼ã« (1/2)ï¼ç¥ã£ã¦ãã¯ããã·ã¹ãã ã³ã¼ã«ï¼3ï¼ - ï¼ IT ãããçã«åããã®ãããGoè¨èªã§mmapã·ã¹ãã ã³ã¼ã«ã使ã£ããã¡ã¤ã«èªã¿è¾¼ã¿ã®é«éåæ¤è¨ã¨Cè¨èªã®ã³ã³ãã¤ã©ã®è©± - ryochack.blogãã®ãããªããã°ã¨ã³ããªã
è¦ããã«AnyEventã§groongaã使ãããã£ãã®ã§perlã¢ã¸ã¥ã¼ã«æ¸ãã¾ããããã§ãã£ã¦ä¹ ã ã«CPANã«ã¢ãããã¾ããããã¨ããåç½ã§ãã AnyEvent::Groonga - Groonga client for AnyEvent http://search.cpan.org/~miki/AnyEvent-Groonga/ éåæã§ã¬ã³ã¬ã³å ¨ææ¤ç´¢ã¨ã³ã¸ã³ãå©ããããªãã¨ãããã¨ã§AnyEvent::Groongaã ãªãYappo ãããåãçµã¾ãã¦ããCã©ã¤ãã©ãªã®perlãã¤ã³ãã£ã³ã°ã¹ã¨ã¯ç°ãªããAE::Groongaã¯groongaãã£ã¹ããªãã¥ã¼ã·ã§ã³ã«å梱ããã¦ããªãªã¸ãã«ã®ãgroongaãµã¼ããã対象ã¨ãã¦ãã¾ãã ãã®groongaã®çµã¿è¾¼ã¿ãµã¼ãã¯ããã¤ã¯httpã¨gqtp(groongaç¬èªãããã³ã«ãããï¼ä¸¡æ¹ãããã¹ãã¾ããã¾ãæ®éã«ãã¼ã«ã«ã®DB
ãã°ããããã°ãæ´æ°ãã¦ããªãã£ãã®ã§ããããããåéãããã¨æãã¾ãã ããåå¹´ãããTritonnã«åãããªãã£ãã¨æãã®ã§ããããã®éæ°ããã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã®éçºã«çæãã¦ãã¾ãããSennaã®å¾ç¶ãããã¯ãã¨ãã¦groongaããªãªã¼ã¹ããã¾ãããããã®groongaãMySQLã®ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã«ããã¨ãããã®ã§ãã æ°ããã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã¯ãããã°ããããããã¹ããªãªã¼ã¹ããäºå®ã§ãã å¾æ¥ã®MySQL 5.0åãã®Tritonn(MyISAM+Senna)ã¯å¤§ããªãã©ãã«(è½ã¡ããã°ãªã©)ãç¡ãã£ãã®ã§ãã°ããã¢ãããã¼ããã¦ãã¾ããã§ãããããã¡ããæ¥æãããã«ã¢ãããã¼ãçããªãªã¼ã¹ãããã¨æã£ã¦ãã¾ãã ãã®ã¢ãããã¼ãçã§ã¯MySQL 5.0ã®ææ°çã¸è¿½éããã¨å ±ã«ãä»ã¾ã§Tritonnã§ã¯å®è£ ãã¦ããªãã£ããORDER BYããªãã¦ãscoreé ã§ã½ã¼ããã¦ã
groongaã«ããã¦ããã¼ã¿ãã¼ã¹ãæ±ãããã®API群ã«ã¤ãã¦æ¦èª¬ãã¾ãã groongaã¯ãRDBMSã§ããã¨ããã®ãã¼ãã«ã»ã«ã©ã ãæ±ãAPIãæä¾ãã¾ãã ãã¼ãã«ã¯ãå é¨çã«ããã·ã¥ãã¼ãã«ãããã¯ãããªã·ã¢ãã©ã¤ãåºã¨ãªã£ã¦ãã¾ãã ããããã®è¦ç´ ã«ã¤ãã¦ãã©ã®ãããªæä½ãè¡ãããã説æãã¾ãã grn_hash grn_hashã¨ã¯ã以ä¸ã®æä½ãè¡ããAPI群ã§ãã ä»»æã®keyãæå®ãããã¼ã¿ä¿å ä»»æã®keyãæå®ãããã¼ã¿åå¾ ä»»æã®keyãæå®ãããã¼ã¿åé¤ ã«ã¼ã½ã«ãç¨ãããå ¨ã¦ã®key/valueã®åå¾ã»è¨å®ã»åé¤ å é¨ã®å®è£ ã¯ãããã·ã¥ãã¼ãã«ã§ãã ã¡ã¢ãªä¸ã«ä½æãããã¨ãããã¡ã¤ã«ã¨ãã¦ä½æãããã¨ãã§ãã¾ãã ãããã*DBMã¨åçã®ãã¨ãã§ãã¾ãã Tokyo Cabinetã§ããã¨ããã®TCHDBã§ããã grn_pat grn_patã¨ã¯ã以ä¸ã®æä½
å ¨ææ¤ç´¢ã¨ã³ã¸ã³ã®groongaããã¹ããªãªã¼ã¹ãã¾ããã groonga æ¬æ¥éå¬ããããkey-value storeåå¼·ä¼ã§çºè¡¨ããã¦ããã ãã¾ããã ä»ã¾ã§ãSennaã«ã¯ Tritonnçµç±ã§ä½¿ã£ãå ´åãMySQLå´ã®ã¤ã³ããã¯ã¹ã¨ã®ä½µç¨ãé£ãããSennaæ¬æ¥ã®ããã©ã¼ãã³ã¹ãçºæ®ã§ããªãã£ãã å¾æ¥ã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã§ã¯ããã¼ã¯ãã¤ã¶ã®åãæ¿ããªã©ã®æè»æ§ããªãã£ãã ã¨ãã£ãåé¡ãããã¾ããã groongaã¯ãããã«å¯¾ããè¿çã§ãã èªåã§ãã¼ã¿ãã¼ã¹æ¸ãã°ããããããï¼ æè»ãªAPIç¨æããã°ããããããï¼ ã£ã¦ãã¨ã§ããã ãã¼ã¿ãã¼ã¹ã¯ãkey-valueã¹ãã¢ãçµã¿åãããcolumnã¹ãã¢çãªæãã«ãªã£ã¦ãã¾ãã 詳細ã«ã¤ãã¦ã¯ãä»å¾å¥ã¨ã³ããªãããã¥ã¡ã³ãã§è¿°ã¹ã¾ãã ä»å¾ã¯ãSennaã¯ãã°ä¿®æ£ã®ã¿è¡ãã¡ã³ããã³ã¹ã¢ã¼ãã«ç§»è¡ãã¾ãã å®é使ã£ã¦ã¿ãã ä»å
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}