è¨èªã®åå¼·ä¼ã§ãã®è¨èªã®è©±ãããªã人ã©ã³ãã³ã°å ã ã®ç¬¬ä¸ä½ããã¼ã ãã§ãï¼å½ç¤¾æ¯
æ§ããã«è¨ã£ã¦ãæé«ãªæ¯åº¦ããªãã¿ #kichijojipm
ã§ä»æ¥LTãã話ã®è£è¶³ã§ãã
ã¿ã¤ãã«ã¯åºè½ã¡ã§ãã å ¨ç¶æå¼·ãããªãã¦é å¼µã£ã¦ãã£ã¦ããã£ã¦è©±ã§ãã è³æãããªãèãã®ã§è£è¶³ãã¾ãã
DBãªãã¡ã¯ã¿ãªã³ã°ã«ã¤ãã¦
26Pã¯ç¾ç¶ã§ãã
MySQLã£ã¦æ¸ãã¦ã¾ããæ¬çªã¯Aurora1ã使ã£ã¦ãã¾ãã
以éããã®DBã ç¾è¡DB
ã¨å¼ã³ã¾ãã
ããã§ã¯ãªãã«ã¬ã¨ã¿ããªã®å©æ´»ã¯Webãµã¼ãã¹åã§ãã
ã¤ã¾ã2ã¤ã®ãµã¼ãã¹ããç¾è¡DBãè¦ã¦ãã¾ãããæ©è½ã«ãã£ã¦ã¯ç¾è¡DBã®åããã¼ãã«ãåç
§ã»æ´æ°ã»åé¤ãªã©ãè¡ãã¾ãã
ãã®2ã¤ä»¥å¤ã«ã社å
ã·ã¹ãã ãªã©ã§ãã®ç¾è¡DBã¯å©ç¨ããã¦ãããã¡ã¤ã³ã®ãã¼ãã«ãå¤æ´ããã¨å½±é¿ç¯å²ãåºãç¶æ
ã§ãã
ãã®ãããªã¢ããªã¹ãªç¶æ
ã¯ä¸ã®ä¸ã§ã¯æªã®æ¨©åã®ããã«è¨ããã¾ããã¹ã¿ã¼ãã¢ãããåãæ¦ç¥ã¨ãã¦ã¯æªããªãã¨æã£ã¦ãã¾ãã
ãªããªãã°RDSã¯ä¼ç¤¾ã®éç¨ã§èããã¨æ¿å®ã§ããå人ã®æ¯æãã¨èããã¨å®ããªãããªãã«ã¬ããµã¼ãã¹éå§å½åã¯ç¤¾é·ã®ãã±ããããã¼ã§éç¨ããã¦ããããã§ãããã¤ã³ãã©ã³ã¹ããæãããã¨ã¯éè¦ãªèª²é¡ã§ããã
ããããªããæã¯çµã¡ããµã¼ãã¹ã大ãããªãã¨ãã®ç¶æ
ã¯æ°è»½ãªå¤æ´ã許ããªãç¶æ³ã«ãªãã¾ãã
ç¹ã«ä¸»è¦ãªãã¼ãã«ã¯å¤ãã®ãµã¼ãã¹ãåç
§ãã¦ããã®ã§ALTERãæµãã®ã¯è·äººè¸ã«ãªãã¾ããããã¹ã¿ç³»ã«é·æéãã¼ãã«ã®å
±æããã¯ãåããããªSELECTãæµãã¨ãµã¼ãã¹é害ã®å¼ã³æ°´ã«ãªãã¾ãã
ãªã®ã§ãã®ç¶æ
ããè±ãã¦ããããã«ç¾å¨é²ãã¦ããã®ãä¸è¨ã§ãã
å³å´ã«ããPostgreSQLã®ãã¼ã¸ã§ã³ã¯10ã§RDSã§éç¨ããã¦ãã¾ãã
ããã以é㯠æ°DB
ã¨å¼ã³ã¾ãã
ç¾è¡DBããæ°DBã®ãã¼ã¿ã¯ãªã¢ã«ã¿ã¤ã ã§è¡ã£ã¦ãã¾ãã
MySQLãªãã¬ããªã±ã¼ã·ã§ã³ã§ããã®ã§ããç°ç¨®DBãªã®ã§ããã¯AWS DMSãæ´»ç¨ãã¦ãã¾ãã
ä»ã«ãOracle GoldenGateã調ã¹ã¾ãããRDSã«ç§»ãã¨æ±ºããã®ã§AWS DMSãæ¡ç¨ãã¦ãã¾ãã
ç¾è¡DBããæ°DBã«ã¯åãã¹ãã¼ãæ§é ï¼ãã¼ãã«æ§é ï¼ã§ã³ãã¼ãã¾ãã
ãã®éã«æ°DBå´ã«INSERTã»UPDATEãªã©ã®Eventãããªã¬ã¼ã«æ´ã«èªåãã¡ã使ãããæ°ãã¼ãã«æ§é ã«ã³ãã¼ãã¦ãã¾ãã
ã¤ã¾ãæ°DBå´ã«ã¯ç¾è¡DBã«ããã¹ãã¼ãã¨ãªãã¡ã¯ã¿ãªã³ã°å¾ã®å½¢ã§ããæ°ã¹ãã¼ããããã¾ãã
WebAPIã¯ãã®æ°ã¹ãã¼ããåç
§ãã¾ãã
ãããWebAPIã¯æ°DBã«æ¸ãè¾¼ãã¨ç¾è¡DBãåç
§ãã¦ããã·ã¹ãã ã«å½±é¿ããããããç¾è¡DBã«æ¸ãè¾¼ã¿ãè¡ãã¾ãã
ããã¨DMSçµç±ã§ã³ãã¼ãããããªã¬ã¼çµç±ã§æ°DBã®æ°ã¹ãã¼ãã«åæ ãããã¨ããæµãã§ãã
ãããã£ã¦å°ããã¤æ¢åã®DBã¢ã¯ã»ã¹ãWebAPIã«å¯ãã¦ãããæçµçã«ã¯ãªãã¡ã¯ã¿ãªã³ã°ãããDBã«åãæ¿ãã¦ãããã¨ããã®ã主æ¨ã§ãã
ãã®ææ³ã®ã¡ãªããã»ãã¡ãªãã
ã¡ãªããã¯æ¬¡ã®ãããªç¹ã§ãã
- åæ¢æéã極å°åã§ãã
- æ¢åã®ä»çµã¿ãæ®ããã¾ã¾ãã¢ã°ã¬ãã·ãã«ãªãã¡ã¯ã¿ãªã³ã°
- ã«ããªã¢ãªãªã¼ã¹ã®ãããªæãå°ããã¤åãæãã¦ããã
- æ°è¦éçºãæ¢åã®ä»çµã¿ã«ä¸ããå½±é¿ãå°ãªã
- æ¢åããã®åãæãã¯ãªãã¸ããªãã¿ã¼ã³ãªã©ã使ãã°ãã«ã¼ã°ãªã¼ã³ãããã¤ã¡ã³ãã£ã½ãåç §å ãåãæ¿ããã ãã«åºæ¥ã
ãã®ããã«æ¬çªã®ä»çµã¿ã®å½±é¿ç¯å²ãå°ããåºæ¥ãã®ãã¡ãªããã§ãã ããããªãã大ããªãã¡ãªãããããã¾ãã
- ãã¼ã«ã«ã®éçºç°å¢ã§åç¾ã§ããªã
ä»ã¾ã§ã¯Vagrantã§VMãä¸ã¤ç«ã¡ä¸ããã ãã§æ¸ãã§ã - é¢ä¿ããã·ã¹ãã ãå¤ãã®ã§éçºç°å¢ãç¨æããæé ãå¤ã
AWSã«éçºç°å¢ãä½ãå ´åãæé ãå¤ãã1人ï¼ç°å¢ãç¨æããã®ãå¤§å¤ - DMSçµç±ã®ã³ãã¼ã«é 延ãçºçããæã®èæ ®ãé£ãã
- ãªãã¡ã¯ã¿ãªã³ã°ãçµããã¾ã§ãAWSã«ä¾åãã
ä¾ãã°DMSã®ä»æ§å¤æ´ã¨ãé£ããã¨æ»ã¬å¯è½æ§ããã
ç¹ã«éçºããã¼ã«ä¸ããå½±é¿ã¯ãã¡ããã¡ã大ããã§ãã ã§ãã®ã§DMSã«ä¾åããç¶æ ããã£ã¨ç¶ãããã¨ã¯é£ããã®ããããã¯ã¹ãã¼ãåè² ã ãªã¨æã£ã¦ãã¾ãã
ãªãPostgreSQLã«ç§»è¡ããã®ã
è²ããªçç±ãããã¾ãã決ãæã¯ãªãã¡ã¯ã¿ãªã³ã°ã®æã«æ¸ãããªã¬ã¼ã®æè»æ§ã¨ã¹ãã¢ãã§ãã
PostgreSQL㯠PL/pgsql
以å¤ã«ã PL/perl
ãå§ãã¨ãã代表çãªè¨èªã§æ¸ãä»çµã¿ãããã¾ãã
å½å㯠PL/Python
ã§æ¸ããã¨æã£ã¦ããã®ã§ããRDSããµãã¼ããã¦ããªãã£ãããã PL/v8(JavaScript)
ãæ¡ç¨ãã¦ãã¾ãã
ä»å¾
ã¾ã ã¾ã 移è¡éä¸ã§ãã®ã§ãè¾ãæããªã©ã¯ããããè²ã ã¨ããã¨æãã¾ãã ããã¯ããã§å®æçã«ã¢ã¦ãããããã¦ããããå®éã«æãåããã¦ãããã¼ã ã¡ã³ãã¼ãçã®å£°ãã¢ã¦ããããåºæ¥ãããã«å§ãã¦ããã®ã§ã楽ãã¿ã«
æå¾
ããããã¯ã¹ãã¼ãåè² ã ãªã¨æã£ã¦ãã¾ãã
ã¤ã¾ããªãã«ã¬ã¯ä»²éã大åéä¸ãªã®ããï¼ï¼
ç¾ç¶ã¯å¸¸æãªã¢ã¼ããæ¨å¥¨ã¯ãã¦ãªãã®ã§æ±äº¬ã岡山ã®æ¡ç¨ã«ãªãã¾ãã ãèå³ãããã°ãæ°è»½ã«ãé£çµ¡ãã ããï¼ï¼ ãé£çµ¡ããã ããã°ã«ã¸ã¥ã¢ã«ã©ã³ãããªã¢ã¼ãé¢æ¥ã調æ´ãã¾ãã ã給æã¨ãå ã¿é ããåºããéé¡ããå¿ããã¾ãããåºå¤æéãåãæ¹ãªã©æè»ãææ¡ã§ãã¾ãã
ããã§ã¯ãå¿åãå¾ ã¡ãã¦ããã¾ãã