蚂蚁金服 SOFAMesh 在多语言上的探索实践

1. ᡶᡵᰂ๐62)$0HVKࣁग़᧍᥺ Ӥጱറᔱਫ᪢ ἎഇҁṼፗ҂ ᡶᡵᰂ๐ṛᕆದ๞ӫਹ̵62)$୏რᨮᨱՈ
2. Ŏ ग़᧍᥺ࣁᡶᡵᰂ๐ጱ‫઀ݎ‬ Ŏ ᡶᡵᰂ๐62)$0HVKՕᕨ Ŏ 62)$0HVKग़᧍᥺ොໜՕᕨ Ŏ አ62)$0HVKᥴ٬ग़᧍᥺ᳯ᷌ጱದ๞ᥝᅩ
3. ᡶᡵᰂ๐ग़᧍᥺‫઀ݎ‬ 62)$ங๐‫֛ۓ‬ᔮ 62)$‫૲ړ‬ୗԪ‫ۓ‬ 62)$ၾ௳Ӿᳵկ 62)$හഝᦢᳯդቘ KWWSJLWKXEFRPDOLSD\ ᡶᡵᰂ๐ള‫੶ف‬ SOFA App SOFA App SOFA App SOFA App SOFA App SOFA App SOFA App SOFA App SOFA App զ62)$ӾᳵկԅӾஞጱ-DYDದ๞֛ᔮ
4. ᡶᡵᰂ๐ग़᧍᥺‫઀ݎ‬ SOFA App SOFA App SOFA App SOFA App SOFA App SOFA App SOFA App SOFA App SOFA App Mobile BFF Web BFF ᡶᡵᰂ๐ള‫੶ف‬ Mobile App Web (JJ-6ҁ1RGH-6҂֢ԅ%))੶
5. ᡶᡵᰂ๐ग़᧍᥺‫઀ݎ‬ SOFA App SOFA App SOFA App SOFA App SOFA App SOFA App SOFA App Model Training Model Serving SOFA App Mobile BFF Web BFF SRE App SRE App SRE App ᡶᡵᰂ๐ള‫੶ف‬ Mobile App Ŏ &3\WKRQ֢ԅ $,ᶾऒጱᒫӞᭌೠ ᤩ୚‫ف‬ Web Ŏ य़ᰁ65(ፘ‫ى‬ᔮᕹ ᯻አ3\WKRQ๶຅ୌ
6. ग़᧍᥺‫઀ݎ‬ጱᳯ᷌ चᏐᦡෞ᯿॔ಭ‫ف‬ғ1RGH-6ᬯӞ੶ದ๞ᦡ ෞ᯿॔ಭ‫҅ف‬੕ᛘय़ᰁጱ᯿॔ጱၾᘙ̶ զ-DYDԅӾஞғ‫ۑ‬ᚆᇙ௔Ꮈ‫ݎ‬ஃஃӧտᘍ ᡤग़᧍᥺ጱ࣋ว҅य़ग़හӾᳵկ໛ຝզ -DYDԅӾஞ҅ᤩٌ՜᧍᥺ጱֵአവଠ຅ୌ ԧஉय़ጱॅ̶ࣵ
7. ग़᧍᥺‫઀ݎ‬ጱᳯ᷌ चᏐᦡෞ᯿॔ಭ‫ف‬ғ1RGH-6ᬯӞ੶ದ๞ᦡ ෞ᯿॔ಭ‫҅ف‬੕ᛘय़ᰁጱ᯿॔ጱၾᘙ̶ Ӟེਫሿ҅‫ݢ॒ک‬አ զ-DYDԅӾஞғ‫ۑ‬ᚆᇙ௔Ꮈ‫ݎ‬ஃஃӧտᘍ ᡤग़᧍᥺ጱ࣋ว҅य़ग़හӾᳵկ໛ຝզ -DYDԅӾஞ҅ᤩٌ՜᧍᥺ጱֵአവଠ຅ୌ ԧஉय़ጱॅ̶ࣵ ‫᥺᧍ᦤכ‬ጱӾᒈ௔
8. 6HUYLFH0HVK ࢶᇆ๶რғKWWSSKLOFDOFDGRFRPSDWWHUQBVHUYLFHBPHVKKWPO
9. 6HUYLFH0HVKਫᴬӤฎਖ਼ᗑᕶ᧣አು᨝‫ک‬चᏐᦡෞ੶
10. 62)$0HVKࣁग़᧍᥺ӥጱፓຽ Pod SOFA -DYD ᫷ᰁᕆ ਮಁᒒ SOFAMosn ଧ‫ڜ‬۸ ᴴၞ ᱾᪠᭄᪵ 0HWULFV Ӿᒈ௔ᗑᕶ᭗‫ᦓܐמ‬ Pod SOFAMosn EggJS(Node) ᫷ᰁᕆ ਮಁᒒ ᧍᥺Ӿᒈጱṛපጱ᭗‫ᦓܐמ‬ ᚆ‫ੱێ‬ᰁஃ0HVKӾဃႚ Control Plane ๐‫ݎۓ‬ሿ ᴴၞᆤෙ ᴳᕆ ᨮ᫹࣐ᤍ ᠗ᖖᅍଶ ᱾᪠᭄᪵ ๐‫ۓ‬ᰄ๦ ᱾᪠‫ੂے‬ ਮಁᒒੱᰁ‫כ‬೮᫷ᰁ۸
11. 62)$0HVK ᪙ᵋᐒ‫܄‬ Ŏ IRUNᛔ,VWLR Ŏ ᔲ᪙,VWLRጱ๋ෛᇇ๜ Ŏ ୏რ҅‫߿ݍ‬Ӥ჋ ਫ᪢༄ḵ Ŏ ࣁਫᴬኞԾ៧ࣈӾ҅‫ݎ‬ሿᳯ᷌҅ᥴ٬ᳯ᷌ Ŏ ࣁᥴ٬ᳯ᷌ጱᬦᑕӾ҅੔࿢‫ڠ‬ෛ Ŏ ಘ઀,VWLR҅ୠᤑٌӧ᪃ጱࣈො
12. 62)$0HVKᥴ٬ग़᧍᥺ᳯ᷌Ӿጱ ದ๞ᥝᅩ
13. ᭗‫ᦓܐמ‬ғᗑᕶ᧣አӾጱᅎṯ҅ᵱᥝ‫כ‬೮ᜉঅጱ ᧍᥺Ӿᒈ௔޾ಘ઀௔
14. ᭗‫ᦇᦡᦓܐמ‬ 62)$53&෱๗ጱ‫ᦇᦡᦓܐ‬ғ ‫ᦓܐ‬१‫௳מ‬ ӱ‫ۓ‬ള‫݇ݗ‬හҁ+HVVLDQଧ‫ڜ‬۸҂ 62)$53&5HTXHVW੒᨝ҁ+HVVLDQଧ‫ڜ‬۸҂ Ŏ ଧ‫ڜ‬۸‫ᦓܐ‬ӧ᭗አ҅᯻አԧ+HVVLDQ ֢ԅଧ‫ڜ‬۸‫̶ᦓܐ‬ Ŏ ‫ز‬හഝ޾ӱ‫݇ۓ‬හ੗ᤰࣁӞ᩸҅ᥴ‫ڊ‬ ‫ز‬හഝᵱᥝਖ਼ӱ‫݇ۓ‬හӞ᩸ᥴ‫҅ڊ‬੒ ԭ6LGHFDUጱၾᘙ᫾ṛ̶ Ŏ ‫ᦓܐ‬ಘ઀௔૧҅ᥝಘ઀ӞԶਁྦྷ҅‫ݝ‬ ᚆਖ਼੒᨝න‫ک‬62)$53&ጱ5HTXHVW ੒᨝Ӿ
15. ᭗‫ᦇᦡᦓܐמ‬ 'XEER‫ᦇᦡᦓܐ‬ғ ‫ᦓܐ‬ᇇ๜ҁ+HVVLDQଧ‫ڜ‬۸҂ ӱ‫ۓ‬ള‫݇ݗ‬හҁ+HVVLDQଧ‫ڜ‬۸҂ ‫௳מز‬ҁ+HVVLDQଧ‫ڜ‬۸҂ Ŏ ‫௳מز‬ฎӞᒵ‫࿆ل‬ғ6LGHFDU឴‫زݐ‬ හഝ‫ݝ‬ᵱᥝ಩+HDGHUVᥴ‫ڊ‬๶੪‫ݢ‬ զ҅ӧአᥴӱ‫ۓ‬ള‫݇ݗ‬හ̶ Ŏ +HVVLDQฎ᩻Ӟᒵ‫࿆ل‬ғ՗ᇇ๜‫زک‬ ‫௳מ‬᮷஠ᶳׁᩢ+HVVLDQ҅ग़᧍᥺ਮ ಁᒒ޾6LGFDUਫሿ᫾ԅἋᅸ Ŏ ‫ᦓܐ‬ಘ઀௔૧ғ‫௳מز‬ᵱᥝ+HVVLDQ ଧ‫ڜ‬۸
16. ᭗‫ᦇᦡᦓܐמ‬ 62)$53&%ROW‫ᦇᦡᦓܐ‬ғ ‫ᦓܐ‬१‫௳מ‬ ӱ‫ۓ‬ള‫݇ݗ‬හҁ+HVVLDQଧ‫ڜ‬۸҂ +HDGHUVҁӞӻᓌ‫ܔ‬ጱ0DSᕮ຅҂ অ॒ Ŏ ‫ز‬හഝฎӞᒵ‫࿆ل‬ғ6LGHFDU឴‫زݐ‬ හഝ‫ݝ‬ᵱᥝ಩+HDGHUVᥴ‫ڊ‬๶੪‫ݢ‬ զ҅ӧአᥴӱ‫ۓ‬ള‫݇ݗ‬හ̶ Ŏ ‫ز‬හഝଧ‫ڜ‬۸୵ୗᓌ‫ܔ‬ғ‫ز‬හഝፗള ᯻አᓌ‫ܔ‬ጱ0DSᕮ຅؉ଧ‫ڜ‬۸҅ᶋ ଉᓌ‫҅ܔ‬6LGHFDU޾ग़᧍᥺ਮಁᒒ᮷ ‫ݢ‬զ᫷ຂਫሿ҅ಘ઀ᓌ‫̶ܔ‬
17. ଧ‫ڜ‬۸‫ᦓܐ‬ C++/Python Sidecar Bolt + Protobuf SOFA(Java) Bolt + Hessian SOFA(Java) <sofa:service> <sofa:binding.bolt> <sofa:global-attrs serialize-type="pb"/> </sofa:binging.bolt> </sofa:service> Hessian ጱᳯ᷌ғ • ग़᧍᥺ඪ೮᫾੝ • ᮱‫ړ‬ᇙ௔᧍᥺ᕬਧ • ‫پ‬ԒဌํՈᖌಷԧ
18. ๐‫ݎۓ‬ሿ ๐‫ݎۓ‬ሿฎ‫૲ړ‬ୗ53&ጱ๋च๜ᚆ‫ੱ҅ێ‬ᰁ‫޾ᦤכ‬ ᧍᥺෫‫ى‬
19. ๐‫ݎۓ‬ሿཛྷࣳ62)$53&YV6HUYLFH0HVK Client ‫ݎ‬᩸᧣አ ೲᆙള‫ݗ‬ᕋଶᦈᴅ๐‫௳מۓ‬ SOFARegistry ‫ܔ‬ӻ$SSग़ӻ๐‫ۓ‬ጱཛྷࣳ Server Service A Service B Service C ೲᆙള‫ݗ‬ᕋଶਖ਼๐‫ک૲ݎ௳מۓ‬๐‫ဳۓ‬ٙӾஞӤ 62)$53&๐‫ݎۓ‬ሿཛྷࣳ ,VWLR๐‫ݎۓ‬ሿཛྷࣳ
20. ๐‫ݎۓ‬ሿᄍᬰොໜӞ Pod Application Get Service Actuator Sidecar ೲᆙ๐‫ڜۓ‬ᤒႲ‫ے‬๐‫ᦕۓ‬୯ DNS ᦕ୯ Pod Application Sidecar com.alipay.sample.SampleService —> 10.15.233.53 com.alipay.sample.HelloService —> 10.15.233.53 com.alipay.sample.EchoService —> 10.15.233.53 ׁᩢԭ$SS൉‫׀‬ጱ$FWXDWRUጱᚆ‫҅ێ‬ଚӧฎಅํጱ$SS᮷ํᬯӻᚆ‫ێ‬ '16ਂࣁ77/҅๐‫ݎۓ‬ሿ‫ݢ‬ᚆଚဌํ݊෸̶
21. ๐‫ݎۓ‬ሿᄍᬰොໜԫ Pod SOFAҁ-DYD҂ᔮᕹ Ԇۖ‫ᦫޞ‬6LGHFDUᵱᥝ‫ݎ‬ሿጱ๐‫ ۓ‬HTTP դቘܻํဳٙӾஞጱ᭗‫מ‬ Sidecar gRPC Pilot SOFARegistry ZooKeeper K8s Service Pod Python/C++ ᔮᕹ Ԇۖ‫ᦫޞ‬6LGHFDUᵱᥝ‫૲ݎ‬ጱ๐‫ ۓ‬HTTP gRPC Sidecar ํӞਧጱ‫ࣳف׍‬ғᵱᥝਫሿӞӻ᫷ᰁᕆ ጱਮಁᒒ҅ਖ਼๐‫ۓ‬᭗ᬦᓌ‫ܔ‬ጱොୗဳٙ‫ک‬ 6LGHFDUӤᶎ̶
22. ᫷ᰁᕆਮಁᒒ ୮6HUYLFH0HVK෫ဩਠ‫ق‬ᥴ٬ᳯ᷌ጱ෸‫҅ײ‬੪൥Ӟ ӻ᫷ᰁᕆ҅᪃ड़ᓌ‫ܔ‬ጱਮಁᒒ‫̶މ‬
23. 62)$53&Ӿզဳᥴḝۖጱ‫زܔ‬۸ጱ᪠ኧොୗ
24. ᶎ‫ݻ‬ग़᧍᥺ጱ‫زܔ‬۸᪠ኧොୗ चԭ Velocity ጱᛔਧԎ᪠ኧ ᥢ‫ڞ‬ ग़᧍᥺ᘉᦲ୚ක -DYDᇇ Java App Pod UserId SOFAMosn 1RGHᇇ Node App *RODQJ ᇇ Go App Pod UserId SOFAMosn Ŏ ᭗ᬦӞӻ᧍᥺Ӿᒈጱᚕ๜ ኞ౮ग़᧍᥺ጱ᪠ኧᥢ‫̶ڞ‬ Ŏ ᚕ๜ጱಗᤈӤӥ෈Ӹ໒ഴ ‫҅ګ‬փ‫ف‬஠ᥝጱ݇හ҅൉ ‫׀‬஠ᥝጱૡٍᔄ̶ 3\WKRQ ᇇ๜ Py App
25. ‫૲ړ‬ୗ᱾᪠᭄᪵ Pod Java App SOFAMosn Pod SOFAMosn Python App Tracing Client Tracing Filter Tracing Reporter Tracing Reporter Tracing Filter Tracing Client Mixer ‫ํֵܨ‬62)$0HVKጱਂࣁׁ҅෯ᵱᥝ‫ݱ‬ӻ᧍᥺ጱ‫૲ړ‬ୗ᱾᪠᭄᪵ጱਮಁᒒ
26. ‫૲ړ‬ୗ᱾᪠᭄᪵ ୮6LGHFDU֢ԅ'RZQVWUHDPጱ෸‫ᧇ҅ײ‬ᕡ ጱ7UDFLQJጱහഝ‫ݢ‬զ᭗ᬦ᭗‫ᦓܐמ‬൭ଃࢧ ๶ SOFAMosn ᧇᕡጱ Tracing ጱ Tag 3\WKRQ$SS ෫ဩ឴‫ᧇݐ‬ᕡጱ7UDFLQJ7DJ 3\WKRQ$SS SOFAMosn ୮6LGHFDU֢ԅ8SVWUHDPጱ෸‫᧗҅ײ‬࿢ࢧ ‫ک‬ਮಁᒒԏ‫ݸ‬ጱ7DJ෫ဩ឴‫҅کݐ‬தዳ‫ۆ‬ᆽ
27. ੜᕮ Ŏ ؉অग़᧍᥺҅‫ى‬Ძฎ‫כ‬೮᧍᥺Ӿᒈ҅‫ᦤכ‬Ӟེᖫٟ҅‫॒ک‬ ‫ݢ‬አ Ŏ ຝ຅உᗦঅ҅ሿਫஉṋఽ҅៧ࣈᵱᥝ؉অগ‫̶॓ٵܐ‬ Ŏ 6HUYLFH0HVKӧฎᱷ୨҅஠ᥝጱ෸‫ײ‬᯻አ᫷ᰁᕆਮಁᒒ ֢ԅᬀ̶ۗ
28. ୏რ Ŏ 62)$0RVQKWWSVJLWKXEFRPDOLSD\ VRIDPRVQ Ŏ 62)$0HVKKWWSVJLWKXEFRPDOLSD\ VRIDPHVK Ŏ ٌ՜62)$ᶱፓғKWWSVJLWKXEFRP DOLSD\ ‫ل‬ռ‫ݩ‬ғᰂᣟᕆ‫૲ړ‬ୗຝ຅ ӻՈங‫מ‬ғkhotyn