YAP(achimon)C::Asia Hachioji 2016midã®è³æã§ãã
PostgreSQL Advent Calendaråå ä½åã§ãã ãã¿ã¯ããããèãããã ãã©ãä¾ãã°node.js+plv8jsã§javascriptã ãã§éã¶ã¨ãããªããã¡ãã£ã¨ããã©ã¤ãã©ãªæ¸ãã¨ããã¢ã¤ãã¢ã¯ããã©é¢¨éªãå¼ãã¦å®è¡åããªãã®ã§ææãã«ãã¾ãããåã«pgbenchåãã¾ããã ãã ãæå ã«ãã£ãwubi+ubuntu8.10(æ°ãããã¼ã¸ã§ã³ã¯ä½æ ããã¡ã®ãã·ã³ã§åããªãã£ãã®ã§ä½æ ãå¤ãï¼ã§ã³ã³ãã¤ã«ã§ãããã¼ã¸ã§ã³ãçã£ç«¯ããã¤ã³ã¹ãã¼ã«ããã¨ãããã¿ããã¾ãã¾ãããæ¬å½ã¯WALå°å ¥åã®6.5ã¾ã§ããããã£ããã©ã7.2ã§pg_hba.cãã¨ã©ã¼ã§å ¥ãããç´ãããã¨æã£ããæéããããããªããæ念ã å®é¨æ¦è¦ 以ä¸ã®ãã¼ã¸ã§ã³ï¼å ¨ã¦ãã¤ãã¼ãã¼ã¸ã§ã³ã¯æçµçï¼ãåä¸ãã·ã³ã«ã¤ã³ã¹ãã¼ã«ããæåãæ¯è¼ããã 7.3 7.4 8.0 8.1 8.2 8.3 8.4
MongoDB ã¯ããããã NoSQL ãã¼ã¿ãã¼ã¹ã®ä¸ã¤ã§ãã å ¬å¼ãµã¤ãã®æè¨ããã®ã¾ã¾ä¿¡ãããªãã ããã¥ã¡ã³ãæåã¹ãã¬ã¼ã¸ã§ ã¤ã³ããã¯ã¹ããµãã¼ããã¦ã㦠ã¬ããªã±ã¼ã·ã§ã³ãã§ãã¦é«å¯ç¨æ§ã«å¯ãã§ã㦠èªåãã¼ã¿åå²ãã¦ãã㦠å¤å½©ãªæ¤ç´¢ã¯ã¨ãªã使ã㦠æ´æ°ãã¢ãããã¯ã§éã㦠Map/Reduce ã使ããããã¡ãã£ããã㦠GridFS ã£ã¦ããä½ã§ãã¤ã£ããããã¡ã¤ã«ã·ã¹ãã ã使ã£ã¦ã㦠åç¨ãµãã¼ãããã ã¨ãã£ãç¹å¾´ãæã¤ãããã¯ãã§ãã ç§ã¯ãèªååæ£ã¨ãåç´ãªKVSã«ã¯ãªãè±å¯ãªæ¤ç´¢ã¯ã¨ãªã«æ¹ããã¦ã使ã£ã¦ã¿ãããã¨æãã¾ãããã¤ã³ããã¯ã¹ãããã®ãããã§ããï¼ãã¨ããããMongoHQ ã§ããï¼ Amazon EC2 ã®ãµã¼ãã¼ã¨ã¤ãªããããããããèªåã¹ã±ã¼ã«ã¢ã¦ã管çä¸è¦ãµã¼ãã¹ã§ããæåç¡æããã¹ã¿ã¼ããã¦å®ããã§ãããã¼ãããã決ãæã§ãã ã§ã¯ãã¤ã³
2011å¹´04æ28æ¥19:00 NoSQL å·ç ãNoSQLãã¼ã¿ãã¼ã¹ãã¡ã¼ã¹ãã¬ã¤ãããå·çãã¾ãã æè¿ãã¾ãããã°ãæ¸ãã¦ããªãã£ãããã§ãããå®ã¯åãã¦æ¬ã®å·çããã¦ãã¾ããããã¡ãã§ãï¼ã§ã§ããï¼ï¼(ï¼ï¾âï¾)㣠NoSQLãã¼ã¿ãã¼ã¹ãã¡ã¼ã¹ãã¬ã¤ã NoSQLãã¼ã¿ãã¼ã¹ã«ã¤ãã¦æ¸ããã å½å å ã®å ¥éæ¸ã§ãï¼ï¼å¤åï¼ æè¿ã§ã¯ NoSQL ã¨ãããã¼ã¯ã¼ããããºã¯ã¼ãã«ãªãã¤ã¤ãããããã£ãã NoSQL ã£ã¦ä½ã ããï¼ãã¨ãããªã¬ã¼ã·ã§ãã«ãã¼ã¿ãã¼ã¹ã¨ã©ãéãã®ï¼ãã¨çåã«æããã¦ããæ¹ãå¤ãã®ã§ã¯ãªããã¨æãã¾ããããåå¼·ãããã«ãæåã®ä¸æ©ãè¸ã¿åºãã®ã£ã¦ãªããªã大å¤ã§ããããä½ããã£ã±ã種é¡ãããããããã§ãæ¬æ¸ããã£ããã¨ãã¦ããã ãããããï¼ï¼ NoSQLãã¼ã¿ãã¼ã¹ã¯ç´°ãããã¥ã¼ãã³ã°ãè¡ãããªã¬ã¼ã·ã§ãã«ãã¼ã¿ãã¼ã¹ã§ã¯æ±ããªããããªå¤§è¦æ¨¡ãªå¦çãæ±
â ã¤ã³ããã¯ã¹ã¨ã¯ ãã¼ã¿ãã¼ã¹ã®ä¸çã§ãã¤ã³ããã¯ã¹(ç´¢å¼)ã¨ã¯ãã¼ãã«ã«æ ¼ç´ããã¦ãããã¼ã¿ã é«éã«åãåºãçºã®ä»çµã¿ãæå³ãã¾ãã ã¤ã³ããã¯ã¹ãé©åã«ä½¿ç¨ãããã¨ã«ãã£ã¦SQLæã®å¿çæéãåçã«æ¹å ãããå¯è½æ§ãããã¾ãã ã¤ã³ããã¯ã¹ã«ã¯B-Treeã¤ã³ããã¯ã¹ãã¯ãããããããããã¤ã³ããã¯ã¹ã é¢æ°ã¤ã³ããã¯ã¹ãªã©ã®ç¨®é¡ãããã¾ãããããã§ã¯æãä¸è¬çã«ä½¿ãããã㤠ã»ã¨ãã©ã®DBMSã§ãµãã¼ãããã¦ããB-Treeã¤ã³ããã¯ã¹ã«ã¤ãã¦è§£èª¬ãã¾ãã â» CREATE INDEXæã§ãªãã·ã§ã³ãæå®ããªãå ´åã¯é常B-Treeã¤ã³ããã¯ã¹ã ä½æããã¾ãã â B-Treeã¤ã³ããã¯ã¹ã®ããã¿ B-Tree(Balanced Tree)ã¤ã³ããã¯ã¹ã¯æ¬¡ã®ãããªããªã¼ç¶ã®æ§é ã«ãªã£ã¦ãã¾ãã ããªã¼ã®å é ã¯ããããããã¯ã¨å¼ã°ãã¦ãã¾ããããããããã¯ã§ã¯ããã¼å¤ã® ç¯å²
å¤æ°ã®ååç©ã®ãã¡ã¤ã«ã¯SMILESå½¢å¼ã§sqliteã®ãã¼ã¿ãã¼ã¹ã«ãã¦ããã¨ããã¤ãããããã®ã ãã©ããã¾ã«ããã£ã¨ã¢ã¯ã»ã¹ãã¦ã´ãã§ãããã¨ãã«sqliteã§SQLæçºè¡ãã¦ã¨ãããã©ãããã£ããããã ã§ãSQLAlchemy使ãã¨pythonã®å¯¾è©±ç°å¢ã§ä½¿ãã¦ãã®ã¾ã¾pybelã¨ãã«æã£ã¦ãããã®ã§ä¾¿å©ãªãã ãã©ããã¡ãã¡ãããã³ã°ããªãã¦ãè¯ããããã create_engineã§sqliteã®ãã¡ã¤ã«ãæå®ãã¦ãreflectãTrueã«ããã°ããã from sqlalchemy import * db = create_engine('sqlite:///test.db') metadata = MetaData(bind=db, reflect=True) table = metadata.tables['table_name']
以ä¸ã®æç« ã¯ãMartin Fowler ã«ãã Domain Logic and SQL ã®æ¥æ¬èªè¨³ã§ããã ãã¼ã¿ãã¼ã¹æåã½ããã¦ã§ã¢éçºè ã¨ã¡ã¢ãªä¸(in-memory)ã¢ããªã±ã¼ã·ã§ã³ã½ããã¦ã§ã¢éçºè ã¨ã®éã®ã®ã£ããã¯ãããæ°åå¹´ãå¾ã ã«åºãã£ã¦ãã¦ããããã®ã®ã£ãããåå ã§ããã¼ã¿ãã¼ã¹ã®æ©è½(SQLãã¹ãã¢ãããã·ã¼ã¸ã£)ãã©ã®ããã«æ±ãã°ããã®ãã¨ããè°è«ãæ°å¤ãå·»ãèµ·ãã£ã¦ãããããã§ã¯ããã¸ãã¹ãã¸ãã¯ã SQL ã«ç½®ãã¹ãããããã¨ãã¡ã¢ãªä¸ã®ã³ã¼ãã«ç½®ãã¹ããã¨ãã£ãåé¡ã«ã¤ãã¦ã主ã«ããã©ã¼ãã³ã¹ã¨æ´æ°æ§ã®è¦³ç¹ããèå¯ãè¡ããèå¯ã«ã¯ç°¡åãªä¾ã使ãããSQL ã¯ã¨ãªã¯ãã£ããã¨ãããã®ï¼rich SQL queriesï¼ãç¨ããã®ã§æªããããã ã¨ã³ã¿ã¼ãã©ã¤ãºã¢ããªã±ã¼ã·ã§ã³ï¼è¨³æ³¨ï¼ä»¥ä¸ãEAï¼æ§ç¯ã«é¢ããæ¬ï¼ç§ã®è¿èãP of EAAããªã©ï¼ãèªãã¨ããã¸ã
au one netã®ããã°ãµã¼ãã¹ ãLOVELOGãã¯2014å¹´6æ30æ¥ããã¡ã¾ãã¦æä¾ãçµäºè´ãã¾ããã æ°¸ããã®ãå©ç¨ãèª ã«ãããã¨ããããã¾ããã å¼ãç¶ãau one netããæ顧ããã ãã¾ãããããããããé¡ãç³ãä¸ãã¾ãã â»ãææ°ã§ã¯ãããã¾ãããæ°ããã°ã«ã¦é²è¦§ã®çãã¾åãã«ããã°URLå¤æ´çããå¨ç¥ããã ãã¾ãããããé¡ãç³ãä¸ãã¾ãã
au one netã®ããã°ãµã¼ãã¹ ãLOVELOGãã¯2014å¹´6æ30æ¥ããã¡ã¾ãã¦æä¾ãçµäºè´ãã¾ããã æ°¸ããã®ãå©ç¨ãèª ã«ãããã¨ããããã¾ããã å¼ãç¶ãau one netããæ顧ããã ãã¾ãããããããããé¡ãç³ãä¸ãã¾ãã â»ãææ°ã§ã¯ãããã¾ãããæ°ããã°ã«ã¦é²è¦§ã®çãã¾åãã«ããã°URLå¤æ´çããå¨ç¥ããã ãã¾ãããããé¡ãç³ãä¸ãã¾ãã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}