ããããããã¯ãè¿œå ã®å©çãæåŸ ã§ããªããšããæå³ã§ã¯ãããŸããã Kafkaã«ã€ãã³ãé§ååAPIãå®è£ ããå Žåãæ£ç¢ºã«äœãåŸãããã®ããSergey ZaikaïŒ å°æ°ã® ïŒãæããŠãããŸãã ã¬ãããã¿ãèå³æ·±ãçºèŠã«ã€ããŠãã確ãã«ãããŸã-å®éšã¯ããããªãã§ã¯ã§ããŸããã
å 責äºé ïŒãã®èšäºã¯ã2018幎11æã«HighLoad ++ã§ã»ã«ã²ã€ãéå¬ããmitapã®è³æã«åºã¥ããŠããŸãã ã©ã¢ãã®ã«ãã«ãšã®ã©ã€ãäœéšã¯ãä»ã®ã¹ã±ãžã¥ãŒã«ã¬ããŒããšåãããã«ãªã¹ããŒãé äºããŸããã ããã¯ãå¿ãåãããã人ã ãèŠã€ããããšã¯åžžã«å¯èœã§ãããå¿ èŠã§ãããšããäºå®ã®çŽ æŽãããäŸã§ãããHighLoad ++ã®äž»å¬è ã¯ãããå©é·ããé°å²æ°ãäœãç¶ããããšããã§ãããã
ããã»ã¹ã«ã€ããŠ
Lamodaã¯ãç¬èªã®ã³ã³ã¿ã¯ãã»ã³ã¿ãŒãé ä¿¡ãµãŒãã¹ïŒããã³å€ãã®ã¢ãã£ãªãšã€ããµãŒãã¹ïŒãåçã¹ã¿ãžãªã巚倧ãªå庫ãåãã倧èŠæš¡ãªeã³ããŒã¹ãã©ãããã©ãŒã ã§ããããããã¯ãã¹ãŠãœãããŠã§ã¢ã§åäœããŸãã ãããã®ãµãŒãã¹ã®äžéšãŸãã¯ãã¹ãŠã䜿çšã§ãã補åã®ææ°æ å ±ãç¥ãããB2BããŒãããŒã«ã¯ãå€æ°ã®æ¯æãæ¹æ³ããããŸãã ããã«ãã©ã¢ãã¯ãã·ã¢é£éŠã«å ããŠ3ã€ã®åœã§åããŠãããããã§ã¯ãã¹ãŠãå°ãç°ãªããŸãã åèšã§ãããããæ°ãã泚æãæ§æããæ¹æ³ã¯100ãè¶ ãããããç¬èªã®æ¹æ³ã§åŠçããå¿ èŠããããŸãã ããã¯ãã¹ãŠãæã«ã¯èªæã§ã¯ãªãæ¹æ³ã§éä¿¡ããå€æ°ã®ãµãŒãã¹ã®å©ããåããŠæ©èœããŸãã ãŸããäž»ãªè²¬ä»»ã泚æã®ã¹ããŒã¿ã¹ã§ããäžå€®ã·ã¹ãã ããããŸãã ç§ãã¡ã¯åœŒå¥³ãBOBãšåŒã³ãç§ã¯åœŒå¥³ãšäžç·ã«ä»äºãããŠããŸãã
ã€ãã³ãããªãã³APIãåããè¿éããŒã«
ã€ãã³ãããªãã³ãšããèšèã¯ããªãããã¯ãããŠããŸããããããäœãæå³ããã®ããããå°ã詳ããå®çŸ©ããŸãã ãŸããKafkaã€ãã³ãé§ååAPIã¢ãããŒããè©ŠããŠã¿ãããšã«ããã³ã³ããã¹ãããå§ããŸãããã
ã©ã®åºèã§ãã顧客ãæ¯æã泚æã«å ããŠã補åã顧客ã«é©åããªãã£ããããåºèãè¿åãèŠæ±ãããå ŽåããããŸãã ãã®æ¯èŒççãããã»ã¹ïŒãã®ãããªå¿ èŠãããå Žåãæ å ±ãæ確ã«ãããéã転éããŸãã
ããããæ³æ¡ã®å€æŽã«ããè¿åã¯è€éã§ãããåå¥ã®ãã€ã¯ããµãŒãã¹ãå®è£ ããå¿ èŠããããŸããã
ç§ãã¡ã®åæ©ïŒ
- æ³åŸFZ-54-ç°¡æœã«èšãã°ãæ³åŸã§ã¯ãæ°åã§ããªãçãSLAã§ãè¿åã§ããåé ã§ãããåéèååŒã«ã€ããŠçšå眲ã«å ±åããããšã矩åä»ããããŠããŸãã ç§ãã¡ã¯ãé»ååååŒãšããŠãããªãã®æ°ã®æ¥åãè¡ã£ãŠããŸãã æè¡çã«ã¯ãããã¯é¢é£ãããã¹ãŠã®ã·ã¹ãã ã®æ°ãã責任ïŒãããã£ãŠæ°ãããµãŒãã¹ïŒãšæ¹åãæå³ããŸãã
- BOBã¹ããªãã -BOBããå€æ°ã®éäžæ žç責任ãåãé€ããå šäœçãªè€éãã軜æžããããã®ç€Ÿå ãããžã§ã¯ãã
ãã®å³ã¯ãåºæ¬çãªLamodaã·ã¹ãã ã瀺ããŠããŸãã çŸåšããããã®ã»ãšãã©ã¯ãæžå°ããã¢ããªã¹åšèŸºã®5ã10åã®ãã€ã¯ããµãŒãã¹ã®æ座ã®ãããªãã®ã§ãã ãããã¯ãã£ãããšæé·ããŠããŸãããäžå€®ã«ãã€ã©ã€ãããããã©ã°ã¡ã³ããå±éããã®ã¯æãã®ã§ãç§ãã¡ã¯ããããå°ããããããšããŠããŸã-ãããèœãšãããšã¯ã§ããŸããã ãã¹ãŠã®äº€æïŒç¢å°ïŒãäºçŽããå¿ èŠãããããããã®ãããããå©çšã§ããªãå Žåããããšããäºå®ã«åºã¥ããŠããŸãã
BOBã«ã¯ãæ¯æããé éãéç¥ã·ã¹ãã ãªã©ãéåžžã«å€ãã®ããåãããããŸãã
æè¡çã«ã¯ãBOBã¯æ¬¡ã®ãšããã§ãã
- ã150kè¡ã®ã³ãŒã+ã100kè¡ã®ãã¹ãã
- php7.2 + Zend 1ããã³Symfonyã³ã³ããŒãã³ã3;
- > 100 APIããã³ã50ã®ã¢ãŠãããŠã³ãçµ±åã
- ç¬èªã®ããžãã¹ããžãã¯ãæã€4ãåœã
BOBã®å±éã¯é«äŸ¡ã§èŠçã§ãããã³ãŒãã®éãšããã解決ããã¿ã¹ã¯ã¯ã誰ãé ã«å ¥ããããšãã§ããªãã»ã©ã§ãã äžè¬çã«ããããåçŽåããå€ãã®çç±ããããŸãã
è¿åããã»ã¹
æåã¯ãBOBãšæ¯æãã®2ã€ã®ã·ã¹ãã ãããã»ã¹ã«é¢äžããŠããŸãã ããã«2ã€è¡šç€ºãããŸãã
- 財æ¿åãµãŒãã¹ã¯ã財æ¿åãšå€éšãµãŒãã¹ãšã®ã³ãã¥ãã±ãŒã·ã§ã³ã®åé¡ãåŠçããŸãã
- æãæ»ãããŒã«ãBOBãèšåŒµãããªãããã«ãæ°ãã亀æãç°¡åã«åãåºãããŸãã
ããã»ã¹ã¯æ¬¡ã®ããã«ãªããŸãã
- BOBã¯æãæ»ããªã¯ãšã¹ããåãåããŸãã
- BOBã¯ãã®æãæ»ãããŒã«ã«ã€ããŠè©±ããŸãã
- æãæ»ãããŒã«ã«ã¯æ¯æããèšèŒãããŠããŸãïŒãè¿éããŠãã ãããã
- æ¯æãã¯ãéãè¿ããŸãã
- æãæ»ãããŒã«ãšBOBã¯ãçŸåšäž¡æ¹ã®ã¹ããŒã¿ã¹ãå¿ èŠãšããŠãããããäºãã«ã¹ããŒã¿ã¹ãåæããŸãã BOBã«ã¯UIãã¢ã«ãŠã³ãã£ã³ã°çšã®ã¬ããŒããéåžžã¯ç°¡åã«è»¢éã§ããªã倧éã®ããŒã¿ããããããæãæ»ãããŒã«ã«å®å šã«åãæ¿ããæºåã¯ãŸã ã§ããŠããŸããã 2ã€ã®æ€ åã«åº§ãå¿ èŠããããŸãã
- äŒèšèŠæ±ã¯å»ããŸãã
ãã®çµæãç§ãã¡ã¯ã«ãã«ã§ã€ãã³ããã¹ã®ãããªãã®ãäœããŸãã-ã€ãã³ããã¹ã§ããã¹ãŠãå§ãŸããŸããã ãããããä»ã§ã¯åäžé害ç¹ïŒç®èïŒããããŸãã
é·æãšçæã¯ããªãæçœã§ãã ãã¹ãäœã£ãã®ã§ãä»ã§ã¯ãã¹ãŠã®ãµãŒãã¹ãããã«äŸåããŠããŸãã ããã«ããèšèšãç°¡çŽ åãããŸãããã·ã¹ãã ã«åäžé害ç¹ãå°å ¥ãããŸãã ã«ãã«ã¯äœäžããããã»ã¹ã¯äžæããŸãã
ã€ãã³ãé§ååAPIãšã¯
ãã®è³ªåã«å¯Ÿããé©åãªçãã¯ãMartin FowlerïŒGOTO 2017ïŒã«ããã¬ããŒããã€ãã³ãé§ååã¢ãŒããã¯ãã£ã®å€ãã®æå³ãã«ãããŸãã
ç°¡åã«èšãã°ãç§ãã¡ãããããšïŒ
- ã€ãã³ãã¹ãã¬ãŒãžãä»ããŠãã¹ãŠã®éåæ亀æãã©ããããŸããã é¢å¿ã®ããåæ¶è²»è ã«ãããã¯ãŒã¯çµç±ã§ã¹ããŒã¿ã¹ã®å€æŽãéç¥ãã代ããã«ãã¹ããŒã¿ã¹å€æŽã€ãã³ããäžå€®ãªããžããªã«æžã蟌ã¿ããããã¯ã«é¢å¿ã®ããæ¶è²»è ããããã衚瀺ããããã¹ãŠãèªã¿åããŸãã
- ãã®å Žåã®ã€ãã³ãã¯ãã©ããã§äœããå€æŽããããšããéç¥ïŒ notification ïŒã§ãã ããšãã°ã泚æã¹ããŒã¿ã¹ãå€æŽãããŸããã ã¹ããŒã¿ã¹ã®å€æŽã«äŒŽãäœããã®çš®é¡ã®ããŒã¿ã«é¢å¿ããããéç¥ã«å«ãŸããŠããªãæ¶è²»è ã¯ãèªåã§ã¹ããŒã¿ã¹ã調ã¹ãããšãã§ããŸãã
- æ倧ã®ãªãã·ã§ã³ã¯ãæ¬æ Œçãªã€ãã³ããœãŒã·ã³ã°ã§ããç¶æ 転éã§ãããã®ã€ãã³ãã«ã¯ãåŠçã«å¿ èŠãªãã¹ãŠã®æ å ±ãå«ãŸããŸããã©ãããã©ã®ãããªã¹ããŒã¿ã¹ãŸã§è»¢éãããããããŒã¿ãæ£ç¢ºã«ã©ã®ããã«å€æŽãããããªã©ã§ãã
æãæ»ãããŒã«ã®çºå£²ã®äžç°ãšããŠã3çªç®ã®ãªãã·ã§ã³ã䜿çšããŸããã ããã«ããã詳现ãªæ å ±ãååŸããå¿ èŠããªããããã€ãã³ãã®åŠçãç°¡çŽ åãããŸãããããã«ãæ°ããã€ãã³ããçºçãããã³ã«æ¶è²»è ããã®getãªã¯ãšã¹ããæ確ã«ãªããšããã·ããªãªãé€å€ãããŸããã
æãæ»ãããŒã«ãµãŒãã¹ã¯èªã¿èŸŒãŸããªããããKafkaã¯å¿ èŠãšãããããã³ãã¹ãã®ãããªãã®ã§ãã æãæ»ããµãŒãã¹ãé«è² è·ã®ãããžã§ã¯ãã«ãªã£ãããããžãã¹ã¯å¹žãã«ãªããšã¯æããŸããã
éåæ亀æ
éåæ亀æã®å ŽåãPHPéšéã¯éåžžRabbitMQã䜿çšããŸãã ãªã¯ãšã¹ãã®ããŒã¿ãåéããŠãã¥ãŒã«å ¥ããåããµãŒãã¹ã®ã³ã³ã·ã¥ãŒããŒããããèªã¿åã£ãŠéä¿¡ããŸããïŒãŸãã¯éä¿¡ããŸããã§ããïŒã APIèªäœã«ã€ããŠã¯ãLamodaã¯Swaggerãç©æ¥µçã«äœ¿çšããŠããŸãã APIãèšèšããSwaggerã§èšè¿°ããã¯ã©ã€ã¢ã³ãã³ãŒããšãµãŒããŒã³ãŒããçæããŸãã ãŸããå°ãé«åºŠãªJSON RPC 2.0ã䜿çšããŸãã
ãã¡ãã¡ã§esbãã¹ã䜿çšããã誰ããactiveMQã«äœãã§ããŸãããäžè¬çã«ã¯RabbitMQãæšæºã§ãã
éåæ亀æ
ã€ãã³ããã¹ãä»ããŠååŒæãèšèšããå Žåãé¡æšã远跡ãããŸãã åæ§ã«ãã€ãã³ãæ§é ã®èª¬æãéããŠå°æ¥ã®ããŒã¿äº€æã«ã€ããŠèª¬æããŸãã yaml圢åŒãã³ãŒãçæã¯èªåã§è¡ãå¿ èŠãããããžã§ãã¬ãŒã¿ãŒã¯ä»æ§ã«åŸã£ãŠDTOãäœæããã¯ã©ã€ã¢ã³ããšãµãŒããŒã«ãããã®æäœæ¹æ³ãæããŸãã çæã¯golangãšphpã® 2ã€ã®èšèªã«ãªããŸãã ããã«ãããã©ã€ãã©ãªã®äžè²«æ§ãä¿ãããŸãã ãžã§ãã¬ãŒã¿ã¯golangã§èšè¿°ãããŠãããgogiãšããååãä»ããããŠããŸãã
Kafkaã§ã®ã€ãã³ããœãŒã·ã³ã°ã¯å žåçãªãã®ã§ãã Kafka Confluentã®ã¡ã€ã³ãšã³ã¿ãŒãã©ã€ãºããŒãžã§ã³ããã®è§£æ±ºçããããŸããZalandoãã¡ã€ã³ãšãªã¢ã®ãå åŒãããã®è§£æ±ºçã§ããnakadiããããŸãã ããã©ã»ã«ãã«ããå§ããåæ©ã¯ãã©ãã§ã䜿çšãããã©ãããæçµçã«æ±ºå®ãããŸã§ãœãªã¥ãŒã·ã§ã³ãç¡æã®ãŸãŸã«ããããã«æäœãšæ¹åã®äœå°ãæ®ãããšã§ãïŒ JSON RPC 2.0ã®ãµããŒãã2ã€ã®èšèªã®ãžã§ãã¬ãŒã¿ãŒãããã³ãã®ä»ã®æ©èœã確èªããŸãã
ç®èãªããšã«ããã®ãããªå¹žããªã±ãŒã¹ã§ãããåæ§ã®æ±ºå®ãäžããã¶ã©ã³ããšåæ§ã®ããžãã¹ãããå Žåããããå¹æçã«äœ¿çšããããšã¯ã§ããŸããã
ã¢ãŒããã¯ãã£äžãèµ·åæã®ãã¿ãŒã³ã¯æ¬¡ã®ãšããã§ããKafkaããçŽæ¥èªã¿åããŸãããã€ãã³ããã¹ãä»ããŠã®ã¿æžã蟌ã¿ãŸãã Kafkaã«ã¯å€ãã®èªã¿ç©ããããŸãïŒãããŒã«ãŒããã©ã³ãµãŒããããŠæ°Žå¹³ã¹ã±ãŒãªã³ã°ã®æºåãå€ããå°ãªãããç§ã¯ãããç¶æãããã£ãã§ãã èšé²ãšããŠãã€ãã³ããã¹ãšããŠç¥ããã1ã€ã®ã²ãŒããŠã§ã€ãã©ãããããã£ãã®ã§ãããããçç±ã§ãã
ã€ãã³ããã¹
ãŸãã¯ã€ãã³ããã¹ã ããã¯ãããã€ãã®éèŠãªåœ¹å²ãæ ãåãªãã¹ããŒãã¬ã¹httpã²ãŒããŠã§ã€ã§ãã
- çç£ã®æ€èšŒ -ã€ãã³ããä»æ§ãæºãããŠããããšãæ€èšŒããŸãã
- ã€ãã³ããã¹ã¿ã·ã¹ãã ãã€ãŸããããã¯ãã©ã®æ§é ã®ã€ãã³ããæå¹ã§ãããšèŠãªãããããšãã質åã«çãããäŒæ¥å ã®ã¡ã€ã³ã§å¯äžã®ã·ã¹ãã ã§ãã æ€èšŒã«ã¯ãã³ã³ãã³ãã®å³å¯ãªæå®ã®ããã®ããŒã¿åãšåæãå«ãŸããŸãã
- ã·ã£ãŒãã£ã³ã°ã®ããã·ã¥é¢æ° -Kafkaã¡ãã»ãŒãžæ§é ã¯ããŒãšå€ã§ãããããã§ã¯ããŒããã®ããã·ã¥ããããã©ãã«çœ®ãããèšç®ããŸãã
ãªã
ç§ãã¡ã¯ãåçåãããããã»ã¹ãæã€å€§äŒæ¥ã§åããŠããŸãã ãªãå€æŽããã®ã§ããïŒ ããã¯å®éšã§ãããããã€ãã®å©ç¹ãæåŸ ãããŸãã
1ïŒn + 1åã®äº€æïŒ1察å€ïŒ
Kafkaã䜿çšãããšãæ°ããæ¶è²»è ãAPIã«ç°¡åã«æ¥ç¶ã§ããŸãã
ããã€ãã®ã·ã¹ãã ïŒããã³ããã€ãã®æ°ããã·ã¹ãã ïŒã§åæã«ææ°ã®ç¶æ ã«ä¿ã€å¿ èŠããããã£ã¬ã¯ããªããããšããŸãã 以åã¯ãset-APIãå®è£ ãããã³ãã«ãçºæããã³ã³ã·ã¥ãŒãã·ã¹ãã ã®ã¢ãã¬ã¹ããã¹ã¿ãŒã·ã¹ãã ã«å ±åãããŸããã ããã§ããã¹ã¿ãŒã·ã¹ãã ã¯ãããã¯ã®æŽæ°ãšãèªæžã«èå³ããããã¹ãŠã®äººã«æŽæ°ãéä¿¡ããŸãã æ°ããã·ã¹ãã ãç»å ŽããŸãã-圌ãã¯ãããã¯ã§ããã«çœ²åããŸããã ã¯ãããã³ãã«ãã§ããŸãããããç°¡åã§ãã
BOBã®äžéšã§ããæãæ»ãããŒã«ã®å ŽåãKafkaã䜿çšããŠããããåæãããŠãããšäŸ¿å©ã§ãã æ¯æãã¯ã圌ãããéãè¿ãããšèšããŸãïŒBOBãRTã¯ãããèŠã€ããŠã圌ãã®ã¹ããŒã¿ã¹ãå€ããŸãããFiscalization Serviceã¯ãããèŠã€ããŠå°åæãããã¯ã¢ãŠãããŸããã
ã¯ã©ã€ã¢ã³ãã«æ³šæ/è¿åã«é¢ãããã¥ãŒã¹ãéç¥ããåäžã®éç¥ãµãŒãã¹ãäœæããèšç»ããããŸãã çŸåšããã®è²¬ä»»ã¯ã·ã¹ãã éã§åæ£ããŠããŸãã éç¥ãµãŒãã¹ã«ãKafkaããã®é¢é£æ å ±ããã£ããããŠå¿çããïŒããã³ä»ã®ã·ã¹ãã ã§ãããã®éç¥ãç¡å¹ã«ããïŒããšãæããã ãã§ååã§ãã æ°ããçŽæ¥äº€æã¯å¿ èŠãããŸããã
ããŒã¿é§å
ã·ã¹ãã éã®æ å ±ã¯éæã«ãªããŸã-ããªããã©ããªã«è¡ãªãŸãããäŒæ¥ã§ãã£ãŠããããªãã®ããã¯ãã°ãã©ãã»ã©èšãããã£ãŠããŠãã Lamodaã«ã¯ããŒã¿åæéšéããããããžãã¹ããã³ã€ã³ããªãžã§ã³ãã·ã¹ãã ã®äž¡æ¹ã§ãã·ã¹ãã äžã®ããŒã¿ãåéããåå©çšå¯èœãªåœ¢åŒã«ããŸãã Kafkaã䜿çšãããšã倧éã®ããŒã¿ããã°ããæäŸãããã®æ å ±ãææ°ã®ç¶æ ã«ä¿ã€ããšãã§ããŸãã
è€è£œãã°
RabbitMQã®ããã«ãã¡ãã»ãŒãžã¯èªã¿åãåŸã«æ¶ããŸããã ã€ãã³ãã«åŠçã«ååãªæ å ±ãå«ãŸããŠããå Žåããªããžã§ã¯ãã«å¯Ÿããæè¿ã®å€æŽã®å±¥æŽããããå¿ èŠã«å¿ããŠãããã®å€æŽãé©çšããããšãã§ããŸãã
ã¬ããªã±ãŒã·ã§ã³ãã°ã®ä¿åæéã¯ããã®ãããã¯ã®èšé²åŒ·åºŠã«ãã£ãŠç°ãªããŸãããKafkaã䜿çšãããšãä¿åæéãšããŒã¿ããªã¥ãŒã ã®å¶éãæè»ã«èšå®ã§ããŸãã éäžçãªãããã¯ã®å Žåãçæçãªæäœäžèœã®å Žåã§ãããã¹ãŠã®æ¶è²»è ãæ å ±ãæ¶ããåã«èªãæéãããããšãéèŠã§ãã éåžžãæ¥åäœã®ããŒã¿ãä¿åããããšãå€æããŸãããããã¯ãµããŒãã«ã¯ååã§ãã
次ã«ãKafkaã«ç²ŸéããŠããªã人ã®ããã«ãããã¥ã¡ã³ããå°ãæ¹ããŸãïŒåçãããã¥ã¡ã³ãããïŒ
AMQPã«ã¯ãã¥ãŒããããŸããã³ã³ã·ã¥ãŒããŒã®ãã¥ãŒã«ã¡ãã»ãŒãžãæžã蟌ã¿ãŸãã ååãšããŠã1ã€ã®ãã¥ãŒã¯åãããžãã¹ããžãã¯ãæã€1ã€ã®ã·ã¹ãã ã«ãã£ãŠåŠçãããŸãã è€æ°ã®ã·ã¹ãã ã«éç¥ããå¿ èŠãããå Žåã¯ãã¢ããªã±ãŒã·ã§ã³ã«è€æ°ã®ãã¥ãŒã«æžã蟌ãããããèªäœãè€è£œãããã¡ã³ã¢ãŠãã¡ã«ããºã ãšã®äº€æãèšå®ããããã«æããããšãã§ããŸãã
Kafkaã«ã¯ãã¡ãã»ãŒãžãæžããšããåæ§ã®ãããã¯æœè±¡åããããŸãããèªããšæ¶ããŸããã ããã©ã«ãã§ã¯ãKafkaã«æ¥ç¶ãããšããã¹ãŠã®ã¡ãã»ãŒãžãåä¿¡ãããšåæã«ãäžæããå Žæãä¿åããæ©äŒããããŸãã ã€ãŸããé çªã«èªããšãã¡ãã»ãŒãžã«æ¢èªã®ããŒã¯ãä»ããããšã¯ã§ããŸããããIDãä¿åããããããèªã¿ç¶ããããšãã§ããŸãã åæ¢ããIDã¯ãªãã»ãããšåŒã°ããã¡ã«ããºã ã¯ã³ããããªãã»ããã§ãã
ãããã£ãŠãç°ãªãããžãã¯ãå®è£ ã§ããŸãã ããšãã°ãããŸããŸãªåœã®4ã€ã®ã€ã³ã¹ã¿ã³ã¹ã«BOBããããŸããã©ã¢ãã¯ãã·ã¢ãã«ã¶ãã¹ã¿ã³ããŠã¯ã©ã€ãããã©ã«ãŒã·ã«ãããŸãã åå¥ã«ãããã€ããããããç¬èªã®æ§æãšããžãã¹ããžãã¯ãå°ããããŸãã ã¡ãã»ãŒãžã§ã©ã®åœãæããŠãããã瀺ããŸãã ååœã®åBOBã³ã³ã·ã¥ãŒããŒã¯ç°ãªãgroupIdã§èªã¿åããã¡ãã»ãŒãžã圌ã«é©çšãããªãå Žåã¯ã¹ãããããŸãã ãªãã»ãã+1ãçŽã¡ã«ã³ãããããŸãã åããããã¯ãæ¯æããµãŒãã¹ã«ãã£ãŠèªã¿åãããå Žåãå¥ã®ã°ã«ãŒãã§ãããè¡ãããããããªãã»ããã¯éè€ããŸããã
ã€ãã³ãèŠä»¶ïŒ
- ããŒã¿ã®å®å šæ§ã ã€ãã³ãã«ååãªããŒã¿ããããåŠçã§ããããã«ãããã§ãã
- èª å®ã ã€ãã³ããäžè²«ããŠããããããåŠçã§ããããšãã€ãã³ããã¹ã«å§ä»»ããŸãã
- é åºãéèŠã§ãã 埩垰ã®å Žåãç§ãã¡ã¯æŽå²ãæ±ãããšãäœåãªããããŸãã éç¥ã®å Žåãé åºã¯éèŠã§ã¯ãããŸãããããããåçš®ã®éç¥ã§ããå Žåãæåã«å°çããé åºã«é¢ä¿ãªããé»åã¡ãŒã«ã¯åãã«ãªããŸãã è¿åã®å Žåãæ確ãªããã»ã¹ãããã泚æãå€æŽãããšäŸå€ãçºçããæãæ»ãã¯äœæãåŠçããããŸãã-ç°ãªãã¹ããŒã¿ã¹ã«ãªããŸãã
- ã³ããŒã¬ã³ã¹ã ãªããžããªããããAPIã®ä»£ããã«ã€ãã³ããäœæããŸãã æ°ããã€ãã³ããæ¢åã®ã€ãã³ããžã®å€æŽã«é¢ããæ å ±ããµãŒãã¹ã«è¿ éãã€å®äŸ¡ã«è»¢éããæ¹æ³ãå¿ èŠã§ãã ããã¯ãå¥åã®gitãªããžããªãšã³ãŒããžã§ãã¬ãŒã¿ãŒã§å ±éã®ä»æ§ã䜿çšããŠå®çŸãããŸãã ãããã£ãŠãç°ãªããµãŒãã¹ã®ã¯ã©ã€ã¢ã³ããšãµãŒããŒã¯åæããŸããã
ã©ã¢ãã®ã«ãã«
3ã€ã®Kafkaã€ã³ã¹ããŒã«ããããŸãã
- ãã°
- ç 究éçº;
- ã€ãã³ããã¹ã
ä»æ¥ã¯æåŸã®ãã€ã³ãã«ã€ããŠã®ã¿è©±ããŸãã ã€ãã³ããã¹ã§ã¯ã3ã€ã®ãããŒã«ãŒïŒãµãŒããŒïŒãšåèš27ã®ãããã¯ãšããéåžžã«å€§èŠæš¡ãªã€ã³ã¹ããŒã«ã¯ãããŸããã ååãšããŠã1ã€ã®ãããã¯ã¯1ã€ã®ããã»ã¹ã§ãã ããããããã¯åŸ®åŠãªç¬éã§ãããä»ãã觊ããŸãã
äžã¯rpsãã£ãŒãã§ãã æãæ»ãããã»ã¹ã«ã¯éç·è²ã®ç·ïŒã¯ããX軞äžã«ããç·ïŒãä»ããŠããããã³ã¯ã¯ã³ã³ãã³ãæŽæ°ããã»ã¹ã§ãã
Lamodaã®ã«ã¿ãã°ã«ã¯äœçŸäžãã®è£œåãå«ãŸããŠãããããŒã¿ã¯åžžã«æŽæ°ãããŠããŸãã äžéšã®ã³ã¬ã¯ã·ã§ã³ã¯æ代é ãã«ãªãããããã®ä»£ããã«æ°ãããã®ããªãªãŒã¹ãããæ°ããã¢ãã«ãã«ã¿ãã°ã«åžžã«è¡šç€ºãããŸãã ææ¥ãã客æ§ã«ãšã£ãŠäœãé¢çœãããäºæž¬ãããããåžžã«æ°ãããã®ãè³Œå ¥ããåçãæ®ãããŠã£ã³ããŠãæŽæ°ããŠããŸãã
ãã³ã¯ã®ããŒã¯ã¯è£œåã®æŽæ°ãã€ãŸã補åã®å€æŽã§ãã ç·ãã¡ãåçãæ®ã£ããåçãæ®ã£ãããããŠåã³æ®ã£ãããšããããïŒ -ã€ãã³ãã®ãã±ãããããŠã³ããŒãããŸããã
Lamoda Eventsã®ãŠãŒã¹ã±ãŒã¹
ãã®ãããªæäœã«ã¯ãæ§ç¯ãããã¢ãŒããã¯ãã£ã䜿çšããŸãã
- è¿åã¹ããŒã¿ã¹ã®è¿œè·¡ ïŒè¡åãä¿ããã¬ãŒãºãšãé¢é£ãããã¹ãŠã®ã·ã¹ãã ããã®ã¹ããŒã¿ã¹ã®è¿œè·¡ã æ¯æããã¹ããŒã¿ã¹ãäŒèšãéç¥ã ããã§ã¯ãã¢ãããŒããè©ŠããããŒã«ãäœæãããã¹ãŠã®ãã°ãåéããããã¥ã¡ã³ããæžããååã«ãã®äœ¿çšæ¹æ³ãäŒããŸããã
- 補åã«ãŒãã®æŽæ°ïŒæ§æãã¡ã¿ããŒã¿ãç¹æ§ã 1ã€ã®ã·ã¹ãã ãèªã¿åãïŒè¡šç€ºïŒããããã€ãã®ã·ã¹ãã ãæžã蟌ã¿ãŸãã
- é»åã¡ãŒã«ãããã·ã¥ãSMS ïŒæ³šæãåéããã泚æãå°çããè¿åãåãä»ããããããªã©ããããã®å€ãã
- åšåº«ãå庫ã®æŽæ° -ã¢ã€ãã ã®å®éçãªæŽæ°ãæ°åã ãïŒå庫ã§ã®åãåããè¿åã ååã®äºçŽã«é¢é£ãããã¹ãŠã®ã·ã¹ãã ã¯ãæãé¢é£æ§ã®é«ãããŒã¿ã§åäœããå¿ èŠããããŸãã æ氎管ã®ã¢ããã°ã¬ãŒãã·ã¹ãã ã¯éåžžã«è€éã«ãªããŸããããKafkaã¯ãããç°¡çŽ åããŸãã
- ããŒã¿åæ ïŒRïŒDéšéïŒãMLããŒã«ãåæãçµ±èšã æ å ±ãéæã«ããã-ãã®ãããKafkaã¯éåžžã«é©ããŠããŸãã
ä»ãããèå³æ·±ãéšåã¯ã6ãæã«ããã£ãŠçºçããè©°ã蟌ã¿ãã³ããšèå³æ·±ãçºèŠã«ã€ããŠã§ãã
èšèšã®åé¡
ããšãã°ãé ä¿¡ããã»ã¹å šäœãKafkaã«è»¢éãããªã©ãæ°ããããšãããããšããŸãã çŸåšãããã»ã¹ã®äžéšã¯BOBã®æ³šæåŠçã«å®è£ ãããŠããŸãã 泚æã®é éãµãŒãã¹ãžã®è»¢éãäžéå庫ãžã®è»¢éãªã©ã®èåŸã«ã¯ãã¹ããŒã¿ã¹ã¢ãã«ããããŸãã ã¢ããªã¹å šäœãããã2ã€ã«å ããŠãé ä¿¡å°çšAPIã®æããããŸãã 圌ãã¯é éã«ã€ããŠããå€ããç¥ã£ãŠããŸãã
ãããã¯é¡äŒŒããé åã®ããã«èŠããŸãããBOBã§ã®æ³šæåŠçãšé ä¿¡ã·ã¹ãã ã§ã¯ãã¹ããŒã¿ã¹ãç°ãªããŸãã ããšãã°ãäžéšã®å® é 䟿ãµãŒãã¹ã¯äžéã¹ããŒã¿ã¹ãéä¿¡ãããæçµã¹ããŒã¿ã¹ã®ã¿ãé ä¿¡ããŸãããé ä¿¡æžã¿ããŸãã¯ãçŽå€±ãã§ãã ããã©ããããååã®ç§»åã«ã€ããŠè©³çŽ°ã«å ±åãã人ãããŸãã 誰ããç¬èªã®æ€èšŒã«ãŒã«ãæã£ãŠããŸãã誰ãã«ãšã£ãŠã¯ãé»åã¡ãŒã«ã¯æå¹ã§ãããããåŠçãããŸãã ä»ã®äººã«ãšã£ãŠã¯æå¹ã§ã¯ãããŸããããéä¿¡ã®ããã®é»è©±ãããããã泚æã¯åŠçãããŸãããã®ãããªæ³šæã¯ãŸã£ããåŠçãããªããšèª°ããèšãã§ãããã
ããŒã¿ã¹ããªãŒã
Kafkaã®å ŽåãããŒã¿ãããŒãæŽçãããšããçåãçããŸãã ãã®ã¿ã¹ã¯ã¯ãããã€ãã®ãã€ã³ãã®æŠç¥ã®éžæã«é¢é£ããŠããŸããããããã¹ãŠãæ€èšããŸãã
ãããããã¯ã§ããŸãã¯å¥ã®ãããã¯ã§ïŒ
ã€ãã³ãã®ä»æ§ããããŸãã BOBã§ã¯ããã®ãããªæ³šæãé ä¿¡ããå¿ èŠãããããšãèšè¿°ãã泚æçªå·ããã®æ§æãäžéšã®SKUããã³ããŒã³ãŒããªã©ã瀺ããŸãã ååãå庫ã«å°çãããšãé éã¯ã¹ããŒã¿ã¹ãã¿ã€ã ã¹ã¿ã³ããããã³å¿ èŠãªãã¹ãŠã®ãã®ãåãåãããšãã§ããŸãã ããããããã«ãã®ããŒã¿ã®æŽæ°ãBOBã§åãåããããšèããŠããŸãã é ä¿¡ããããŒã¿ãååŸããéã®ããã»ã¹ã«çŽé¢ããŠããŸãã ããã¯åãã€ãã³ãã§ããïŒ ãããšããå¥ã®ãããã¯ã«å€ããå¥ã®äº€æã§ããïŒ
ããããããããã¯éåžžã«ãã䌌ãŠããã1ã€ã®ãããã¯ãäœæããèªæã¯äžåçã§ã¯ãããŸããããªããªããåå¥ã®ãããã¯ã¯åå¥ã®ã³ã³ã·ã¥ãŒããŒãåå¥ã®æ§æãããããã¹ãŠã®åå¥ã®äžä»£ã ããã§ãã ããããäºå®ã§ã¯ãããŸããã
æ°ãããã£ãŒã«ããŸãã¯æ°ããã€ãã³ãïŒ
ãã ããåãã€ãã³ãã䜿çšãããšãå¥ã®åé¡ãçºçããŸãã ããšãã°ããã¹ãŠã®é ä¿¡ã·ã¹ãã ãBOBãçæã§ããDTOãçæã§ããããã§ã¯ãããŸããã IDãéä¿¡ããŸããããããã¯å¿ èŠãªãããä¿åããŸãããã€ãã³ããã¹ããã»ã¹ãéå§ãããšãã芳ç¹ããããã®ãã£ãŒã«ãã¯å¿ é ã§ãã
ãã®ãã£ãŒã«ããå¿ é ã§ãããšããã€ãã³ããã¹ã®ã«ãŒã«ãå°å ¥ãããšãBOBãŸãã¯éå§ã€ãã³ããã³ãã©ãŒã§è¿œå ã®æ€èšŒã«ãŒã«ãèšå®ããå¿ èŠããããŸãã æ€èšŒã¯ãµãŒãã¹ã«å¿ã³èŸŒã¿å§ããŸã-ããã¯ããŸã䟿å©ã§ã¯ãããŸããã
ãã1ã€ã®åé¡ã¯ãå¢åãã€ãã³ã°ã®èªæã§ãã ã€ãã³ãã«äœããè¿œå ããå¿ èŠããããšèšãããŸãããæ éã«èããã°ãå¥ã®ã€ãã³ãã«ãªã£ãŠããã¯ãã§ãã ãããããã®ã¹ããŒã ã§ã¯ãå¥ã®ã€ãã³ãã¯å¥ã®ãããã¯ã§ãã å¥ã®ãããã¯ã¯ãäžã§èª¬æããããã»ã¹å šäœã§ãã éçºè ã¯ãJSONã¹ããŒã ã«å¥ã®ãã£ãŒã«ããè¿œå ããŠåçæãããã ãã§ãã
æãæ»ãã®å Žåã6ãæéã€ãã³ãã€ãã³ãã«åå ããŸããã æãæ»ãæŽæ°ãšåŒã°ããã¡ã¿ã€ãã³ãã1ã€ãããŸããããã®ã€ãã³ãã«ã¯ããã®æŽæ°ãå®éã«äœãæ§æããããèšè¿°ããã¿ã€ããã£ãŒã«ãããããŸããã ãã®ããããã®ã¿ã€ãã§ãã®ã€ãã³ããæ€èšŒããæ¹æ³ã瀺ãããªããŒã¿ãŒãæã€ãçŸãããã¹ã€ããããããŸããã
ã€ãã³ãã®ããŒãžã§ã³ç®¡ç
Avroã䜿çšããŠKafkaã§ã¡ãã»ãŒãžãæ€èšŒã§ããŸãããããã«ããã䜿çšããŠConfluentã䜿çšããå¿ èŠããããŸããã ãã®å ŽåãããŒãžã§ã³ç®¡çã«ã¯æ³šæããå¿ èŠããããŸãã ã¢ãã«ã«ã¯ãå·Šãããããããã¬ããªã±ãŒã·ã§ã³ãã°ããã¡ãã»ãŒãžãåèªã¿èŸŒã¿ã§ãããšã¯éããŸããã åºæ¬çã«ãã¢ãã«ãåŸæ¹äºææ§ãæã€ããã«ããŒãžã§ã³ããã«ãããããšãå€æããŸãããããšãã°ããã£ãŒã«ããäžæçã«ãªãã·ã§ã³ã«ããŸãã éãã匷ãããå Žåã¯ãæ°ãããããã¯ã®å·çãéå§ããã¯ã©ã€ã¢ã³ãã¯å€ããããã¯ãèªãã ãšãã«ç§»æ€ãããŸãã
èªã¿åãé åºä¿èšŒããŒãã£ã·ã§ã³
Kafkaå ã®ãããã¯ã¯ããŒãã£ã·ã§ã³ã«åå²ãããŠããŸãã ãšã³ãã£ãã£ãšäº€æãèšèšããéãããã¯ããŸãéèŠã§ã¯ãããŸãããããããã©ã®ããã«é©åãããã¹ã±ãŒãªã³ã°ãããã決å®ãããšãã¯éèŠã§ãã
éåžžã®å ŽåãKafkaã§1ã€ã®ãããã¯ãäœæããŸãã ããã©ã«ãã§ã¯ã1ã€ã®ããŒãã£ã·ã§ã³ã䜿çšããããã®ãããã¯ã®ãã¹ãŠã®ã¡ãã»ãŒãžããã®ããŒãã£ã·ã§ã³ã«åé¡ãããŸãã ãããŠãæ¶è²»è ã¯ãããã®ã¡ãã»ãŒãžãé çªã«èªã¿åããŸãã ã¡ãã»ãŒãžã2ã€ã®ç°ãªãã³ã³ã·ã¥ãŒããŒã«ãã£ãŠèªã¿åãããããã«ã·ã¹ãã ãæ¡åŒµããå¿ èŠããããšããŸãã ããšãã°ãSMSãéä¿¡ããå Žåãè¿œå ã®ããŒãã£ã·ã§ã³ãäœæããããã«Kafkaã«æ瀺ã§ããŸããKafkaã¯2ã€ã®éšåã§ã¡ãã»ãŒãžã®ã¬ã€ã¢ãŠããéå§ããŸãã
Kafkaã¯ã©ã®ããã«ããããå ±æããŸããïŒ åã¡ãã»ãŒãžã«ã¯æ¬æïŒJSONãæ ŒçŽããïŒãšããŒããããŸãã ãã®ããŒã«ããã·ã¥é¢æ°ãæ·»ä»ããŠãã¡ãã»ãŒãžãã©ã®ããŒãã£ã·ã§ã³ã«åé¡ããããã決å®ã§ããŸãã
æãæ»ãã®å Žåãããã¯2ã€ã®ããŒãã£ã·ã§ã³ãåãå Žåã«éèŠã§ããã€ãŸãã䞊åã³ã³ã·ã¥ãŒããŒãæåã®ã€ãã³ããããæ©ã2çªç®ã®ã€ãã³ããåŠçãããã©ãã«ãçºçããå¯èœæ§ããããŸãã ããã·ã¥é¢æ°ã¯ãåãããŒãæã€ã¡ãã»ãŒãžãåãããŒãã£ã·ã§ã³ã«å ¥ãããã«ããŸãã
ã€ãã³ããšã³ãã³ã
ããã¯ãç§ãã¡ãééããå¥ã®åé¡ã§ãã ã€ãã³ãã¯ã€ãã³ãã§ããããšãã°ãã¢ã€ãã ããã£ã³ã»ã«ããããæãæ»ããçºçãããªã©ãã©ããã§äœããçºçããïŒsomething_happenedïŒãšèšããŸãã 誰ãããããã®ã€ãã³ãããªãã¹ã³ãããšãããã£ã³ã»ã«ãããã¢ã€ãã ãã«ãã£ãŠæãæ»ãã®æ¬è³ªãäœæããããæãæ»ããçºçããŸããããã»ããã¢ããã®ã©ããã«æžã蟌ãŸããŸãã
ããããéåžžãã€ãã³ããèšèšãããšããç¡é§ã«ã€ãã³ããæžãããã¯ãããŸãã-誰ãããããèªããšä»®å®ããŸãã èªæã¯ãsomething_happenedïŒitem_canceledãreé_refundedïŒãæžãããšã§ã¯ãªããsomething_should_be_doneãæžãããšã§ãã ããšãã°ãã¢ã€ãã ã¯è¿åå¯èœã§ãã
äžæ¹ã§ãããã¯ã€ãã³ããã©ã®ããã«äœ¿çšããããã瀺ããŸãã äžæ¹ãéåžžã®ã€ãã³ãåãšã¯ããŸã䌌ãŠããŸããã ããã«ãdo_somethingã³ãã³ãã¯ããããé ããããŸããã ãããã誰ãããã®ã€ãã³ããèªãã ãšããä¿èšŒã¯ãããŸããã ãããŠãããªããèªãã å Žåãæ£åžžã«èªãã§ãã ããã ãããŠãç§ããããéŠå°Ÿããèªãã ãªããç§ã¯äœããããŸããããããŠããã®äœãã¯ããŸããããŸããã ã€ãã³ããdo_somethingã«ãªã£ãç¬éããã£ãŒãããã¯ãå¿ èŠã«ãªããŸãããããã¯åé¡ã§ãã
RabbitMQã®éåæ亀æã§ã¯ãã¡ãã»ãŒãžãèªãã§HTTPã«ã¢ã¯ã»ã¹ãããšãå°ãªããšãã¡ãã»ãŒãžãåä¿¡ãããããšã瀺ãå¿çãè¿ãããŸãã Kafkaã«æçŽãæžãããšããKafkaã«æçŽãæžãããšããã¡ãã»ãŒãžããããŸããããã®åŠçæ¹æ³ã«ã€ããŠã¯äœãç¥ããŸããã
ãã®ããããã®å Žåãå¿çã€ãã³ããå°å ¥ããŠç£èŠãèšå®ããéåžžã«å€ãã®ã€ãã³ããçºçããå Žåããã®åŸãªã©ã«åãæ°ã®å¿çã€ãã³ããå°çããããã«ããå¿ èŠããããŸããã ãããèµ·ãããªãã£ãå ŽåãäœããããŸããããªãã£ãããã§ãã ããšãã°ãã€ãã³ããitem_ready_to_refundãããã£ã¹ãããããå Žåãæãæ»ããè¡ããããéãã¯ã©ã€ã¢ã³ãã«è¿ãããã€ãã³ããmoney_refundedããéä¿¡ãããããšãäºæ³ãããŸãã ããããããã¯æ£ç¢ºã§ã¯ãªããããç£èŠãå¿ èŠã§ãã
ãã¥ã¢ã³ã¹
ããªãæçœãªåé¡ããããŸãïŒãããã¯ããé çªã«èªãã§ãäœããã®ã¡ãã»ãŒãžãæªãå Žåãæ¶è²»è ã¯èœã¡ãŠãããªãã¯å»ããŸããã ãã¹ãŠã®ã³ã³ã·ã¥ãŒããåæ¢ã ãããã«ãªãã»ãããã³ãããããŠèªã¿ç¶ããå¿ èŠããããŸãã
ç§ãã¡ã¯ãããç¥ã£ãŠããŠãããã眮ããããããã§ãèµ·ãã£ãã ããã¯ãã€ãã³ããã€ãã³ããã¹ã®èŠ³ç¹ããæå¹ã§ãããã€ãã³ããã¢ããªã±ãŒã·ã§ã³ããªããŒã¿ã®èŠ³ç¹ããæå¹ã ã£ãããã«çºçããŸããããPostgreSQLã®èŠ³ç¹ããã¯æå¹ã§ã¯ãããŸããã§ãããã·ã¹ãã ã¯INTã®ã¿ãåããPostgreSQLã§ããã ãµã€ãºããããã«å°ãããIDã¯é©åããŸããã§ããã symfonyã¯äŸå€ã§æ»äº¡ããŸããã ãã¡ãããç§ãã¡ã¯ãããä¿¡ããŠãã®ãªãã»ãããã³ãããããããšããŠããã®ã§ãäŸå€ããã£ããããŸãããããã®åã«ãã¡ãã»ãŒãžãæ£åžžã«åŠçãããªãã£ããããåé¡ã«ãŠã³ã¿ãŒãã€ã³ã¯ãªã¡ã³ãããããšæããŸããã ãã®ãããžã§ã¯ãã®ã«ãŠã³ã¿ãŒãããŒã¿ããŒã¹ã«ãããSymfonyã¯ãã§ã«ããŒã¿ããŒã¹ãšã®éä¿¡ãéããŠããã2çªç®ã®äŸå€ã¯ãªãã»ãããã³ãããããæ©äŒãªãã«ããã»ã¹å šäœã匷å¶çµäºããŸããã
ãã°ããã®éããµãŒãã¹ã¯çµäºããŸãã-幞ããªããšã«ãKafkaã§ã¯ã¡ãã»ãŒãžãæ®ã£ãŠãããããããã»ã©æããããŸããã äœæ¥ã埩å ããããšãããããèªã¿åãããšãã§ããŸãã ããã¯äŸ¿å©ã§ãã
Kafkaã«ã¯ãããŒã«ã䜿çšããŠä»»æã®ãªãã»ãããèšå®ããæ©èœããããŸãã ãã ãããããè¡ãã«ã¯ããã¹ãŠã®ã³ã³ã·ã¥ãŒããŒãåæ¢ããå¿ èŠããããŸãããã®äŸã§ã¯ãã³ã³ã·ã¥ãŒããŒã®åãããã€ãè¡ããªãåå¥ã®ãªãªãŒã¹ãæºåããŸãã ãã®åŸãKafkaã¯ããŒãªã³ã°ã䜿çšããŠãªãã»ãããã·ããã§ããã¡ãã»ãŒãžã¯ééããŸãã
å¥ã®ãã¥ã¢ã³ã¹- ã¬ããªã±ãŒã·ã§ã³ãã°ãšrdkafka.so-ã¯ããããžã§ã¯ãã®è©³çŽ°ã«é¢é£ããŠããŸãã PHPããããŸããPHPã§ã¯ãååãšããŠããã¹ãŠã®ã©ã€ãã©ãªãrdkafka.soãªããžããªãä»ããŠKafkaãšéä¿¡ãããã®åŸäœããã®ã©ãããŒãä»å±ããŸãã ãããã¯ç§ãã¡ã®å人çãªåé¡ãããããŸãããããã§ã«èªãã ãã®ãèªã¿çŽãã ãã§ã¯ããã»ã©ç°¡åã§ã¯ãªãããšãããããŸããã äžè¬çã«ããœãããŠã§ã¢ã®åé¡ããããŸããã
ããŒãã£ã·ã§ã³ãæäœããæ©èœã«æ»ããšãããã¥ã¡ã³ãã§ã¯çŽæ¥ã consumer> = topic partitionsãšè¡šç€ºãããŸãã ããããç§ã¯ãããç§ãæãã§ããããããã£ãšé ããŠç¥ããŸããã ã¹ã±ãŒãªã³ã°ããŠ2ã€ã®ã³ã³ã·ã¥ãŒããŒã䜿çšããå Žåã¯ãå°ãªããšã2ã€ã®ããŒãã£ã·ã§ã³ãå¿ èŠã§ãã ã€ãŸãã2äžã®ã¡ãã»ãŒãžãèç©ãããããŒãã£ã·ã§ã³ã1ã€ãããæ°ããããŒãã£ã·ã§ã³ãäœæããå Žåãã¡ãã»ãŒãžã®æ°ã¯ããã«åçã«ãªããŸãã ãããã£ãŠã2ã€ã®äžŠåã³ã³ã·ã¥ãŒãã䜿çšããã«ã¯ãããŒãã£ã·ã§ã³ãåŠçããå¿ èŠããããŸãã
ã¢ãã¿ãªã³ã°
ç§ãã¡ããããç£èŠããæ¹æ³ã¯ãçŸåšã®ã¢ãããŒããã©ããªåé¡ãæ±ããŠããããããã«æ確ã«ããã ãããšæããŸãã
ããšãã°ãããŒã¿ããŒã¹å ã®ååã®ã¹ããŒã¿ã¹ãæè¿å€æŽããæ°ãèæ ®ããããã«å¿ããŠããããã®å€æŽã§ã€ãã³ããçºçããã¯ãã§ããããã®æ°ãç£èŠã·ã¹ãã ã«éä¿¡ããŸãã Kafka , . , .
, , , events-bus , . , Refund Tool , BOB - ( ).
consumer-group lag. , . , 0, . Kafka , .
Burrow , Kafka. API consumer-group , . Failed warning, , â , . , .
API. bob-live-fifa, partition refund.update.v1, , lag 0 â offset -.
updated_at SLA (stuck) . , , . Cron, , 5 refund ( ), - , . Cron, , 0, .
, , :
- ;
- ;
- .
, â API Kafka, .
-, HighLoad++ , , .
-, KnowledgeConf . , 26 , .
PHP Russia ++ ( DevOpsConf ) â , .