Embulkãæ¥åã·ã¹ãã ã§ä½¿ã£ã話
èæ¯
èªåã¯SIerã®ã¨ã³ã¸ãã¢ã§ããã
ãããããªã客æ§ã®ããããããªæ¥åã·ã¹ãã ã¨æ ¼éããã®ããä»äºã§ããã
ã¾ããä»ã¯embulk-input-jdbcã¨ãembulk-output-jdbcã®ã³ããã¿ããã£ã¦ããã
Â
æ¥åã·ã¹ãã ã¨RDBã¨ããã¹ããã¡ã¤ã«
æ¥åã·ã¹ãã ã§ã¯ãããã¦ãRDBã使ã£ã¦ããã
ããã¦ããµã¼ãéã§ãã¼ã¿ãé£æºããããã«ãRDBããããã¹ããã¡ã¤ã«ã«ã¨ã¯ã¹ãã¼ãããããããã¹ããã¡ã¤ã«ãRDBã«ã¤ã³ãã¼ãããããããã¨ãçµæ§ããã
ãããªã¨ãã©ããããã¨è¨ãã¨ãRDBä»å±ã®ãã¼ã«ã使ããã¨ãå¤ãã
ä¾ãã°ãOracleã¸ã®ã¤ã³ãã¼ãã§ããã°SQL*LoaderãMySQLã¸ã®ã¤ã³ãã¼ãã§ããã°mysqlimportãã¨ããããã«ã
Â
RDBä»å±ã®ãã¼ã«ã®åé¡ç¹
ãããããªã客æ§ããã¦ããããããªã·ã¹ãã ãããã®ã§ãRDBãããããã§ããã
ã¡ãªã¿ã«ããã¡ã®ä¼ç¤¾ã§ã¯ãOracleãSQL ServerãMySQLãå¤ãã
ãªã®ã§ãRDBæ¯ã«ãããããªã¨ã¯ã¹ãã¼ãï¼ã¤ã³ãã¼ããã¼ã«ã使ãåããªãã¦ã¯ãªããããããçµæ§å¤§å¤ã
ãã¼ã«ãã¨ã«ä»æ§ãéãããå¶ç´ãç°ãªãã
ç¹å®ã®æåã³ã¼ãã«ãã対å¿ãã¦ããªãã£ãããç¹å®ã®åºåãæåã«ãã対å¿ãã¦ããªãã£ãããç¹æ®æåã®ã¨ã¹ã±ã¼ããä¸ååã ã£ããã1è¡ã®æåæ°ã«å¶éããã£ãããâ¦ã
調ã¹ãã®ã大å¤ãã¨ããã ããªãã¾ã ããããçµå±ä»å±ãã¼ã«ã§ã¯å¯¾å¿ã§ãããèªä½ã®å¤æãã¼ã«ã§ä¸æ¦å¤æãã¦â¦ãã¿ãããªãã¨ãããã
Â
Embulkã«æ³¨ç®ããçç±
Embulkã¨ã¯ãOSSã®ãã«ã¯ãã¼ã¿è»¢éãã¼ã«ã§ããã
ãã©ã°ã¤ã³æ©æ§ã«ãããæ§ã ãªå ¥åºåã«å¯¾å¿ãã¦ããã
ãã¡ããCSVãTSVãªã©ã®ãã¡ã¤ã«ã®å ¥åºåãã§ããããRDBããã®å ¥åãRDBã¸ã®åºåãã§ããã
Embulkã®è¯ãã¨ããã¯ãRDBã®ç¨®é¡ã«ãããåºæ¬çã«ä½¿ãæ¹ãåããã¨ã ã
ããã«ãããRDBæ¯ã«ä»æ§ãç°ãªãç ©ããããã解æ¾ãããï¼ãã ãEmbulkãã©ã°ã¤ã³èªä½ã®éçºè ãé¤ãï¼ã
ããã¦ãä¸çªå¬ããã®ã¯ããããããã¡ã¤ã«ãã©ã¼ãããã«å¯¾å¿ã§ãããã¨ã ã
Embulkæ¨æºã®CSV Parser/Formatterãæè»ã ããããã§ã ããªãèªåã§æ°ããªãã©ã°ã¤ã³ãæ¸ããã¨ãã§ããã
ãã®æè»ãã¯RDBä»å±ã®ãã¼ã«ã«ã¯ç¡ãã
Â
å®éã«ä½¿ã£ãEmbulkãã©ã°ã¤ã³ã使ããªãã£ããã©ã°ã¤ã³
ãã®æ¥åã·ã¹ãã ã§ã¯ãOracleããã¿ãåºåããã¡ã¤ã«ã¸ã®ã¨ã¯ã¹ãã¼ããã¿ãåºåããã¡ã¤ã«ããOracleã¸ã®ã¤ã³ãã¼ããå¿ è¦ã ã£ãã
ããã¦ãã¨ã¯ã¹ãã¼ãã®æ¹ã«embulk-input-oracleãã©ã°ã¤ã³ã使ã£ãã
ã¤ã³ãã¼ãã«ã¯embulk-output-oracleãã©ã°ã¤ã³ã¯ä½¿ãããSQL*Loaderã使ã£ãã
SQL*Loaderã®æ¹ãé«éã ã£ãããããã©ã¼ãã³ã¹è¦ä»¶ãå³ããã£ãããã
ï¼ãã ãembulk-output-oracleãè¿ãå°æ¥SQL*Loaderã«è¿½ãã¤ãã¨æãï¼
ã¨ã¯ã¹ãã¼ãã®æ¹ã¯ãSQL*Plusã§SPOOLã使ãæ¹æ³ã¨æ¯ã¹ãããembulk-input-oracleã®æ¹ãé«éã ã£ãã
Â
Embulkã使ã£ãéã®å·¥å¤«ç¹
Embulkã¯JRubyã使ã£ã¦ããã®ã ããããã®åæåã«çµæ§æéãæããã
ã¨è¨ã£ã¦ã1ï½2ç§ã ãã
ã§ãã¨ã¯ã¹ãã¼ãããããã¼ãã«ã¯æ°ååãã£ã¦ããã¼ã¿éãã¨ã¯ã¹ãã¼ãããã¿ã¤ãã³ã°ãããããã§ããã
ã§ã件æ°ã®å°ãªã10åã®ãã¼ãã«ãåæã«ã¨ã¯ã¹ãã¼ããã¨ããã¨ãã件æ°ã®å²ã«æ°åç§ãæãã£ã¦ãã¾ããEmbulké ãããã¨ãããã¨ã«ãªã£ã¦ãã¾ãã
ããã§ãEmbulkãããã»ã¹ã¨èµ·åããã®ã§ã¯ãªããEmbulkEmbedã使ã£ã¦ã¯ã©ã¹ã©ã¤ãã©ãªã¨ãã¦å¼ã³åºããã¨ã«ããã
ã¤ã¾ãã1ã¤ã®EmbulkEmbedã¤ã³ã¹ã¿ã³ã¹ã§10åã®ã¨ã¯ã¹ãã¼ããè¡ãã®ã§ããã
ãããªããåæåã¯1åã§æ¸ãã
Â
ã¾ããã¨ã¯ã¹ãã¼ããã件æ°ããã°ã«åºãã¦æ¬²ãããã¨ããè¦æããããç°¡åãªãã£ã«ã¿ãã©ã°ã¤ã³ãä½ã£ã¦å¯¾å¿ããã
ãããEmbulkã ããããç°¡åã«ã§ããè¸å½ã§ããã
Â
Embulkã®ç¨¼åç¶æ³
éçºæã«ãcloseãæ£ããå¼ã°ããªããã¨ãããã°ããã£ãããããã¯ä¿®æ£æ¸ã¿ã
ãã以å¤ã§ã¯ããã¹ããæ¬çªç¨¼åå¾ããä¸åº¦ãè½ã¡ããã¨ãªããé常ã«å®å®ãã¦åä½ãã¦ããã
Â
ä»å¾Embulkï¼ã¨ãããembulk-output-jdbcï¼ã«å¿ è¦ãªãã¨
ãã«ã¯ãã¼ãã«æ±ããããã®ã¯ãã¡ã³ããã³ã¹æ§ã¨ãæè»æ§ããããããã¯ãããã©ã¼ãã³ã¹ãæéè¦ã§ãããã¨ãå¤ãã
ã¨ãã訳ã§ãembulk-output-jdbcã®ããã©ã¼ãã³ã¹ãåä¸ãã¹ããããããã¨è©¦è¡é¯èª¤ãã¦ããä»æ¥ãã®é ã§ããã
Â