å€ãã®ææ°ã®ã¢ããªã±ãŒã·ã§ã³ã¯ãäŒæ¥å šäœãå Žåã«ãã£ãŠã¯ã€ã³ã¿ãŒãããå šäœã§æ§ç¯ããå¿ èŠããããŸããåã¢ããªã±ãŒã·ã§ã³ã¯ãã¹ã±ãŒã©ããªãã£ãå¯çšæ§ãã»ãã¥ãªãã£ãä¿¡é Œæ§ãããã³åŸ©å åã®èŠä»¶ãæºããå¿ èŠããããŸãã
ãã®èšäºã§ã¯ãäžèšã®æ©èœãç°¡åã«å®çŸã§ããããã€ãã®èšèšãã¿ãŒã³ã玹ä»ããŸããåãã¿ãŒã³ãã¯ã©ãŠãã§ã®ãã®ãã¿ãŒã³ã®äœ¿çšæ¹æ³ã䜿çšããå Žåãšäœ¿çšããªãå Žåã«ã€ããŠèª¬æããŸãã
ãããã®ãã¿ãŒã³ã®ããã€ãã¯ããã»ã©æ°ãããã®ã§ã¯ãããŸããããä»æ¥ã®ã€ã³ã¿ãŒãããã¯ã©ãŠãã®äžçã§ã¯éåžžã«åœ¹ç«ã¡ãŸãã
ãã®èšäºã§èª¬æãããã¿ãŒã³ã®ãªã¹ãã¯æ¬¡ã®ãšããã§ãã
- ãµãŒããããã¬ãŒã«ãŒ
- ã³ãã³ããšã¯ãšãªã®è²¬ä»»ã®åé¢ïŒCQRSïŒ
- ã€ãã³ããœãŒã·ã³ã°
- ãµã€ãã«ãŒ
- ããã³ããšã³ãã®ããã¯ãšã³ã
- ã¹ãã©ã³ã°ã©ãŒ
ããã§ã¯å§ããŸãããã
1.ãµãŒããããã¬ãŒã«ãŒ
åæ£ã·ã¹ãã ã¯ãé害ã念é ã«çœ®ããŠèšèšããå¿ èŠããããŸããä»æ¥ãäžçã«ã¯ãã€ã¯ããµãŒãã¹ãããããããã®ãµãŒãã¹ã¯äž»ã«ä»ã®ãªã¢ãŒããµãŒãã¹ã«äŸåããŠããŸãããããã®ãªã¢ãŒããµãŒãã¹ã¯ããããã¯ãŒã¯ãã¢ããªã±ãŒã·ã§ã³ã®ããŠã³ããŒããªã©ã®ããŸããŸãªçç±ã§æéå ã«å¿çããªãå ŽåããããŸããã»ãšãã©ã®å Žåãåè©Šè¡ãå®è£ ããããšã§åé¡ã解決ã§ããã¯ãã§ãã
ãã ãããµãŒãã¹ã®å£åããµãŒãã¹èªäœã®å®å šãªé害ãªã©ã®æ·±å»ãªåé¡ãçºçããå ŽåããããŸãããã®ãããªå Žåãåè©Šè¡ãç¶ããã®ã¯æå³ããããŸããããã®å Žåãåè·¯ãã¬ãŒã«ãŒã¢ãã«ã圹ç«ã¡ãŸãã
äžã®å³ã¯ãåè·¯ãã¬ãŒã«ãŒåè·¯ã®å®è£ ã瀺ããŠããŸãããµãŒãã¹1ã¯ããµãŒãã¹2ã®åŒã³åºãã«åè©Šè¡ã§ã¯ãªãç¶ç¶çãªé害/ã¿ã€ã ã¢ãŠããããããšã«æ°ä»ããå ŽåããµãŒãã¹1ã¯ãµãŒãã¹2ãžã®åŒã³åºããåæããé害ãçºçããå Žåã«å¿çãè¿ããŸãã
以äžã®ãããªäººæ°ã®ãããªãŒãã³ãœãŒã¹ã®ã©ã€ãã©ãªããããŸãNetflixã®Hystrix
ãŸãã¯Reselience4Jéåžžã«ç°¡åã«ãã®ãã¿ãŒã³ãå®è£ ããããã«äœ¿çšããããšãã§ããŸãã
APIã²ãŒããŠã§ã€ãŸãã¯Envoyã® ãããªãããã·ã䜿çšããŠããå Žåãããã¯ãããã·ã¬ãã«èªäœã§å®çŸã§ããŸãã泚æïŒ
ãã§ãŒã³ãéããŠãããšãã«ååãªãã°ãšèŠåãå®è£ ããŠããã®éã«åä¿¡ããèŠæ±ã远跡ããéçšããŒã ããããèªèããŠããããšãéåžžã«éèŠã§ãã
ããŒããµãŒããããã¬ãŒã«ãŒãå®è£ ããŠãé害ã®ãããµãŒãã¹ã®é¡§å®¢ã«ãµãŒãã¹ãæäŸãç¶ããããšãã§ããŸãã
ãã®ãã¿ãŒã³ããã€äœ¿çšããã
- ãµãŒãã¹ãå¥ã®ãªã¢ãŒããµãŒãã¹ã«äŸåããŠããå Žåãããã³äžéšã®ã·ããªãªã§ã¯ã倱æããå¯èœæ§ããããŸãã
- ãµãŒãã¹ã«éåžžã«åŒ·ãäŸåé¢ä¿ãããå ŽåïŒãã¹ã¿ãŒããŒã¿ãµãŒãã¹ãªã©ïŒã
ãã®ãã¿ãŒã³ã䜿çšããªãå Žå
- ããŒã«ã«ã®äŸåé¢ä¿ãåŠçããå Žåãåè·¯ãã¬ãŒã«ãŒã«ãã£ãŠãªãŒããŒããããçºçããå¯èœæ§ããããŸãã
2. Command and Query Responsibility Segregation (CQRS) ( (CQRS))
CQRSã¯ãææ°ã®ããŒã¿ãŠã§ã¢ããŠã¹ã¢ããªã±ãŒã·ã§ã³ã«ãšã£ãŠéåžžã«äŸ¿å©ãªã¢ãã«ã§ããããã¯ãããŒã¿ã¹ãã¢å ã®èªã¿åãïŒã¯ãšãªïŒæäœãšæžã蟌ã¿/æŽæ°ïŒã³ãã³ãïŒæäœãåé¢ãããšããååã«åºã¥ããŠããŸãã
MySQL / PostgreSQLãªã©ã®ããŒã¿ããŒã¹ã«ããŒã¿ãä¿åããå¿ èŠãããã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããŠãããšããŸãããããåç¥ã®ãšãããã¹ãã¬ãŒãžã«ããŒã¿ãæžã蟌ãå Žåãæäœã¯æ€èšŒãã¢ããªã³ã°ãæ°žç¶åãªã©ã®ããã€ãã®æ®µéãçµãå¿ èŠããããããéåžžã®æžã蟌ã¿/æŽæ°æäœã¯åçŽãªèªã¿åãæäœãããæéãããããŸãã
åãããŒã¿ã¹ãã¢ã䜿çšããŠèªã¿åãæäœãšæžã蟌ã¿æäœãåæã«å€§èŠæš¡ã«å®è¡ãããšãããã©ãŒãã³ã¹ã®åé¡ãçºçããå¯èœæ§ããããŸãã
ãã®ãããªå ŽåãCQRSãã³ãã¬ãŒãã圹ç«ã¡ãŸãã CQRSãã¿ãŒã³ã¯ãèªã¿åãæäœãšæžã蟌ã¿æäœã«ç°ãªãããŒã¿ã¢ãã«ã䜿çšããããšãææ¡ããŠããŸããäžéšã®ããªãšãŒã·ã§ã³ã§ã¯ããããã®ã¢ãã«ã«åå¥ã®ããŒã¿ã¹ãã¢ã䜿çšããããšãææ¡ããŠããŸãã
泚ïŒæè¿ã®ã»ãšãã©ã®PaaSããŒã¿ããŒã¹ã« ã¯ãããŒã¿ã¹ãã¢ã®èªã¿åãå¯èœãªã¬ããªã«ïŒGoogle Cloud SQLãAzure SQL DBãAmazon RDS
ãªã©ïŒãäœæããæ©èœããããããŒã¿ã®è€è£œãã¯ããã«ç°¡åã«å®çŸã§ããŸãã
ããŒã«ã«ããŒã¿ããŒã¹ãæ±ã£ãŠããå Žåãå€ãã®ãšã³ã¿ãŒãã©ã€ãºããŒã¿ããŒã¹ããã®æ©èœãæäŸããŸãã
泚ïŒæè¿ã®äžéšã®äººã ã¯ãMongoDBãElasticsearchãªã©ã®é«éã§ããã©ãŒãã³ã¹ã®é«ãNoSQLããŒã¿ããŒã¹ãšããŠèªã¿åãå¯èœãªã¬ããªã«ãå®è£ ããããšã奜ã¿ãŸãã
ãã®ãã¿ãŒã³ããã€äœ¿çšããã
- 倧éã®èªã¿åããšæžã蟌ã¿ãäºæ³ãããã¢ããªã±ãŒã·ã§ã³ã®ã¹ã±ãŒãªã³ã°ãæ€èšããŠããå Žå
- èªã¿åãæäœãšæžã蟌ã¿æäœãå¥ã ã«èšå®ããå Žåã
- èªã¿åããå®éã«è¿ãããæçµçã«ã¯é 次ã§ããå Žåã
ãã®ãã¿ãŒã³ã䜿çšããªãå Žå
- äžåºŠã«å€§éã®èªã¿åããšæžã蟌ã¿ãæåŸ ããªãéåžžã®CRUDã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããŠããå Žåã
3.ã€ãã³ããœãŒã·ã³ã°
ã€ãã³ããœãŒã¹ã¯ãäžé£ã®ãã¡ã€ã³ã€ãã³ãããã°ãšããŠä¿åãããéçŽããããã°ãã¥ãŒãã¢ããªã±ãŒã·ã§ã³ã®çŸåšã®ç¶æ ã瀺ãèå³æ·±ãèšèšãã¿ãŒã³ã§ãã
ãã®ãã¿ãŒã³ã¯ãããŒã¿ã¹ãã¬ãŒãžã®ããã¯ãè¡ãäœè£ããªããç£æ»ãšã€ãã³ãå±¥æŽãç¶æããå¿ èŠãããã·ã¹ãã ïŒããã«ãäŒè°ã座åžãªã©ã®ã¢ããªã±ãŒã·ã§ã³ãªã©ïŒã§äžè¬çã«äœ¿çšãããŸãã
ãŠãŒã¶ãŒãäºçŽãŸãã¯äºçŽããã£ã³ã»ã«ããããšãæåŸ ãããããã«ã®éšå±ã®äºçŽã·ã¹ãã ãèããŸããããã§ã¯ãäºçŽãšãã£ã³ã»ã«ãäžé£ã®ã€ãã³ããšããŠä¿åããå¿ èŠããããŸããå©çšå¯èœãªéšå±ã¯ãã€ãã³ããã°ã確èªããããšã«ãããåäºçŽã®åã«èŠçŽã§è¡šç€ºãããŸãã
泚æïŒã»ãšãã©ã®ã¯ã©ãŠããµãŒãã¹ãããã€ããŒã¯ãGoogle Pub / SubãAzure Service BusãAWS SQSãªã©ã®ã¡ãã»ãŒãžã³ã°ãµãŒãã¹ããµããŒãããŠããŸãããããã®ãµãŒãã¹ã匷åãªäžè²«æ§ã®ããããŒã¿ã¹ãã¢ãšçµã¿åãããŠããã®ã¹ããŒã ãå®è£ ã§ããŸãã
ãã®ãã¿ãŒã³ã䜿çšããå Žå
- éåžžã®CRUDæäœãèŠä»¶ãæºããã®ã«ååã§ãªãå Žå
- éåžžããã¹ãé»è»ãäŒè°ãæ ç»é€šãªã©ã®åº§åžäºçŽã·ã¹ãã ã«é©ããŠããŸãã-ãŸãã¯ã«ãŒããã©ã³ã¶ã¯ã·ã§ã³ãæ¯æããªã©ã®ã¢ã¯ãã£ããã£ã§æ§æãããeã³ããŒã¹ã·ã¹ãã ã®å Žåã
- ã¢ããªã±ãŒã·ã§ã³ã®çŸåšããã³éå»ã®ç¶æ ãäœæããããã«ã匷åãªç£æ»ãšã€ãã³ãã®åçãå¿ èŠãªå Žåã
ãã®ãã¿ãŒã³ã䜿çšããªãå Žå
- éåžžã®CRUDæäœã§ãŠãŒã¶ãŒã®ããŒãºãæºããã®ã«ååãªå Žåã
4.ãµã€ãã«ãŒïŒãµã€ãã«ãŒãã¶ã€ã³ãã¿ãŒã³ïŒ
ãµã€ãã«ãŒãã¿ãŒã³ã¯ããã€ã¯ããµãŒãã¹ã®åºçŸã§äººæ°ãåããŸããããã®ã¹ããŒã ã§ã¯ãã¢ããªã±ãŒã·ã§ã³ã³ã³ããŒãã³ãã¯å¥ã®ããã»ã¹ãŸãã¯ã³ã³ããã«ãããã€ãããŸããããã¯ãæœè±¡åãšã«ãã»ã«åãå®çŸããã®ã«åœ¹ç«ã¡ãŸãã
Envoy Proxyã¯ãæã人æ°ã®ãããµã€ãã«ãŒãããã·ãµãŒããŒã®1ã€ã§ãããåºã䜿çšãããŠããŸãããµã€ããã·ã³ã䜿çšããŠããããã¯ãŒãã³ã°ãå¯èŠ³æž¬æ§ãã»ãã¥ãªãã£ãªã©ã®äžè¬çãªæ©èœãåé¢ããããšã«ãããã¢ããªã±ãŒã·ã§ã³ã®äž»ãªæ©èœãåé¢ããã®ã«åœ¹ç«ã¡ãŸãã
ãã®ã¿ã€ãã®ãµã€ãã«ãŒã¯ãæœè±¡çãªL4 / L7ã¿ã€ãã®éä¿¡ã«åœ¹ç«ã¡ãŸããEnvoy Proxiesãªã©ã®ãµã€ãã«ãŒã¯ãçžäºTLSãå®è£ ããããšã§ãããé«ãã»ãã¥ãªãã£ãå®çŸããã®ã«ã圹ç«ã¡ãŸãã
ããããµãŒãã¹ã°ãªãããšçµã¿åãããŠäœ¿çšââãããšãç°ãªããã€ã¯ããµãŒãã¹éã®æ¥ç¶æ§ãšã»ãã¥ãªãã£ãåäžãããããšãã§ããŸããããã«ã€ããŠã¯ãååã®èšäºã§è©³ããèªãããšãã§ããŸãã
ãã®ãã¿ãŒã³ããã€äœ¿çšããã
- 補åããŒããã©ãªãªã§å€æ°ã®ç°çš®ãã€ã¯ããµãŒãã¹ãæ±ã£ãŠããå Žåã
- æ°ããæ代ã®çžäºéçšæ§ãšã»ãã¥ãªãã£ã®èª²é¡ãåŠçã§ããªãåŸåãããã¬ã¬ã·ãŒã¢ããªã±ãŒã·ã§ã³ãæ±ãå Žåã
ãã®ãã¿ãŒã³ã䜿çšããªãå Žå
- çžäºã«éä¿¡ããå¿ èŠã®ããéãããæ°ã®ãµãŒãã¹ãæ±ã£ãŠããå Žåã
- ãµã€ããã€ãŒã«ãã§ã¢ã®å±éãäžçµæžãŸãã¯æäœã«äžäŸ¿ã§ããå¯èœæ§ãããå°ããªã¢ããªã±ãŒã·ã§ã³
5.ããã¯ãšã³ããã©ãŒããã³ãïŒBFFïŒ
éåžžã®è£œåéçºãµã€ã¯ã«ã§ã¯ãããã¯ãšã³ããšã³ãžãã¢ãããŒã¿ãŠã§ã¢ããŠã¹ãšå¯Ÿè©±ãããµãŒãã¹ã®äœæãæ åœããããã³ããšã³ããšã³ãžãã¢ããŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ã®äœæãæ åœããŸããæè¿ã®ã¢ããªã¯ãã¢ãã€ã«ãšãã¹ã¯ãããã®äž¡æ¹ã念é ã«çœ®ããŠæ§ç¯ããå¿ èŠããããŸãã
ã¢ãã€ã«ããã€ã¹ãšãã¹ã¯ãããããã€ã¹ã®ã®ã£ããã¯ããŒããŠã§ã¢ã®èŠ³ç¹ããè¿ã¥ããŠããŸãããæ¥ç¶ãšäœ¿çšã¯ã¢ãã€ã«ããã€ã¹ã«ãšã£ãŠäŸç¶ãšããŠèª²é¡ã§ãã
ãã®ãããªã·ããªãªã§ã¯ãBFFãã³ãã¬ãŒããéåžžã«äŸ¿å©ã«ãªããŸããããã§ã¯ãç¹å®ã®ããã³ããšã³ãã®å éšãµãŒãã¹ãæ§ç¯/æ§æããå¿ èŠããããŸãã
ã¢ãã€ã«ã¯ã©ã€ã¢ã³ãã®ããã©ãŒãã³ã¹ãæé©åããããã«ã軜éã§ããŒãžåå²ãããå¿çã§å¿çããå¥åã®ããã¯ãšã³ããµãŒãã¹ãæ§ç¯ããããšããå§ãããŸãã
ãã®ãã¿ãŒã³ã䜿çšããŠããŸããŸãªãµãŒãã¹ãéçŽããããã¯ãšã³ããšããã³ããšã³ãéã®ããŒã¿éä¿¡ãæžããããšãã§ããŸãã
泚ïŒæè¿ãAPIã²ãŒããŠã§ã€ã䜿çšããŠããå ŽåãBFFãã¿ãŒã³ã¯ã²ãŒããŠã§ã€èªäœã«ç°¡åã«å®è£ ã§ããåå¥ã®ãµãŒãã¹ãæäŸããå¿ èŠã¯ãããŸããã
ãã®ãã¿ãŒã³ããã€äœ¿çšããã
- ãã¹ã¯ããããã¢ãã€ã«ã¯ã©ã€ã¢ã³ããªã©ãããŸããŸãªã¯ã©ã€ã¢ã³ãã«è£œå/ãµãŒãã¹ãæäŸãããå Žåã
- ç¹å®ã®ã¿ã€ãã®é¡§å®¢åãã«å¿çãæé©åãããå Žåã
- ã¢ãã€ã«ã¯ã©ã€ã¢ã³ããšããŸããŸãªãµãŒãã¹éã®ãã£ãããæžããããå Žåã
- , .
- , .
6. Strangler ( )
ã¢ããªã±ãŒã·ã§ã³ã®ææ°åã«åãã£ãŠããçµç¹ã§åããŠããå Žåã¯ãStranglerãã¶ã€ã³ãã¿ãŒã³ãå¿ é ã§ããStranglerãã¿ãŒã³ã¯ãã¬ã¬ã·ãŒã¢ããªã±ãŒã·ã§ã³ãšæ°ããã¢ããªã±ãŒã·ã§ã³ã®äžã«ãã¡ãµãŒããªãŒããŒã¬ã€ãæ§ç¯ããããšãæå±ããæ¶è²»è ãç©äºã客芳çã«èŠãããšãã§ããããã«ããŸãã
ãã®ãã¿ãŒã³ã¯ãã¢ããªã±ãŒã·ã§ã³ã®å€ãéšåãšæ°ããéšåã®éã®ç§»è¡ã¢ã¯ãã£ããã£ããã¯ã©ã€ã¢ã³ããåé¢ããŸãã
泚ïŒäžè¬çãªITçµç¹ã§ã¯ãããERPã·ã¹ãã ããå¥ã®ERPã·ã¹ãã ã«ç§»è¡ããå Žåããã®ã¿ã€ãã®ã¹ããŒãã¯éåžžã«åœ¹ç«ã¡ãŸããã²ãŒããŠã§ã€APIã䜿çšããŠããå Žåã¯ããããã·ã²ãŒããŠã§ã€èªäœã«ãããå®è£ ããæ¹ãç°¡åã§ãã
移è¡ã®æåŸã«ã¢ãã€ã³ïŒãã¡ãµãŒãïŒãä¿æããããåé€ãããã決å®ããå¿ èŠããããŸãã
ãã®ãã¿ãŒã³ããã€äœ¿çšããã
- ERP移è¡ãªã©ãè€éã§äŸå床ã®é«ãã¢ããªã±ãŒã·ã§ã³ã移è¡ãŸãã¯ã¢ããã°ã¬ãŒãããå Žå
ãã®ãã¿ãŒã³ã䜿çšããªãå Žå
- 移è¡ãç°¡åã§ãçŽæ¥äº€æããã®ãæåã®ãªãã·ã§ã³ã§ããå Žåã