ããã«ã¡ã¯ãCacoo ãã¼ã ã®æ¨æï¼@cohheiï¼ã§ããCacoo ãã¼ã ã§ã¯ã Kubernetes ã«ããã¢ã¼ããã¯ãã£ã® microservices åã«åãçµãã§ãã¾ããä»åã¯ç§ãã¡ Cacoo ãã¼ã ã microservices åã«ãã£ã¦è§£æ±ºãããã¨ãã¦ãã課é¡ã¨åãçµã¿ã®å 容ããã®ææã«ã¤ãã¦ãç´¹ä»ãã¾ãã
ãã®è¨äºã§ã¯ä»¥ä¸ã®å 容ãå«ã¿ã¾ãã
- Cacoo ã®éçºãã¼ã ãã©ããªèª²é¡ãæ±ãã¦ããã
- ä½æ microservices ã®éãé¸ãã ã
- ã©ããªæè¡ãé¸ãã ã
- microservices åãã¦ã©ãã ã£ãã
- ç¾ç¶ã®èª²é¡
ç®æ¬¡
課é¡ï¼å¤ããã¬ã¼ã ã¯ã¼ã¯ã¨ã¢ããªã·ãã¯ãªã¢ããªã±ã¼ã·ã§ã³
Cacoo ã¯2009å¹´ã«ãã¼ã¿çããªãªã¼ã¹ãããæ´å²ã®ãããããã¯ãã§ãã¢ããªã·ãã¯ãªã¢ããªã±ã¼ã·ã§ã³ä¸ã§ãã¹ã¦ã®æ©è½ãå®è¡ããã¦ãã¾ããã
ãã®ãããããããã®ã³ã¼ãã®ä¾åé¢ä¿ãååã«ç解ããä¸ã§éçºãè¡ãå¿ è¦ãããã¾ãããã¾ããã¬ã¼ã ã¯ã¼ã¯ãã©ã¤ãã©ãªã®å¤æ´ã«ããå½±é¿ç¯å²ã大ãããç°¡åã«å ¥ãæ¿ãããã¨ãé£ããç¶æ ã§ãããä»ã«ãé·ããã«ãæéãéçºã¹ãã¼ãã«å½±é¿ãããªã©ã®åé¡ãçºçãã¦ãã¾ããã
ã¡ã³ããã³ã¹ãçµäºãããã¬ã¼ã ã¯ã¼ã¯ãã©ã¤ãã©ãª
Cacoo ã§ã¯Â Seasar2 ã¨ãã Web ãã¬ã¼ã ã¯ã¼ã¯ã使ã£ã¦ããã®ã§ããããã§ã«éçºãçµäºãã¦ãããã®ã§ããã
ã§ããéãæ©ãå¥ã®ãã¬ã¼ã ã¯ã¼ã¯ã«ç§»è¡ãããã®ã§ãããã¢ããªã·ãã¯ãªã¢ããªã±ã¼ã·ã§ã³ã®ãã¬ã¼ã ã¯ã¼ã¯ãå ¥ãæ¿ããã«ã¯ãã»ã¨ãã©ãã¹ã¦ã®ã³ã¼ããå¤æ´ããå¿ è¦ãããã¾ãã
ã¾ãããã¬ã¼ã ã¯ã¼ã¯ã®ããã¥ã¡ã³ããã»ã¼æ¥æ¬èªã¨ããåé¡ãããã¾ããã Cacoo ã®éçºãã¼ã ã¯ç¦å²¡æ¬ç¤¾ã ãã§ãªããã¥ã¼ã¨ã¼ã¯ã«ãã¡ã³ãã¼ãå¨ç±ãã¦ãã¾ããæ©æ¢°ç¿»è¨³ãªã©ã§å¯¾å¿ãããã¨ãå¯è½ã ã£ãããã§ãããæ¥æ¬èªã®ããã¥ã¡ã³ãã¯ãã¥ã¼ã¨ã¼ã¯ã®ã¡ã³ãã¼ã«ã¨ã£ã¦å¤§ããªè² æ ã¨ãªã£ã¦ãã¾ããã
ã¢ããªã·ãã¯ãªã¢ããªã±ã¼ã·ã§ã³
ã¢ããªã±ã¼ã·ã§ã³ã¯å¤æ°ã®æ©è½ãæã¡ãããã«ã¯å¼·ãä¾åé¢ä¿ãããã¾ãããWeb ãµã¤ã㨠Cacoo ã¢ããªã±ã¼ã·ã§ã³ããã®æããä¾ã§ãã
ããã§è¨ã Web ãµã¤ãã¨ã¯ Cacoo ã®éç㪠Web ãã¼ã¸ç¾¤ã§ããä¾ãã°Â https://cacoo.com/features ãªã©ãããã§ãã
ä¸æ¹ã§ Cacoo ã¢ããªã±ã¼ã·ã§ã³ã¨ã¯å®éã«å³ãç·¨éãã Cacoo ã® Web ã¢ããªã±ã¼ã·ã§ã³ã§ããWeb ãµã¤ããã¢ããªã±ã¼ã·ã§ã³ã«ä¾åãã¦ãã¾ããããã®ããããµã¤ããæ´æ°ããããã«ã¯ã¢ããªã±ã¼ã·ã§ã³ããã«ããã¦ãããã¤ããå¿ è¦ãããã¾ããã
ã¾ããæ°ããæè¡ãã¨ãããããã¨ãé£ããã¨ããåé¡ãããã¾ããã©ã¤ãã©ãªã®å¤æ´ãå ¨ä½ã«å½±é¿ãããããæ°è»½ã«å¤æ´ãã¥ãããªãã¾ããéçºè ãèªåã®å¾æãªè¨èªããã¬ã¼ã ã¯ã¼ã¯ãã©ã¤ãã©ãªãç¬èªã«é¸æãããã¨ã¯åºæ¬çã«ã§ãã¾ããã§ããã
ã³ã¼ãã大ããããããã«ãããã¹ãããããã¤ã«æéãããã£ã¦ãã¾ããã
ã¾ããç°ãªãæ ç¹ã®ã¡ã³ãã¼ãã²ã¨ã¤ã®ãªãã¸ããªã«å¯¾ãã¦å¤æ´ãå ãããããã³ãã¥ãã±ã¼ã·ã§ã³ã³ã¹ãã次第ã«å¤§ãããªãã¾ããæ°ããã¡ã³ãã¼ããã£ããã¢ããããã®ã«ãæéããããã¾ãããããã®åé¡ã¯éçºã¹ãã¼ãã«æªãå½±é¿ãä¸ãã¦ãã¾ããã
microservices ã®ã¡ãªãã
ããã§ã microservices åããéãé¸ã³ã¾ãããä¸è¬çã«ã microservices ã«ã¯ä»¥ä¸ã®ãããªã¡ãªãããããã¨èãã¦ãã¾ãã
- ãµã¼ãã¹ãã¨ã«æè¡ãé¸æã§ãã
- é¨åçãªå¤æ´ã容æã«ãªã
- (ãã¾ãè¨è¨ã§ããã°)ãµã¼ãã¼ãªã½ã¼ã¹ãæé©åã§ãã
- (ãã¾ãè¨è¨ã§ããã°)å ç¢ãªã·ã¹ãã ã«ãªã
ãµã¼ãã¹ãã¨ã«æè¡ãé¸æã§ãã
ãµã¼ãã¹ãã¨ã«ç¬ç«ããã¢ããªã±ã¼ã·ã§ã³ã¨ãªããããä»æ§ããæºããã¦ããã°ã©ããªè¨èªããã¬ã¼ã ã¯ã¼ã¯ãä»æ§ãã¦ãã¦ãåé¡ããã¾ãããååã¨ãã¦éçºè ãèªå¾çã«æè¡ãé¸æãããã¨ãã§ãã¾ãã
é¨åçãªå¤æ´ã容æã«ãªã
ã¤ã³ã¿ã¼ãã§ã¼ã¹ããæºããã¦ããã°å é¨ã®ãã¸ãã¯ãå¤æ´ãã¦ããæ®ã©ã®å ´ååé¡ããã¾ãããç°ãªãæ ç¹éã§éçºãé²ããå ´åããã®ã¡ãªããã¯å¤§ãããªãã¾ããã³ã¼ãã®å¤æ´ãä¸ããå½±é¿ãéå®çãªãããäºåã«å½±é¿ç¯å²ã確èªããã³ã¹ããå°ãããªãã¾ãã
ãµã¼ãã¼ãªã½ã¼ã¹ãæé©åã§ãã
ãã¾ããµã¼ãã¹ãåå²ãããã¨ãã§ããã°ãã²ã¨ã¤ã®ã¤ã³ã¹ã¿ã³ã¹ã§ãã¹ã¦ãåãã¦ããå ´åã¨æ¯ã¹ã¦ãµã¼ãã¼ãªã½ã¼ã¹ãæé©åãããã¨ãã§ãã¾ãã
ä¾ãã°ãããã¿ã¹ã¯ã®ãã¥ã¼ãæºã¾ã£ã¦ãµã¼ãã¼ãªã½ã¼ã¹ãæ®æ®µããå¤ã使ç¨ãã¦ããã¨ãã¾ããåä¸ã®ã¤ã³ã¹ã¿ã³ã¹ã®å ´åã¯ãã®ã¤ã³ã¹ã¿ã³ã¹ãã¾ããã¨ã¹ã±ã¼ã«ãããå¿ è¦ãããã¾ãã
ä¸æ¹ã§ãã®ã¿ã¹ã¯ã®ã¯ã¼ã«ã¼ãå¥ã®ãµã¼ãã¹ã¨ãã¦åå²ãã¦ããã°ãè² è·ã®é«ãã¯ã¼ã«ã¼ã®å¦çã ããã¹ã±ã¼ã«ããããã¨ãå¯è½ã§ãã
å ç¢ãªã·ã¹ãã ã«ãªã
å ç¨ã®ã¯ã¼ã«ã¼ã®ä¾ã§ãã¯ã¼ã«ã¼ãæããããªãã»ã©ã¿ã¹ã¯ãããã¨ãã¾ãã
åä¸ã®ã¤ã³ã¹ã¿ã³ã¹ã§ãã¹ã¦ãåä½ãã¦ããå ´åãã¯ã¼ã«ã¼ããªã½ã¼ã¹ãé£ãã¤ã¶ãã¦ãã¾ãããã¹ã¦ã®ã¢ããªã±ã¼ã·ã§ã³ãã¤ã³ã¹ã¿ã³ã¹ãã¨è½ã¡ã¦ãã¾ãæããããã¾ãã
ãµã¼ãã¹ããã¾ãåå²ã§ããã°ãã²ã¨ã¤ã®ã¯ã¼ã«ã¼ãè½ã¡ã¦ãå½±é¿ç¯å²ãéå®ããã·ã¹ãã å ¨ä½ãè½ã¡ãã¨ããææªã®äºæ ã¸ã®ãªã¹ã¯ã軽æ¸ããããã¾ãã
ç®æ¨ï¼å¤æ´ã容æã«
ã¢ã¼ããã¯ãã£ã¼ã®å¤æ´ã«ãããç®æ¨ã¯å¤ããã¬ã¼ã ã¯ã¼ã¯ãã©ã¤ãã©ãªã¸ã®ä¾åããªãããã¢ããªã±ã¼ã·ã§ã³ã microservices ã«åå²ãããã¨ã§ãããããããã¨ã§é¨åçãªå¤æ´ã容æã«ããéçºå¹çãåä¸ããããããã§ãã
- å¤ããã¬ã¼ã ã¯ã¼ã¯ãã©ã¤ãã©ãªã¸ã®ä¾åããªãã
- microservices åãé²ãã
- è¤æ°ã®ãµã¼ãã¹ã¨DBã«åå²
- ããã¯ã¨ã³ãã ãã§ãªãããã³ãã¨ã³ããåå²
- ããããã®ãµã¼ãã¹ãç°ãªãæè¡ãé¸æã§ããç¶æ
æ¹éã»åå
microservices åãé²ããä¸ã§ã以ä¸ã®ãã¨ãæ¹éã¨ãã¦éçºãé²ãã¦ãã¾ãã
- æ確ãªãªã¼ãã¼ã·ãã
- å°ããã»ã©è¯ã
- ã¹ã¯ã©ããããæ¸ããªããã¦ã¿ã
- ãµã¼ãã¹éã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã¯å¼·ãåä»ã
- éçºç°å¢ã¯ãµã¼ãã¹ãã¨ã«èªç±ã«é¸æ
- ãã¹ããã©ã¯ãã£ã¹ã«å¾ã
æ確ãªãªã¼ãã¼ã·ãã
ã©ã®ãµã¼ãã¹ã誰ã責任ãæã£ã¦éçºããããæ確ã«ãã¦ãã¾ãã
å°ããã»ã©è¯ã
å°ããä½ããã¨ã§æ°ããã¡ã³ãã¼ããã£ããã¢ãããããããã¾ãã
ã¹ã¯ã©ããããæ¸ããªããã¦ã¿ã
ããé©ããæè¡ãèªåã®å¾æãªæè¡ã使ã£ã¦ããè¯ããã®ãã¤ããããã«ãæ¢åã®ã³ã¼ããåå©ç¨ããã®ã§ã¯ãªãã¼ãããæ¸ãç´ããã¨ãæ¨å¥¨ãã¾ãã
ãµã¼ãã¹éã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã¯å¼·ãåä»ã
ãµã¼ãã¹éã§ããã¨ããããã¼ã¿ã¯ã¹ãã¼ããåºå®ããã¦ãã¾ãã
éçºç°å¢ã¯ãµã¼ãã¹ãã¨ã«èªç±ã«é¸æ
éçºè ã¯ãèªåã®å¾æãªæè¡ã好ããªæè¡ãããç¨åº¦è£éãæã£ã¦é¸ã¶ãã¨ãã§ãã¾ãã
ãã¹ããã©ã¯ãã£ã¹ã«å¾ã
ãããã¯ãã®æ´å²ççµç·¯ã§ã¯ãªããä¸è¬çãªãã¹ããã©ã¯ãã£ã¹ã«å¾ãã¾ããä¾ãã°Â The Twelve Factors, Go Code Review Comments, Semantic Versioning ãªã©ãããã§ãã
æ¡ç¨ããæè¡
microservices åããä¸ã§å¤ãã®æè¡ãæ°ãã«ã¨ãããã¾ããã以ä¸ã¯ãã®ä¸»ãªä¾ã§ãã
- Backend/Middleware
- Kubernetes
- Protocol Buffers
- gRPC
- RabbitMQ
- golang
- Monitoring/Alerting
- Elasticsearch + Kibana
- Prometheus + Grafana
- Zipkin
æ§æ
Cacoo ã®éçºãã¼ã ã¯ç¦å²¡ããã¥ã¼ã¨ã¼ã¯ãã¢ã ã¹ãã«ãã ã®3ã¤ã®æ ç¹ã«åããã¦ãã¾ãã
ç¦å²¡ã¯ Cacoo ã®ã¨ãã£ã¿ã¼ç»é¢ã®æ©è½ããã¥ã¼ã¨ã¼ã¯ã¨ã¢ã ã¹ãã«ãã ã¯å³ã®ä¸è¦§ï¼ããã·ã¥ãã¼ãï¼ç»é¢ã®æ©è½ãã¨ãããµãã«ãã£ããã¨å¥ãã¦ãã¾ãã
ããã·ã¥ãã¼ãå´ã®ããã³ãã¨ã³ã㯠vue.js ã§ã GraphQL ã§ãªã¯ã¨ã¹ããåºãã¾ãã
GraphQL ãµã¼ãã¼ã¯Â envoy ã使ã£ã¦ gRPC ãµã¼ãã¹ç¾¤ã«ã¢ã¯ã»ã¹ãã¾ããgRPC ãµã¼ãã¹ã¯å½¹å²ãã¨ã«DBã®å ¥åºåãè¡ã£ãã RabbitMQ ã«ã¤ãã³ããã¿ã¹ã¯ãåºããããã¾ããã¤ãã³ããã¿ã¹ã¯ãåãåãã¯ã¼ã«ã¼ãè¤æ°ãããéç¥ç¨ã®DBã«æµãããã¡ã¼ã«ã Webhook ã§éç¥ãåºããããã¾ãã
ã¨ãã£ã¿ã¼å´ã¯ã¢ããªã·ãã¯ãªã¢ããªã±ã¼ã·ã§ã³ã¸ã®ä¾åãæ¯è¼çå¤ãæ®ã£ã¦ãããã¨ãã£ã¿ã¼ã®ããã³ãã¨ã³ããããã«å å ããã¦ãã¾ãã
Cacoo éçºãã¼ã ã§ã¯ãããã¬ã¬ã·ã¼ã¢ããªã¨å¼ãã§ãã¾ããããã¾ã§ã¬ã¬ã·ã¼ã¢ããªãè¡ã£ã¦ããã¨ãã£ã¿ã¼é¢é£ã®å¦çã®å¤ãã¯Â editor-api
 ã«ç§»è¡ãã¦ãã¾ãã
å¤ãã®ãµã¼ãã¹ã¯ Kubernetes ä¸ã§åä½ãã¦ãã¾ããããã¹ã¦ã移è¡ã§ããããã§ã¯ããã¾ããã
Kubernetes
Kubernetes ã¯ã³ã³ãããªã¼ã±ã¹ãã¬ã¼ã·ã§ã³ã®åéã§ããã¡ã¯ãã»ã¹ã¿ã³ãã¼ãã«ãªã£ã¦ãã¾ãããã¯ãããããã¹ã¦ã Kubernetes ã«ç§»è¡ããããã§ã¯ããã¾ããã
ã¾ãå段éã¨ãã¦ã¢ããªã±ã¼ã·ã§ã³ãã³ã³ããåãã¦Â ECS ä¸ã§éç¨ãããã¨ã§ãã¦ãã¦ãæºãããã®å¾å°ãã㤠Kubernetes ã«ç§»è¡ãã¦ããã¾ãããECS ã¨æ¯è¼ãã¦ãããã¤ã®æ¹æ³ãã¢ãã¿ãªã³ã°ã®é¢ã§ããæè»ã«ä½¿ããã¨ããã®ãçç±ã§ãã
ç¾å¨ãæ¬çªç¨ã¨éçºç¨ã§2ã¤ã® Kubernetes ã¯ã©ã¹ã¿ãããã¾ããããã«Â namespaces ã使ã£ã¦æ¬çªç¨ã¯ãããã¯ã·ã§ã³ã¨ãã¼ã¿ã®2ã¤ã®ç°å¢ã«ãéçºç¨ã¯ãã¹ãã®ç¨éãã¨ã«3ã¤ã®ç°å¢ã«åºåããã¦ãã¾ããå¥ã®ç°å¢ãä½ããããã®ã Kubernetes ã使ãã¡ãªããã§ãã
ã¾ããHorizontal Pod Autoscalerã§Â Pod ã®ãªã¼ãã¹ã±ã¼ã«ããCluster Autoscaler㧠Kubernetes ã¯ã©ã¹ã¿ãåä½ãããã¹ãã®ãªã¼ãã¹ã±ã¼ã«ãè¡ã£ã¦ãã¾ãã
Protocol Buffers
ãµã¼ãã¹éã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã®å¤ãã¯Â Protocol Buffers ã§å®ç¾©ãã¦ãã¾ãã Protocol Buffers ã使ãã«ã¯Â .proto
 ãã¡ã¤ã«ã§åãå®ç¾©ããprotoc
 ã³ãã³ãã§ã³ã¼ããçæãã¾ãã
message Person { required string name = 1; required int32 id = 2; optional string email = 3; }Â
ããããã®ãã£ã¼ã«ãã«ã¯ã¿ã°ãã³ãã¼ã¨å¼ã°ããæ°å¤ãå²ãæ¯ããã¦ãã¦ãé åºã¯æ確ã«å®ç¾©ããã¾ãã.proto
 ãã¡ã¤ã«ã®å®ç¾©ããçæãããã³ã¼ãã使ããã¨ã§ãµã¼ãã¹éã§ããåããããã¼ã¿ã®åãå¼·ãå¶éãããã¨ãã§ãã¾ãã
gRPC
gRPC ã¯Â RPC(Remote Procedure Call) ã®ãã¬ã¼ã ã¯ã¼ã¯ã§ã Protocol Buffers ã§å®ç¾©ããã¤ã³ã¿ã¼ãã§ã¼ã¹ã使ã£ã¦ã³ã¼ããçæãã¾ãã
ä¾ãã°ã以ä¸ã®ãããªÂ .proto
 ãã¡ã¤ã«ãããã¨ãã¾ãã
// The greeting service definition. service Greeter { // Sends a greeting rpc SayHello (HelloRequest) returns (HelloReply) {} } // The request message containing the user's name. message HelloRequest { string name = 1; } // The response message containing the greetings message HelloReply { string message = 1; }
ãã®ãã¡ã¤ã«ã使ã£ã¦ Go ã®ã³ã¼ããçæããã¨Â SayHello
 ãå®ç¾©ãã interface ã¨ããããå®è£
ãã struct ãçæããã¾ãã
type GreeterClient interface { // Sends a greeting SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) } type greeterClient struct { cc *grpc.ClientConn } func NewGreeterClient(cc *grpc.ClientConn) GreeterClient { return &greeterClient{cc} } func (c *greeterClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) { out := new(HelloReply) err := c.cc.Invoke(ctx, "/helloworld.Greeter/SayHello", in, out, opts...) if err != nil { return nil, err } return out, nil }
Go 以å¤ã«ãè¤æ°ã®è¨èªã«å¯¾å¿ãã¦ããã .proto
 ãã¡ã¤ã«ãå
±æããã ãã§ç°ãªãè¨èªã使ã£ã¦å®è£
ããããµã¼ãã¹éã§ããã¼ã¿ãããã¨ãã§ãã¾ãã
Cacoo ã§ã¯ããã¢ã«ã¦ã³ãããããã©ã«ãã¼ããªã© DB ã®ãã¼ãã«ãã°ã«ã¼ãåãããæ å½ãããã¼ãã«ã«å¯¾ãã¦ã®ã¿èªã¿æ¸ããè¡ã gRPC ãµã¼ãã¹ãè¤æ°æ§ç¯ãã¦ãã¾ãã
ä¾ãã°ãã¢ã«ã¦ã³ããµã¼ãã¹ã¯ã¢ã«ã¦ã³ãã«é¢é£ãããã¼ãã«ã®ã¿å¤æ´ãè¡ããµã¼ãã¹ã§ãã¢ã«ã¦ã³ãæ å ±ã®åå¾ãæ´æ°ãè¡ãã¡ã½ãããæã£ã¦ãã¾ããä»ã®ãµã¼ãã¹ã¯ gRPC ã§ãããã®ã¡ã½ããã«ã¢ã¯ã»ã¹ãããã¨ãã§ãã¾ãã
RabbitMQ
microservices åã«ããã¦ã¡ãã»ã¼ã¸ã³ã°ã®æ©è½ã¯ä¸å¯æ¬ ã§ããã¡ãã»ã¼ã¸ã³ã°ãä»ãã¦è¤æ°ã®ãµã¼ãã¹ãéåæã«å¦çãããã¨ãã§ãã¾ãã
ã¾ãããµã¼ãã¹éã®ä¾åãå°ãããããã¨ãå¯è½ã§ããæ°ããã¢ã¼ããã¯ãã£ã«ç§»è¡ããä¸ã§ãæ°ãããµã¼ãã¹ãã¬ã¬ã·ã¼ãªã¢ããªã±ã¼ã·ã§ã³ã«ä¾åãããã¨ãå¤ããªãã¾ãããã®ã¨ãã«Â RabbitMQ ã®ãããªã¡ãã»ã¼ã¸ã³ã°ãçµç±ãããã¨ã§ä¾åãå°ãããããã¨ãã§ãã¾ãã
RabbitMQ ã¯ãã¥ã¼ããªã¢ã«ã«ããããã«ããã¥ã¼ãPub/SubãRPCãªã©è¤æ°ã®æ©è½ã«å¯¾å¿ãã¦ããã Cacoo ãã¼ã ã®ã¦ã¼ã¹ã±ã¼ã¹ã«æãé©ãã¦ããã¨å¤æããæ¡ç¨ãã¾ããã
Go
Cacoo ã§ã¯ãããã¯ã¨ã³ãã®ãµã¼ãã¹ã®ã»ã¨ãã©ã§ Go ãæ¡ç¨ããã¦ãã¾ããGo ã¯ã³ã³ãã¤ã«ãæ©ãå®è¡ç°å¢ãå°ããã¦æ¸ãããããããã¤ãé«éã§ããã³ã³ããåãããã¤ã³ãã©ã¨ç¸æ§ããããããCacoo ã®å¤ãã®ãµã¼ãã¹ã Go ã§æ¸ããã¦ãã¾ãã
ãã¡ããã©ã¤ãã©ãªãè¨èªã®ç¹æ§ãªã©ã®çç±ããä»ã®è¨èªãæ¡ç¨ããããã¨ãããã¾ããå®é Cacoo ã®ããã¯ã¨ã³ãã§ã¯ Go 以å¤ã«ã Java ã Node.js ãªã©ã使ããã¦ãã¾ãã
Elasticsearch + Kibana
ã¯ã©ã¹ã¿ä¸ã®ãã°ã¯ãã¹ã¦Â fluentd çµç±ã§Â Elasticsearch ã«æµãã¦Â Kibana ã§å¯è¦åãã¦ãã¾ãã
Prometheus + Grafana
Pod ã®ã¡ããªã¯ã¹ã®åå¾ã»ç£è¦ã¯Â Prometheus ã使ã£ã¦ãã¾ããããã«Â Grafana ã使ããã¨ã§å¯è¦åãè¡ã£ã¦ãã¾ãã
Zipkin
microservices ã§æ§æãããã·ã¹ãã ã§ã¯ãã¯ã©ã¤ã¢ã³ãããã®ã²ã¨ã¤ã®ãªã¯ã¨ã¹ããè¤æ°ã®ãµã¼ãã¹ã«åæ£ãããã¨ã«ãªãã¾ãã
ããã§Â Zipkin ã§ãªã¯ã¨ã¹ãããã¬ã¼ã·ã³ã°ãã¦ãã¾ãããµã¼ãã¹ãã¨ã«ã©ãã ãæéãããã£ã¦ããããããã®ã§ãã¬ã¹ãã³ã¹ãé ãã¨ããªã©ã«ãã©ããããã«ããã¯ã«ãªã£ã¦ãããç°¡åã«èª¿ã¹ããã¨ãã§ãã¾ãã
è©ä¾¡ï¼å°ããªä¾åé¢ä¿
Cacoo ã®éçºãã¼ã ã¯ç¦å²¡ããã¥ã¼ã¨ã¼ã¯ãã¢ã ã¹ãã«ãã ã®3ã¤ã®æ ç¹ã«åããã¦ãã¾ãããå¤ãã®å ´é¢ã§äºãã®éçºã®é²æç¶æ³ãç´°ããä»æ§ãªã©ãæ°ã«ãããã¨ãªããããç¨åº¦ç¬ç«ãã¦éçºãé²ãããã¦ããã¨æãã¦ãã¾ãã
ç»é¢ãè·¨ããããªæ©è½ã®éçºã .proto
 ãã¡ã¤ã«ã追å ã¾ãã¯ç·¨éããã¨ããªã©ã¯ã³ãã¥ãã±ã¼ã·ã§ã³ãçºçãã¾ãããäºãã®è²¬ä»»ã®ç¯å²ãã¯ã£ãããã¦ãããããèªèã«ãããåºã¦æ··ä¹±ãããããªãã¨ã¯ããã¾ããã
é¨åçãªå¤æ´ããããããªã£ãã¨æãã¦ãã¾ããã³ã¼ãã®å¤æ´ã«ããå½±é¿ç¯å²ãéå®çã§æ確ãªãããã©ã¤ãã©ãªã®æ´æ°ãå¤æ´ã大è¦æ¨¡ãªãªãã¡ã¯ã¿ãªã³ã°ã«å¯¾ããå¿ççãªéå£ã¯å°ããæãã¾ãã
å°ããªãµã¼ãã¹ãã¯ããããæ¸ãç´ããã¨ãããã¾ããã²ã¨ã¤ã²ã¨ã¤ã®ã³ã¼ããå°ããã®ã§æ´å²ççµç·¯ã«å¼ããããããã¨ãªãç¾æç¹ã®ãã¹ãã ã¨æããé¸æãã§ãã¾ãã
ããç¥ããã¦ããä¸è¬çãªãã¹ããã©ã¯ãã£ã¹ã«å¾ããã¨ãã§ããã®ã§ãæåãè¨èã®éãæ°ããã¡ã³ãã¼ãåå ãã¦ããã£ããã¢ããããããç°å¢ã«ãªã£ã¦ããæãã¾ãã
ãã«ãããããã¤ããµã¼ãã¹ãã¨ã«ç¬ç«ãã¦å®è¡ãããã®ã§ãã¨ã¦ãé«éã§ããå¾ ã¡æéãçãã®ã§ãå°ããªå¤æ´ãæ°è»½ã«é©ç¨ãããã¨ãã§ãã¦ãã¾ãã
課é¡ï¼æ°ããè¤éæ§
ã¢ã¼ããã¯ãã£ã®å·æ°ã§å¤ãã®èª²é¡ãæ¹åããã¾ããããããã§ããã¹ã¦ã解決ããããã§ã¯ããã¾ããããæ°ããªèª²é¡ãçã¾ãã¾ããã
ã¾ããå½åã®ç®çã§ãã£ãå¤ããã¬ã¼ã ã¯ã¼ã¯ã¸ã®ä¾åã¯å®å ¨ã«ã¯ãªããªã£ã¦ãã¾ãããå½¹å²ãããªãæ¸ã£ãã¨ã¯ãããã¢ããªã·ãã¯ãªã¢ããªã±ã¼ã·ã§ã³ã¯ã¾ã åä½ãç¶ãã¦ãããCacoo ã®ããã¤ãã®æ©è½ãå¦çã¯ããã«ä¾åãã¦ãã¾ãã
ã¾ãããµã¼ãã¹ãã©ãã§åºåããã¨ããåé¡ã常ã«ã¤ãã¾ã¨ãã¾ããééã£ãåå²ã¯è¤éæ§ãéç«ãããã ãã§ãããµã¼ãã¹ã®åå²ã¯ãã¼ã å ã§æ éã«è°è«ãã¦æ±ºããã¹ããã¨ã ã¨æãã¾ãã
Cacoo ã§ã¯ãå°ããã»ã©è¯ãããååã¨ãã¦ãµã¼ãã¹ãã§ããéãå°ããåå²ããããã«ãã¦ãã¾ããããã¯ããååã«å°ããªã¢ããªã±ã¼ã·ã§ã³ãçµ±åããããã大ããªã¢ããªã±ã¼ã·ã§ã³ãåå²ããã»ããé£ãããã¨ããä¸è¬è«ãåæã¨ãã¦ãã¾ãã
è¤éã«ãªããããªãç¯å²ã§å°ããåå²ããåé¡ãé¡å¨åããã°çµ±åãæ¤è¨ããããã«ãã¦ãã¾ãããã¾ã®ã¨ããä½ããçµ±åããå¿ è¦æ§ã¯æãã¦ãã¾ãããããã®ä»ã®åé¡ãããã¾ããã
ãµã¼ãã¹ãåå²ããåºæºã¨ãã¦ãDB ã®ãã©ã³ã¶ã¯ã·ã§ã³ããã³ãã«ãªãã¾ããCacoo ã§ã¯ãè¤æ°ã®ãµã¼ãã¹ã«ã¾ããã DB ã¸ã®èªã¿æ¸ãã«ããã¦ããã©ã³ã¶ã¯ã·ã§ã³å¦çã¯è«¦ãã¦ãã¾ããéã«è¨ãã°ããã©ã³ã¶ã¯ã·ã§ã³å¦çã絶対ã«å¿ è¦ãªå¦çã«ã¤ãã¦ã¯ããµã¼ãã¹ãè¤æ°ã«åå²ãã¹ãã§ã¯ããã¾ããã
ãµã¼ãã¹ã追å ãããã¨ã«CI/CDã®ãã¤ãã©ã¤ã³ãå¿ è¦ã«ãªãã¾ãããã¾ãå¹çåããæ¹æ³ããªãã¨éçºã«ãã¤ãã©ã¤ã³ã®æ´åã追ãã¤ããªããªãã¾ãã
ã³ã¼ãã®åé·æ§ãå¢ãã¨ããåé¡ãç®ã«ä»ãã¾ããè¤æ°ã®ãµã¼ãã¹ãã¨ã«ã³ã¼ããç¬ç«ãã¦ãããããåããããªå¦çã®ã³ã¼ãããã¡ãã¡ã«åæ£ãããããªãã¾ãã
Cacoo ã®å ´å㯠gRPC ãµã¼ãã¹ã RabbitMQ ã«é¢é£ããå¦çãªã©ããã®å ¸åã§ãããã㯠microservices ã®ç¹æ§ä¸ã許容ãã¹ããã¨ã§ããå ±éã®å¦çãã©ã¤ãã©ãªåãã¦ãã¾ãã¨ããæãããã¾ãããããããã¨è¤æ°ã®ãµã¼ãã¹ãåä¸ã®ã³ã¼ãã«ä¾åãã¦ãã¾ããããmicroservices ã®ã¡ãªãããæ¸ã£ã¦ãã¾ããã¨ã«ãªãã¾ãããã®ãããã¯ãã¼ã ã®ç¶æ³ãã³ã¼ãã®ç¹æ§ãªã©ãèæ ®ãã¦ãã¾ããã©ã³ã¹ãã¨ãå¿ è¦ãããã¾ãã
ä»å¾ã®å¯¾å¿
ä»å¾ã¯å¤ãã©ã¤ãã©ãªã¸ã®ä¾åãå®å ¨ã«ãªããã¹ãæ¹åãç¶ããå¿ è¦ãããã¾ãã
ã¾ããProtocol Buffers åããã¦ãªãã¤ã³ã¿ã¼ãã§ã¼ã¹ã使ã£ã¦ãããµã¼ãã¹ãæ´æ°ã»å ¥ãæ¿ããã¦ãããã¨ã§ãµã¼ãã¹éã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ãçµ±ä¸ãã¦ããå¿ è¦ãããã¾ããããã«ãµã¼ãã¹ã®ãã³ãã¬ã¼ããããã¯ã¸ã§ãã¬ã¼ã¿ã¼ãä½ããã¨ã§ãæ°ãããµã¼ãã¹ãä½ãããããããã¨èãã¦ãã¾ãã
ã¾ã¨ã
- Cacoo ã¯ããã¤ãã®èª²é¡ãæ±ãã¦ãã
- å¤ããã¬ã¼ã ã¯ã¼ã¯
- ã¢ããªã·ãã¯ãªã¢ããªã±ã¼ã·ã§ã³ã®å¼·ãä¾åé¢ä¿
- å¤æ ç¹ã§ã®éçº
- ãããã解決ããããã« microservices å
- å°ããä½ã£ã¦é£æº
- å°ããã¤åå²ã㦠ECS ä¸ã§éç¨
- ãã®å¾ Kubernetes ã¸
- ã¢ããªã±ã¼ã·ã§ã³ã®å¢çã¨ãªã¼ãã¼ã·ãããæ確ã«
- ç¶ç¶çãªéçºããããããªã£ã
- é¨åçã«å¤æ´ãããã
- é«éãªãã«ãã»ãããã¤
- ã¾ã ã¾ã æ¹åãå¿ è¦
ãããã«
Cacoo ãã¼ã ã§ã¯ããã³ãã¨ã³ãã¨ã³ã¸ãã¢ãããã¯ã¨ã³ãã¨ã³ã¸ãã¢ãSREãåéãã¦ãã¾ãã
è¨äºãèªã㧠Cacoo ã®ãã¨ãæ°ã«ãªã£ãæ¹ãä»åèªããªãã£ã Cacoo ã®ããã³ãã¨ã³ãã®è©±ãèãããæ¹ãGo ã使ã£ãéçºããã£ã¦ã¿ããæ¹ãKubernetes ã使ã£ãã¤ã³ãã©æ§ç¯ã»éç¨ãªã©ã® SRE ã«èå³ãããæ¹ã¯æ°è»½ã«è©±ãèãã«æ¥ã¦ãã ããããã¡ãããªã¢ã¼ãé¢è«ãOKã§ãã
以ä¸ã®Wantedlyãã¼ã¸ããã¿ãªããã®ã¨ã³ããªã¼ããå¾ ã¡ãã¦ãã¾ãï¼
æ ªå¼ä¼ç¤¾ãã¼ã©ãã®ä¼ç¤¾æ å ± – WantedlyÂ