ããã«ã¡ã¯ï¼SRE2課 å
¥åã§ãã
ä»åã¯EventBridgeã使ã£ã¦S3ãã±ããã«æå®ããæ°ã®ãã¡ã¤ã«ãã¢ãããã¼ãããããã
Glueã¯ã¼ã¯ããã¼ãèµ·åããã¦ããã®ä¸ã§æå®ããGlueã¸ã§ããå®è¡ããè¨å®ã試ãã¦ã¿ã¾ããã
æ§æ
åæ
- Glueã¯ã¼ã¯ããã¼ã§å®è¡ããGlueã¯ãã¼ã©ã¾ãã¯Glueã¸ã§ããä½æããã¦ãããã¨
è¨å®
Glueã¯ã¼ã¯ããã¼ã®ä½æ
å¾ç¨EventBridgeã®ã«ã¼ã«ä½ææã«ã¿ã¼ã²ãããæå®ããçºã
ã¾ãã¯Glueã®ããã¸ã¡ã³ãã³ã³ã½ã¼ã«ç»é¢ã«é·ç§»ãããã¯ã¼ã¯ããã¼ã®ä½æããã¯ãªãã¯ãã¾ãã
ä»»æã®ã¯ã¼ã¯ããã¼åãå ¥åãããã¯ã¼ã¯ããã¼ã®è¿½å ããã¯ãªãã¯ãã¾ãã
Glueã¯ã¼ã¯ããã¼ãä½æã§ãã¾ããã
S3ãã±ããã®ä½æ
S3ã®ããã¸ã¡ã³ãã³ã³ã½ã¼ã«ç»é¢ã«é·ç§»ãããã±ãããä½æãã¾ãã
ï¼æ¢ã«ä½ææ¸ã¿ã®å ´åã¯ã¹ãããã¨ãã¦ãã ããï¼
S3ã¤ãã³ãéç¥æå¹å
ä½æããS3ãã±ãããé¸æãããããããã£ãã¿ããã
ãAmazon EventBridgeãã¨ããé
ç®ã®ãç·¨éããã¯ãªãã¯ãã¾ãã
ããªã³ããé¸æãã¦ããå¤æ´ã®ä¿åããã¯ãªãã¯ãã¾ãã
è¨å®ããªã³ã«ãããã¨ã§ãã®S3ãã±ããã®ã¤ãã³ããEventBridgeã«é£æºãããããã«ãªãã¾ãã
EventBridgeã«ã¼ã«ã®ä½æ
EventBridgeã®ããã¸ã¡ã³ãã³ã³ã½ã¼ã«ç»é¢ã«é·ç§»ãããã«ã¼ã«ãä½æããã¯ãªãã¯ãã¾ãã
EventBridgeã«ã¼ã«ã®ãååããå ¥åãã¦ãã次ã¸ããã¯ãªãã¯ãã¾ãã
ã¤ãã³ããã¿ã¼ã³ã®ç»é¢ã§ä»¥ä¸ã®ããã«è¨å®ããã次ã¸ããã¯ãªãã¯ãã¾ãã
â»ãã±ããåã¯ãèªèº«ã®AWSã¢ã«ã¦ã³ãã§ä½æãããã±ããåãæå®ãã¦ãã ãã
ã¿ã¼ã²ãããæåã«ä½æããGlueã¯ã¼ã¯ããã¼ãæå®ããã次ã¸ããã¯ãªãã¯ãã¾ãã
è¨å®å 容ã確èªãã¦åé¡ãªããã°ãã«ã¼ã«ã®ä½æããã¯ãªãã¯ãã¾ãã
ã¡ãªã¿ã«ãã®æã«ä½æãããIAMãã¼ã«ã«ã¯ä»¥ä¸æ¨©éãä»ä¸ããã¦ãã¾ãã
- glue:notifyEvent
Glueã¯ã¼ã¯ããã¼ã®è¨å®
ä½æããGlueã¯ã¼ã¯ããã¼ãé¸æãããããªã¬ã¼ã追å ããã¯ãªãã¯ãã¾ãã
ããããããã§ä»åããããã£ãããS3ãã±ããã«æå®ã®ãã¡ã¤ã«æ°ãã¢ãããã¼ããããããã¨ããããªã¬ã¼è¨å®ã¨ãªãã¾ãã
è¨å®ã¯ãã¡ã¤ã«æ°ã®æå®ã ãã§ãªãæå®ç§æ°å¾
æ©ããè¨å®ãå¯è½ã§ãã©ã¡ããã®æ¡ä»¶ãæã£ããGlueã¯ã¼ã¯ããã¼ãå®è¡ã¨ããå½¢ã«ãªãã¾ãã
- Number of events
- ã¤ãã³ããæå®ã®æ°çºçãããGlueã¯ã¼ã¯ããã¼å®è¡
- 1~100ã®å¤ãæå®å¯è½
- Time delay in secondsï¼ãªãã·ã§ã³ï¼
- ã¤ãã³ãçºçå¾ãæå®ã®ç§æ°å¾ æ©ãã¦ããGlueã¯ã¼ã¯ããã¼å®è¡
- 1ï½900ã®å¤ãæå®å¯è½ï¼ããã©ã«ã 900ï¼
ä»»æã®ããªã¬ã¼åãå
¥åããNumber of eventsã¯ä»åã2ãã¨ãããã¨ã§
EventBridgeã®ã¤ãã³ãã2åçºçï¼ã¤ã¾ãS3ãã±ããã«2ãã¡ã¤ã«ã¢ãããã¼ãï¼ããããGlueã¯ã¼ã¯ããã¼ãå®è¡ã¨ãªãã¾ãã
ãããã¯ãä»åTime delay in secondsã¯æå®ããªãã§ãããããã©ã«ãã§900ç§ã®çºã1ãã¡ã¤ã«ç®ãæ¥ã¦ãã900ç§çµéããã2ãã¡ã¤ã«ç®ãå°éããªãã¦ãGlueã¯ã¼ã¯ããã¼ãå®è¡ããã¾ãã
ããªã¬ã¼ã追å ãããããããã¼ãããé¸æãã¦ä½ææ¸ã¿ã®ä»»æã®ã¯ãã¼ã©ã¾ãã¯Glueã¸ã§ããæå®ãã¦ãã ããã
ä»åã¯åç´ã«csvãã¡ã¤ã«ãparquetå½¢å¼ã«å¤æããGlueã¸ã§ããæå®ãã¾ãã
Glueããªã¬ã¼ã®ç¢ºèª
追å ããããªã¬ã¼ãé¸æãã¦ã¿ãã¨ãå³å´ã«Batch sizeã2ãBatch windowã900ã¨è¡¨ç¤ºããã¦ãããã¨ããããã¾ãã
Number of eventsã§æå®ããå¤ï¼Batch sizeãTime delay in secondsã§æå®ããå¤=Batch windowã¨ãªãã¾ãã
åä½ç¢ºèª
S3ãã±ããã«ãã¡ã¤ã«ã1ã¤ãã¤ã¢ãããã¼ããã¦ã¿ã¾ãã
1ãã¡ã¤ã«ç®ãã¢ãããã¼ããã¦ãGlueã¯ã¼ã¯ããã¼ãå®è¡ããã¾ããã§ãããã
2ãã¡ã¤ã«ç®ãã¢ãããã¼ãå¾ãããã«Glueã¯ã¼ã¯ããã¼ãå®è¡ããã¾ããã
Glueã¯ã¼ã¯ããã¼å
ã§æå®ããGlueã¸ã§ããå®è¡ããã
S3ãã±ããã®æå®ã®ãã©ã«ãã«parquetå½¢å¼ã«å¤æããã¦ãã¡ã¤ã«ãä¿åããã¦ãããã¨ã確èªã§ãã¾ãã
ã¾ã¨ã
é常ã«ç°¡åã«ããæå®ãããã¡ã¤ã«æ°ãå°çãããGlueã¸ã§ããå®è¡ãã¨ããæ§æãå®ç¾ã§ãã¾ããã
ãããããæè»ãªå¶å¾¡ãä»AWSãµã¼ãã¹ã¨é£æºãããããã¨ããã®ãããã°Glueã¯ã¼ã¯ããã¼ã§ã¯ãªãStepFunctionsã使ã£ãæ¹ãè¯ãã§ããã
ãã®ãããªè¤éãªè¦ä»¶ãç¡ããã°Glueã¯ã¼ã¯ããã¼ã§ç°¡åã«æ§ç¯ã§ããããããªãããããã§ãï¼
ã¾ããç¹å®ã®ãã¡ã¤ã«åã§å§ã¾ããã¡ã¤ã«ãå°éããå ´åã«ã¤ãã³ãæ¤ç¥ã¨ãã¦ãã¡ã¤ã«æ°ã¨ãã¦ã«ã¦ã³ããããã¨ãã£ãå ´åãªã©ã¯
EventBridgeã«ã¼ã«ã®ã¤ãã³ããã¿ã¼ã³ãã«ã¹ã¿ãã¤ãºãããã¨ã§ããç¨åº¦æè»ã«æå®ãããã¨ãå¯è½ã§ãã®ã§ããã²ã試ããã ããã
ããã§ã¯ã¾ããä¼ããã¾ãããï¼
å ¥å ç¿å¾(å·çè¨äºã®ä¸è¦§)
ã¯ã©ã¦ãã¤ã³ãã°ã¬ã¼ã·ã§ã³é¨ãSRE2課