微服务架构实践

微服务架构实践
1.初探微服务架构
2.深入微服务架构
3.微服务架构在电商大促活动中的实践
4.下一代微服务架构service mesh

展开查看详情

1.ங๐‫ۓ‬ຝ຅ਫ᪢ ๷ᰭ࿆ ࠔߝտմӱଫአຝ຅᮱ຝ຅૵ 1

2. ᛔ౯Օᕨ • 8ଙຝ຅݊ದ๞ࢫᴚᓕቘᕪḵ҅ሿձࠔ ߝտմӱ/ଫአຝ຅᮱ຝ຅૵҅ᨮᨱᬩ ០ଘ‫̵ݣ‬ኪࠟଘ‫ݣ‬໐ஞԻฃຝ຅ᥢ ‫“̵ښ‬419ߝᇈᇙ‫”ᜓܕ‬य़‫“̵׏‬616ଙӾ ᇙ‫”ܕ‬य़‫׏‬ᒵຝ຅Ҕ • ܲձᨬᘱದ๞௛ፊ҅ᗑฃṛᕆૡᑕ ૵Ҕ • ࢵٖᶮᕆದ๞य़տArchSummit ‫ق‬ቖຝ ຅૵શտᦖ૵̵ᗑฃԯฃᕪ૲᭲ᦖ ૵̶ 2

3.ፓ୯ N 初探微服务架构 N 深s微服务架构 N 微服务架构在电商大o活动W的实践 N T一b微服务架构4ervice /eHh 3

4.‫ڡ‬റங๐‫ۓ‬ຝ຅ 4

5.ங๐‫ ۓ‬VS ‫֛ܔ‬ଫአ ౮๜ ‫֛ܔ‬ଫአ ங๐‫ۓ‬ x ᥢཛྷ • ‫֛ܔ‬ଫአ҅Ӟ୏ত҅ದ๞ᵙଶ̵֗౮๜֗҅‫ݢ‬զள᭛ඪඅ‫҅઀ݎ‬ᘒங๐‫ۓ‬Ӟ୏তኧԭದ๞ᵙଶय़҅౮๜ፘ੒տ ṛ • ᵋ፳ଫአᥢཛྷ‫҅઀ݎ‬ፘଫጱ౮๜᭑Ⴙ൉ṛ҅୮ᬡ‫ک‬xԻ݉ᅩ҅‫֛ܔ‬ଫአጱ౮๜᩼๶᩼ṛԭங๐‫҅ۓ‬ᘒங๐‫ۓ‬ጱ ս۠᭑Ⴙดሿ҅౮๜᭑Ⴙᖌ೮ᑞਧ • ୮Ӟ୏তᭌೠጱฎ‫֛ܔ‬ଫአຝ຅҅୮ᥢཛྷಘୟ‫ک‬Xᅩ෸҅੪‫ݢ‬զᘍᡤᄍᬰ‫ک‬ங๐‫ۓ‬ຝ຅҅ᘒইຎӞ୏ত੪ᭌೠ ԧங๐‫ۓ‬ຝ຅҅‫ڞ‬ᥝಥ೅‫ڡ‬তጱṛ౮๜զ݊ದ๞ᵙଶ҅֕‫ݸ‬๗ጱ౮๜տ᩼๶᩼֗҅ս۠տ᩼๶᩼ดሿ 5

6.Ջԍฎங๐‫ۓ‬ ᇿᒈ! ᇿᒈ! ᛔလ! ᮱ᗟ! ᬰᑕ! ‫!૲ݎ‬ • ங๐‫ۓ‬ฎӞԶ‫ݶܐ‬ૡ֢ጱੜᘒᛔလጱ๐‫ۓ‬ • ྯӻ๐‫ݎ୏ۓ‬౮‫ܔ‬Ӟଫአጱ୵ୗ҅ྯӻଫአᬩᤈࣁ‫ܔ‬ӞጱᬰᑕӾ • ֵአᛔۖ۸᮱ᗟૡٍᬰᤈᇿᒈ‫૲ݎ‬ • ྯӻ๐‫ݢۓ‬զֵአӧ‫ݶ‬ጱ୏‫᥺᧍ݎ‬զ݊ӧ‫ݶ‬හഝਂ‫ؙ‬ದ๞ 6

7.ங๐‫ۓ‬ຝ຅ቘᦞचᏐ—଼শਧ஌ ଼শਧ஌ғᕟᕢຝ຅ᒵ‫ݶ‬ᔮᕹຝ຅ ᒫӞਧ஌ғᕟᕢဋ᭗ොୗ٬ਧᔮᕹᦡᦇ ᒫԫਧ஌ғ෸ᳵٚग़ӞկԪఘԞӧ‫ݢ‬ᚆ ؉ጱਠᗦ҅֕௛ํ෸ᳵ؉ਠӞկԪఘ ᒫӣਧ஌ғᕚࣳᔮᕹ޾ᕚࣳᕟᕢຝ຅ᳵ ํᄟࣁጱ୑ᨶ‫ݶ‬ாᇙ௔ ᒫࢥਧ஌ғय़ጱᔮᕹᕟᕢ௛ฎྲੜᔮᕹ ๅ‫ݻ؁‬ԭ‫ړ‬ᥴ 7

8.ங๐‫ۓ‬ᇙ௔ ‫֛ܔ‬ᔮᕹ ங๐‫ۓ‬ • ᕟկӨ๐‫ۓ‬ • ࢱᕰӱ‫ۑۓ‬ᚆᬰᤈᕟᕢ • ‫ړ‬වလቘ • ‫ړ‬වහഝᓕቘ • चᏐᦡෞᛔۖ۸ 8

9.ங๐‫ۓ‬ᇙ௔—ࢱᕰӱ‫ۑۓ‬ᚆᬰᤈᕟᕢ ‫֛ܔ‬ଫአ ‫ڹ‬ᒒ ‫ݸ‬ᒒ ᬩᖌ ங๐‫ۓ‬ 9

10.ங๐‫ۓ‬ᇙ௔—‫ړ‬වහഝᓕቘ ங๐‫ۓ‬ ‫֛ܔ‬ଫአ 10

11. ԅՋԍ୚‫ف‬ங๐‫ۓ‬ ӱ‫ۓ‬ᥴᘠ ದ๞୑຅ ᇿᒈᖌಷ ᇿᒈ᮱ᗟ ᇿᒈಘ઀ ൉‫܋‬Ꮈ‫ݎ‬පሲ ํපᵍᐶඳᵑ ೲᆙӱ‫ۓ‬ᬟኴ ӧ‫ݶ‬ጱࢫᴚᖌ ӧ‫ݶ‬ጱࢫᴚᖌ ྯӻ๐‫ݢۓ‬զ ‫ݢ‬զ໑ഝӱ‫ۓ‬ ‫ݢ‬զਫሿଚᤈ ྯӻ๐‫ۓ‬ᇿᒈ ೆ‫ړ‬ԅग़ӻᇿ ಷӧ‫ݶ‬ጱ๐ ಷӧ‫ݶ‬ጱ๐‫ۓ‬ ᇿᒈ᮱ᗟ҅԰ ጱᥢཛྷ‫ݳ‬ቘᥢ Ꮈ‫ེྯ҅ݎ‬ෛ ᮱ᗟ̵ᇿᒈᬩ ᒈጱ๐‫҅ۓ‬ᥴ ‫ݢ҅ۓ‬զᰒ੒ ᕟկ҅ྯӻࢫ ӧ୽ߥ҅‫ݢ‬զ ‫ښ‬๐‫ۓ‬ጱ᮱ᗟ ᶱፓᎸ‫҅ݎ‬᮷ ᖌ҅୮᮱‫ړ‬๐ ٬ԧӱ‫॔ۓ‬๥ ӧ‫ݶ‬ጱӱ‫ۓ‬᯻ ᴚ‫ݢ‬զ‫ڦړ‬ᥢ ਫሿᇿᒈ಑ ᥢཛྷ҅ইຎӱ ‫ݢ‬զೲᆙӱ‫ۓ‬ ‫ڊۓ‬ሿඳᵑԏ ௔ᳯ᷌҅ਫሿ አӧ‫ݶ‬ጱದ๞ ‫ښ‬ᛔ૩ጱ๐ ۱̵ᇿᒈၥ ‫ۓ‬ᰁय़҅‫ڞ‬᮱ ‫҅ړښ‬ӧ‫ݶ‬ጱ ‫ݢ҅ݸ‬զਖ਼ඳ ӱ‫ۓ‬ᥴᘠ҅ӱ ໛ຝ҅ํᰒ੒ ‫҅ۓ‬ፘ԰ԏᳵ ᦶ̵ᇿᒈ᮱ ᗟጱ๐‫࢏ۓ‬ᥢ ӱ‫ۑۓ‬ᚆ‫ڦړ‬ ᵑํපᵍᐶ҅ ‫ٖۓ‬᮱ṛٖ ௔ጱᥴ٬௔ᚆ ԰ӧ୽ߥ҅ྯ ᗟ҅‫ٺ‬੝᮱ᗟ ཛྷय़҅ইຎӱ ᤩೆᥴ‫ک‬ӧ‫ݶ‬ ᘒӧ୽ߥٌ՜ ᘸ҅ӱ‫ۓ‬ԏᳵ ኒ᷀҅‫ݶ‬෸‫ݢ‬ ӻࢫᴚᘸᆌᛔ ෸ᳵ҅൉‫܋‬᮱ ‫ۓ‬ᰁੜ҅‫ݢڞ‬ ጱࢫᴚ҅ӧ‫ݶ‬ ๐‫ۓ‬ጱᑞਧ ຂᘠ‫ྯ҅ݳ‬ӻ զᭌೠ‫ݳ‬ᭇጱ ૩ᨮᨱጱ๐‫ۓ‬ ᗟ᭛ଶ๋҅ᕣ զ੝᮱ᗟ‫ݣپ‬ ጱࢫᴚ‫ᦡڦړ‬ ௔҅ํපᵍᐶ ๐‫ۓ‬ᬟኴႴ ෛದ๞ᥴ٬᭬ ൉‫܋‬Ꮈ‫ݎ‬පሲ ๐‫࢏ۓ‬ ᦇᛔ૩ጱ๐ ඳᵑጱ᝜ࢱ҅ ศ҅‫ݶ‬෸‫ܔ‬ӻ ‫ک‬ጱෛದ๞ᵙ ‫҅ۓ‬ᖽᎨ๐‫ۓ‬ ‫כ‬ᵑᔮᕹෆ֛ ๐‫ۓ‬ጱդᎱᰁ ᷌ Ի՞෸ᳵ҅൉ ጱᑞਧ௔ ๅ੝̵ๅ‫ے‬ฃ ‫܋‬๐‫ۓ‬Ի՞ප ᖌಷ ሲ 11

12.ই֜຅ୌங๐‫ۓ‬ຝ຅ N 如何定义服务 N 如何发布和订阅服务 N 如何治理服务 N 如何监控服务 N 如何定h故障 N ...... 12

13.ங๐‫ۓ‬ຝ຅ • Ӟӻᓌ‫ܔ‬ጱங๐‫ۓ‬ຝ຅۱‫ތ‬ங๐‫ۓ‬ Registry! ਮಁᒒ̵ங๐‫ۓ‬๐‫ۓ‬ᒒ̵ဳٙӾ ஞ̵ፊഴӾஞ ᦈᴅ ဳٙ ๐ • Serviceࣁ‫ۖސ‬෸҅ਖ਼ᛔ૩൉‫׀‬ጱ๐ ‫ۓ‬ ‫ဳۓ‬ٙ‫ဳک‬ٙӾஞ လ ᧣አ ቘ! • Clientࣁ‫ۖސ‬෸҅՗ဳٙӾஞᦈᴅᛔ Client! Service! Ӿ ૩ᵱᥝጱ๐‫ۓ‬ ஞ! • Clientᦈᴅ๐‫ۓ‬ԏ‫᧣҅ݸ‬አService ๐‫ۓ‬ Ӥಸ෭ப Ӥಸ෭ப • Client޾Serviceਖ਼෭பӤಸ‫ک‬ Monitor! Monitor • ๐‫ۓ‬လቘӾஞਫሿᓕቘᴳᕆ̵ᴴ ၞ̵๐‫ۓ‬᪠ኧ̵๐‫ۓ‬ᨮ᫹࣐ᤍᒵ 13

14.๐‫ۓ‬ൈᬿ XMLᯈᗝ XMLᯈᗝ‫ݢ‬զአԭdubbo໛ຝ̵Spring Cloud໛ຝ ᒵ <beans> <dubbo:application name="demo-provider"/> <dubbo:registry address="zookeeper://127.0.0.1:2181"/> <dubbo:protocol name="dubbo" port="20890"/> <bean id="demoService" class="org.apache.dubbo.samples.basic.impl.DemoServiceImpl"/> <dubbo:service interface="org.apache.dubbo.samples.basic.api.DemoService" ref="demoService"/> </beans> IDL @idl @namespace(“com.hello.world”) Public class HelloWorldIDL{ IDL᭗ଉአԭThrift̵gRPC᪜᧍᥺᧣አ໛ຝ @service(version=“1.0.0”) interface HelloWorld{ String sayHello(String helloMsg) } } 14

15.๐‫ۓ‬໛ຝ N 服务通p协议OH552、5C2、U(2等P N 数据f输方式O同步、异步P N 数据序列化OJ41N序列化、2B序列化等P 15

16.๐‫૲ݎۓ‬/ᦈᴅ • Service‫ۖސ‬෸ਖ਼๐‫ဳۓ‬ٙ‫ک‬ Registry҅‫ݶ‬෸ᖌ೮ӨRegistryጱஞ Registry! ᪡ਧ๗࿤ಸਂၚᇫா • Clientࣁ‫ۖސ‬෸՗ဳٙӾஞᦈᴅᵱᥝ ᦈᴅ/‫ݒ‬ๅ᭗Ꭳ ဳٙ/ஞ᪡ ጱ๐‫҅ۓ‬୮๐‫ۖݒํۓ‬෸҅ Registryտ݊෸᭗ᎣClient೉‫๋ݐ‬ෛ ጱ๐‫ڜۓ‬ᤒ҅ๅෛ๜ࣈ๐‫ڜۓ‬ᤒ ᧣አ Client! Service! • Clientտਖ਼឴‫ݐ‬ጱ๐‫ڜۓ‬ᤒᖨਂࣁ๜ ࣈ҅୮ClientӨRegistryԏᳵጱᗑᕶ ‫ڊ‬ሿᳯ᷌෸҅Ԟӧ୽ߥClientӨ Serviceጱ᧣አ • Registry൉‫׀‬๐‫ဳۓ‬̵ٙ‫ဳݍ‬̵ٙ ஞ᪡࿤ಸ̵ᦈᴅ̵‫ݒ‬ๅັᧃᒵള‫ݗ‬ 16

17.๐‫ۓ‬᪠ኧ # app1ጱၾᩇᘏ‫ݝ‬ᚆᦢᳯಅํᒒ‫ݗ‬ԅ20880ጱ๐‫ۓ‬ਫֺ # app2ጱၾᩇᘏ‫ݝ‬ᚆᦢᳯಅํᒒ‫ݗ‬ԅ20881ጱ๐‫ۓ‬ਫֺ --- N 灰度发布 scope: application force: true runtime: true enabled: true N A/B测试 key: governance-conditionrouter-consumer conditions: - application=app1 => address=*:20880 - application=app2 => address=*:20881 N 流量控制 # DemoServiceጱsayHelloොဩ‫ݝ‬ᚆᦢᳯಅํᒒ‫ݗ‬ԅ20880ጱ๐ ‫ۓ‬ਫֺ N 机房选择 # DemoServiceጱsayHiොဩ‫ݝ‬ᚆᦢᳯಅํᒒ‫ݗ‬ԅ20881ጱ๐‫ۓ‬ ਫֺ --- scope: service N ...... force: true runtime: true enabled: true key: org.apache.dubbo.samples.governance.api.DemoService conditions: - method=sayHello => address=*:20880 - method=sayHi => address=*:20881 17

18.๐‫ۓ‬ᨮ᫹࣐ᤍ ᵋ๢ᓒဩ ᫪ᧃᓒဩ ๋੝ၚ᪋᧣አහᓒဩ Ӟᛘ௔hashᓒဩ ܻቘғ՗๐‫ڜۓ‬ᤒӾ҅ ܻቘғ՗๐‫ڜۓ‬ᤒӾ҅ ܻቘғ՗๐‫ڜۓ‬ᤒӾ҅ ܻቘғ᭗ᬦߢ૶‫ڍ‬හ҅ ᵋ๢ᭌೠӞӻ๐‫ۓ‬ਫֺ ׁེ᫪ᧃ҅ᭌೠ‫ڊ‬Ӟӻ ᭌೠၚ᪋ᬳളහ๋੝ጱ ‫ݢ‬զਖ਼๶ᛔ‫ݶ‬Ӟ᧣አො ᬰᤈ᧣አ̶Ӟᛱฎ໑ഝ ๐‫ۓ‬ਫֺᬰᤈ᧣አ̶Ӟ ๐‫ۓ‬ਫֺᬰᤈ᧣አ҅ྯ ጱਮಁᒒ᧗࿢҅ྯེ᮷ ๐‫ڜۓ‬ᤒහ҅ྲইํ8 ᛱฎֵአහᕟ҅ྲইํ ӻ๐‫ۓ‬ਫֺ‫ڠ‬ୌӞӻᬳ ᧗࿢‫ک‬ፘ‫ݶ‬ጱ๐‫ۓ‬ਫֺ ӻ๐‫҅ۓ‬ᵋ๢ኞ౮1~8 8‫ݣ‬๐‫ۓ‬ਫֺ҅ਧԎӞ ള҅ၚ᪋ᬳളහ‫ے‬1, ԏᳵጱӞӻᵋ๢හ҅ᵋ ӻහᕟ҅۱‫ތ‬1~8හ ๢හฎ‫҅پ‬੪᧣አߺӻ ਁ҅Ӟེ᫪ᧃහᕟ‫ݢܨ‬ ๐‫ۓ‬ਫֺ ࣋วғԆᥝᭇአԭ๐‫ۓ‬ ࣋วғԞฎԆᥝᭇአԭ ࣋วғ୮๐‫ۓ‬ਫֺಅࣁ ࣋วғᭇአԭᔄ֒๐‫ۓ‬ ਫֺಅࣁ๢࢏ᯈᗝ૧୑ ๐‫ۓ‬ਫֺಅࣁ๢࢏ᯈᗝ ๢࢏௔ᚆ૧୑ྲ᫾य़ ᒒᖨਂԧਮಁᒒ᧗࿢හ ӧय़҅௔ᚆच๜ፘ‫ݶ‬ጱ ૧୑ӧय़҅௔ᚆच๜ፘ ෸҅᯻አ๋੝ၚ᪋᧣አ ഝጱ࣋ว҅ྯེ᮷᧗࿢ ࣋ว ‫ݶ‬ጱ࣋ว හᓒဩ҅‫ݢ‬զ឴‫ݐ‬ๅள ፘ‫ݶ‬๐‫ۓ‬ਫֺ҅‫ݢ‬զ‫כ‬ ጱߥଫ ᵑੱ‫ݢ‬ᚆग़ጱ឴‫ݐ‬ᖨਂ 18

19.๐‫ۓ‬᩻෸/᯿ᦶ ๐‫ۓ‬᩻෸ ๐‫ۓ‬᯿ᦶ ๐‫ۓ‬᩻෸෸ᳵᦡਧ҅ᵱᥝᭌೠӞӻ ‫ݎ؍‬ጱ๐‫᧣ۓ‬አ०ᨳӞᛱฎኧԭӻ ‫ݳ‬ቘጱ᩻෸෸ᳵ҅᩻෸෸ᳵᦡᗝጱ ‫ڦ‬๐‫ۓ‬ਫֺጱᗑᕶӧᑞਧ੕ᛘ०ᨳ ᬦᳩ౲ᘏᬦᎨ᮷ӧ‫ݢ‬ᤈ҅‫ݢ‬զ᭗ᬦ ౲ᘏ᩻෸ᒵ҅ࢩྌᴻԧᰒ੒๐‫ᦡۓ‬ ‫ړ‬ຉ᧣አ෭ப҅ᕹᦇ‫ڊ‬99.99%̵ ᗝ᩻෸෸ᳵԏक़҅ᬮտᦡᗝ᯿ᦶེ 99.9%̵99%ᒵӧ‫ݶ‬ᖌଶጱ๐‫᧣ۓ‬ හ҅᭗ᬦ᯿ᦶ҅ਖ਼᧗࿢‫ݎ‬ᭆ‫ٌک‬՜ አ෸ᳵ॒ԭग़੝෸ᳵզٖ҅ᆐ‫ݸ‬ٚ ๐‫ۓ‬ਫֺ҅‫ݢ‬զी‫ے‬አಁ᧗࿢౮‫ۑ‬ ໑ഝӱ‫ۓ‬ᵱ࿢҅ਧ‫ڊ‬Ӟӻ‫ݳ‬ቘጱ๐ ሲ ‫ۓ‬᩻෸෸ᳵ 19

20.๐‫ۓ‬ᆤෙ • ๐‫ۓ‬ᆤෙᇫாӞᛱ‫ړ‬ԅӣᐿ҅closedᇫா̵ openᇫா̵Half-Openᇫா close d • ᆤෙ࢏ἕᦊ॒ԭclosedᇫா‫ىܨ‬ᳮ ᧣አ०ᨳሲ ᧣አ • ୮Ӟਧ෸ᳵٖጱ०ᨳሲ᩻ᬦ೰ਧᴇ꧊҅ᆤෙ ౮‫ۑ‬ሲᬡຽ ᩻ᬦᴇ꧊ ࢏՗closedᇫாᬰ‫ف‬openᇫா҅ྌ෸ਮಁᒒ ‫ݎ‬᩸ጱ๐‫᧣ۓ‬አտፗളᬬࢧ҅ӧտٚ‫ݻ‬๐‫ۓ‬ ᒒ᧗࿢ • ୮ᆤෙ࢏ᆤෙӞྦྷ෸ᳵԏ‫ݸ‬ҁ‫ݢ‬զᦡᗝ҂҅ ᆤෙӞྦྷ෸ᳵ Half- ྌ෸տᬰ‫ف‬Half-openᇫா҅๐‫ۓ‬ᒒտ੒क़൉ open Open ‫ํ׀‬ᴴጱ๐‫᧣ۓ‬አ҅ইຎ᧣አ౮‫ۑ‬ሲᖀᖅӧ ᬡຽ҅‫ڞ‬՗Half-Openᇫா݈᫨ԅopenᇫ ᧣አ౮‫ۑ‬ሲӧᬡຽ ா҅ইຎ᧣አ౮‫ۑ‬ሲᬡຽ҅‫ڞ‬՗Half-Openᇫ ா᫨ԅclosedᇫா҅๐‫ۓ‬ᒒྋଉ੒क़൉‫׀‬๐ ‫᧣ۓ‬አ 20

21. ๐‫ۓ‬ᵞᗭ਻Კ • Failover҅०ᨳᛔۖ‫ڔ‬ഘ҅୮‫ڊ‬ሿ०ᨳ҅᯿ᦶٌ՜ զDubboԅֺ ๐‫࢏ۓ‬ • Failfast҅ள᭛०ᨳ҅‫ݎݝ‬᩸Ӟེ᧣አ҅०ᨳᒈ‫ܨ‬ ಸᲙ҅᭗ଉአԭᶋ଍ᒵ௔ጱٟ඙֢ • Failsafe҅०ᨳਞ‫ڊ҅ق‬ሿ୑ଉ෸҅ፗള஺ኼ҅᭗ ଉአԭٟ‫ف‬෭பᒵ඙֢ • Failback҅०ᨳᛔۖ௩॔҅‫ᦕݣݸ‬୯०ᨳ᧗࿢҅ ਧ෸᯿‫҅ݎ‬᭗ଉአԭၾ௳᭗Ꭳᒵ඙֢ • Forking҅ଚᤈ᧣አग़ӻ๐‫ݝ҅࢏ۓ‬ᥝӞӻ౮‫ܨۑ‬ ᬬࢧ҅᭗ଉአԭਫ෸௔ᥝ࿢᫾ṛጱ᧛඙֢҅֕ᵱ ᥝၵᩇྲ᫾ग़ጱᩒრ 21

22. ๐‫ۓ‬ᴴၞ • ऒᴴၞ҅ᰒ੒ෆӻᔮᕹ‫ݢ‬զඪ೮ጱ๋य़QPS҅ᦡ ऒᴴၞ! ਧᔮᕹᕆጱᴴၞय़ੜ҅ᴠྊ᩻ᬦෆӻᔮᕹጱ๋य़ QPS๋҅ᕣਖ਼ᔮᕹܴྒ • IPᴴၞ҅ᰒ੒ӞԶ௶఺ධ‫ڋ‬አಁ̵ἓԾአಁᒵ҅ᵱ ᥝ໑ഝIP؉ᴴၞ҅ྲই‫ܔ‬IPྯ‫ړ‬ᰦٖᦢᳯེහ᩻ᬦ IPᴴၞ! 1000҅‫ڞ‬ᰒ੒ᧆIP؉ᴴၞ • ള‫ݗ‬ᴴၞ҅ํ෸‫ܔ‬ӻള‫ݗ‬ጱ௔ᚆ؇૧౲ᘏӞԶಢ ᰁ឴‫ݐ‬ള‫ྲݗ‬᫾ᘙ෸҅ᵱᥝᰒ੒ྌᔄള‫ݗ‬؉ള‫ݗ‬ ᴴၞ҅ᦢᳯ‫ܔ‬ള‫ᦢݗ‬ᳯᰁᬦय़๋҅ᕣਖ਼ෆӻᔮᕹ ള‫ݗ‬ᴴၞ! ‫ंڋ‬ 22

23.๐‫ۓ‬ᴳᕆ ᛔۖᴳᕆ ୏‫ى‬ᴳᕆ ۖாᯈᗝᴳᕆ ‫ݢ‬զ᯻አ᩻෸ᴳᕆ̵० ୏‫ى‬ᴳᕆ҅Ӟᛱਖ਼ᴳᕆ ࣁဳٙӾஞٟ‫ۖف‬ாᯈ ᨳེහᴳᕆ̵ඳᵑᴳᕆ ୏‫૲ړࣁਂى‬ୗᯈᗝӾ ᗝᥟፍᥢ‫҅ڞ‬᭗ᬦ๐‫ۓ‬ ᒵ҅ਫሿᛔۖᴳᕆ ஞ҅ᵱᥝᬰᤈᴳᕆ඙֢ ᴳᕆԁ෸੽ᠰ຤ӻ‫ڊ‬Კ ෸҅ࣁᯈᗝӾஞ඙֢‫ܨ‬ ጱᶋ‫ى‬Ძ๐‫҅ۓ‬ଚਧԎ ‫ݢ‬ ᴳᕆ‫ݸ‬ጱᬬࢧᒽኼ • ୮ᔮᕹᦢᳯᰁ᩻ᬦᶼਧጱQPSᴇ꧊෸҅ᵱᥝਖ਼ӞԶᶋ᯿ᥝጱ̵ᶋ໐ஞጱӱ‫ۓ‬ ᬰᤈᴳᕆ҅ฮ؊ٌ੒๐‫ۓ‬ᬰᤈጱ᧣አ 23

24. ๐‫ۓ‬᭄᪵ • ᨕྈDapperғDapper, a Large-Scale traceidғ10000 Spanidғ1 traceidғ10000 Spanidғ1.1 traceidғ10000 Spanidғ1.2 Distributed Systems Tracing Infrastructure ๐‫ۓ‬B1 ๐‫ۓ‬B2 ๐‫ۓ‬B3 traceidғ10000 • traceid҅ຽᦕӞེ᧣አ᱾ֵ҅አtraceid ๐‫ۓ‬A ‫ݢ‬զਖ਼ෆӻ᧣አ᱾Ӥಅํጱ᧣አԀ᩸๶҅ ᬰᘒਫሿ‫ق‬᱾᪠᭄᪵ ๐‫ۓ‬C1 ๐‫ۓ‬C2 ๐‫ۓ‬C3 • spanid҅ຽᦕྯӞӻৼᜓᅩጱ᧣አ҅ਖ਼ traceidғ10000 traceidғ10000 traceidғ10000 ಅํጱspanid೪ള᩸๶҅੪ฎӞེ᧣አ᱾ Spanidғ2 Spanidғ2.1 Spanidғ2.2 ጱಅํ᧣አ 24

25. ๐‫ۓ‬ፊഴ ᔮᕹᕆ‫ڦ‬ ള‫ݗ‬ᕆ‫ڦ‬ • ᕹᦇᔮᕹᕆ‫ڦ‬զ݊ള‫ݗ‬ᕆ‫ڦ‬ӷᐿᖌଶፊഴ ೰ຽහഝ ๋य़QPS ௛QPS ௛᧗࿢ེහ • ᰒ੒ߥଫ෸ᳵᕹᦇ҅‫ݢ‬զᕹᦇߥଫ෸ᳵ 0~10ms̵10~50ms̵50ms~100ms̵ 100~500ms̵500~1000ms̵ ౮‫᧗ۑ‬࿢ེහ ०ᨳ᧗࿢ེහ ౮‫ۑ‬ሲ 1000~2000ms̵2000~5000ms̵ >5000msᒵ҅᭗ᬦᕹᦇᔮᕹ/ള‫ߥݗ‬ଫ෸ ᳵ‫ݢ҅ྲܛ‬զଆۗᦡᗝ᩻෸෸ᳵզ݊ս۸ Top᧗࿢ ०ᨳሲ ߥଫ෸ᳵᕹᦇ ᔮᕹզ݊ള‫ݗ‬௔ᚆᒵ • ᰒ੒୑ଉ᧗࿢҅०ᨳሲᬡ‫ک‬Ӟਧᴇ꧊҅‫ݢ‬ ၞᰁ୑ۖ੒ྲ …… զ‫ݎ‬ಸᦄၾ௳ᒵ 25

26.Ⴎ‫ف‬ங๐‫ۓ‬ຝ຅ 26

27. ই֜ᭌೠங๐‫ۓ‬໛ຝ • ಘ઀௔҅ᵱᥝᘍᡤங๐‫ۓ‬໛ຝฎ‫ވ‬ඪ೮ಘ ઀҅ࣁ‫ݸ‬ᖅጱ୏‫ݎ‬ӾํԶ‫ۑ‬ᚆᵱᥝਧ‫ګ‬۸ Dubbo! SpringCloud! Thrift! gRPC! զ݊ಘ઀҅‫ڞ‬ฎ‫ވ‬ඪ೮ಘ઀௔ਖ਼֢ԅӞӻ உ᯿ᥝጱᘍᰁ ಘ઀௔! অ! অ! অ! অ! Java̵Python̵ Java̵Python̵C+ Java̵C++̵ • ᪜᧍᥺҅ӧ‫ํݪلݶ‬ӧ‫ݶ‬ጱ୏‫ํ҅᥺᧍ݎ‬ ᪜᧍᥺! Java! Node.jsᒵҁᵱᥝ +̵Node.jsᒵग़᧍ Python̵Node.jsᒵ Զ‫ࣁਂݪل‬ग़ᐿ୏‫ྌࢩ҅᥺᧍ݎ‬ฎ‫ވ‬ඪ೮ sidecarᕟկඪ೮҂! ᥺! ग़᧍᥺! ᪜᧍᥺զ݊ඪ೮֜ᐿ୏‫᥺᧍ݎ‬Ԟฎᤍᰁᭌ ᭗‫!ᦓܐמ‬ TCP/HTTP! HTTP! TCP! HTTP/2! ೠӞӻங๐‫ۓ‬໛ຝஉ᯿ᥝጱࢩᔰ ଧ‫ڜ‬۸‫!ᦓܐ‬ Kryo/FST/Hessian! Jackson! Thrift! ProtoBuf! • ᭗‫ํ҅ᦓܐמ‬ጱ๐‫ۓ‬۸໛ຝ‫ݝ‬ඪ೮HTTP‫ܐ‬ ᦓ̵ํጱඪ೮TCP‫ํ̵ᦓܐ‬ጱӷᘏ࣐ඪ ೮҅ӧ‫ݶ‬ጱ‫ᦓܐ‬௔ᚆӧ‫҅ݶ‬ইຎ੒௔ᚆᥝ ࿢ྲ᫾ṛ‫ڞ‬տᭌೠTCP‫҅ᦓܐ‬ইຎ੒௔ᚆ ᥝ࿢ӧṛ‫ݢڞ‬զᭌೠHTTP‫ᦓܐ‬ 27

28. ই֜ᭌೠ‫ݳ‬ᭇጱဳٙӾஞ • ṛ‫ݢ‬አ௔҅ဳٙӾஞጱṛ‫ݢ‬አ௔ฎӞӻᶋ ଉ᯿ᥝጱᘍᰁ҅ള‫ف‬ங๐‫ۓ‬ຝ຅ԏ‫҅ݸ‬ಅ Eureka! ZooKeeper! Consul! etcd! ํ๐‫ۓ‬᮷ဳٙࣁဳٙӾஞ҅ইຎဳٙӾஞ APҁṛ‫ݢ‬አ/‫ړ‬ ṛ‫ݢ‬አਂࣁᳯ᷌҅ਖ਼տ୽ߥ‫ک‬๐‫ۓ‬൉‫׀‬ᘏ ‫਻܄‬Კ҂! ඪ೮! ӧඪ೮! ӧඪ೮! ӧඪ೮! ੒क़ูᶂᛔ૩ጱ๐‫ۓ‬ CPҁӞᛘ௔/‫ړ‬ ӧඪ೮! ඪ೮! ඪ೮! ඪ೮! ‫਻܄‬Კ҂! • හഝӞᛘ௔҅ဳٙӾஞಥ೅๐‫ဳۓ‬ٙզ݊ ग़හഝӾஞ! -! ඪ೮! ඪ೮! ඪ೮! ๐‫ᦈۓ‬ᴅ҅Ӟᛱ᮷տ֢ԅᵞᗭ᮱ᗟ҅உग़ Ӟᛘ௔ᓒဩ! -! paxos! raft! raft! ෸‫ײ‬ᬮտ᮱ᗟࣁग़IDC๢಄҅ࢩྌහഝӞᛘ ௔݈౮ԅ౯ժጱӞӻᘍᰁ҅ই֜‫כ‬ᵑහഝ Ӟᛘ௔҅ၿ݊‫ک‬CAPቘᦞ • ग़හഝӾஞ᮱ᗟ҅உग़ӱ‫ۓ‬๐‫࣐ۓ‬տ᮱ᗟ ࣁग़IDC๢಄҅ࢩྌฎ‫ވ‬ඪ೮ग़හഝӾஞԞ ฎӞӻஉ᯿ᥝጱᘍᡤ 28

29. ই֜ᭌೠ‫ݳ‬ᭇጱᯈᗝӾஞ • ᯈᗝኞප݊෸௔҅ᯈᗝ‫ࣁؙਂ௳מ‬ᯈᗝӾ ஞ҅୮‫ݸ‬ᖅᰒ੒ᯈᗝ‫௳מ‬ᬰᤈ‫ץ‬ද‫҅ݸ‬ฎ Apollo! Disconf! Spring-cloud-config! ‫ݢވ‬զ݊෸ள᭛വᭆᕳ‫ݱ‬ᔮᕹ҅ฎӞӻᶋ ଉ᯿ᥝጱᘍᡤᅩ ᯈᗝኞප! ਫ෸! ਫ෸! ᯿‫ސ‬౲ᘏಋۖrefresh! ᯈᗝๅෛവᭆ! ඪ೮! ඪ೮! ಋૡ᥶‫!ݎ‬ • ग़හഝӾஞ᮱ᗟ҅உग़ӱ‫ۓ‬๐‫࣐ۓ‬տ᮱ᗟ ࣁग़IDC๢಄҅ࢩྌฎ‫ވ‬ඪ೮ग़හഝӾஞԞ ᯈᗝኴᶎ! ඪ೮! ඪ೮! ӧඪ೮҅ᵱᥝgitඪ೮! ฎӞӻஉ᯿ᥝጱᘍᡤ ᯈᗝਧ෸೉‫!ݐ‬ ඪ೮! Client᯿‫ސ‬೉‫!ݐ‬ ӧඪ೮! ग़හഝӾஞ! ඪ೮! ඪ೮! ඪ೮! • ฃአ௔҅ᯈᗝӾஞጱ඙֢ฃአ௔Ԟஉ᯿ ᥝ҅ฎ‫ވ‬൉‫ݢ׀‬ᥤ۸඙֢ኴᶎ҅ฎ‫ݢވ‬զ ள᭛ᖫᬋᯈᗝ‫௳מ‬ᒵ 29