- 快召唤伙伴们来围观吧
- 微博 QQ QQ空间 贴吧
- 文档嵌入链接
- 复制
- 微信扫一扫分享
- 已成功复制到剪贴板
《贝聊微服务架构实战历程》-杨钦民
内容大纲:
- 业务背景介绍
- 诞生期 技术架构选型
- 成长期 技术架构重构
- 爆发期 微服务架构
展开查看详情
1 .ᨬᘱங๐ۓຝਫܲᑕ ᰭ࿆ ᨬᘱದᶶᳯ
2 .ᰭ࿆ ᨬᘱದᶶᳯ ᨮᨱᨬᘱᎸ֛ݎᔮୌᦡ̵ࢫᴚୌᦡ̵Ոङِ ୌᨬᘱங๐ۓຝ֛ᔮ̵ଘݣຝ֛ᔮ̵ᛔ ۖ۸ᬩᖌ֛ᔮ
3 .1 ӱۓᙧวՕᕨ 2 ᦿኞ๗-ದຝᭌࣳ 3 ౮ᳩ๗-ದຝ᯿ 4 ᆷݎ๗-ங๐ۓຝ
4 .1 ӱۓᙧวՕᕨ
5 .ىԭᨬᘱ • ᨬᘱ౮ᒈԭ2013ଙ҅ฎӾࢵଞࢮدਹᳩૡ֢ଘݣ • ᛘێԭ᭗ᬦᘶᗑԾߝ݊ਧګ۸ᥴ٬ොໜ҅ଆۗଞࢮدᥴ ٬ᐏ̵᭗Ꭳ̵ဋ᭗ᒵਹᳩૡ֢Ӿጱዳᅩ҅ᬰਹࢮىᔮ ᧯
6 .2 ᦿኞ๗-ದຝᭌࣳ
7 .ದຝᭌࣳᘍᡤᅩ Ꮈݎᩒრ ᎸݎՈێ ದؙ॓ ள᭛Ꮈݎ
8 .ದຝ Android IOS PC አಁ੶ Nginx ള੶ف 3ݣECS๐ۓ NginxӨᔮᕹ᮱ᗟࣁ1ݣ ӱۓᔮᕹ ᔮᕹ੶ RDSහഝପ1ݣ Memcache1ݣ RDSහഝପ Memcacheᖨਂ ਂ੶ؙ
9 .ದຝᇙᅩ ֛ܔຝ ள᭛Ꮈݎ ֗౮ • ֛ܔຝ҅ຝᓌ҅ܔႴศጱ੶ړᕮ • ݢզள᭛Ꮈ҅ݎჿ᪃Ծߝள᭛ᬽդᵱ • ဌํ॔ጱದ҅ದԟ౮֗҅ݶᬩᖌ౮֗҅෫ᵱӫӱጱᬩᖌ҅ᜓඪ
10 .3 ౮ᳩ๗-ದຝ᯿
11 .ದຝ᯿ॶ ӱݎۓ ളݗਧԎ ӱۓᘠݳ ᬥ᭛ ӧᥢ ᔲੂ وአහഝ ᘠݳᒫӣ හഝପᦡ ପ ො๐ۓ ᦇႰԤ
12 .ᔮᕹೆړ Kindergarten Community Card API API API kindergarten Community Card य़ᔮᕹೆڊړग़ӻӱۓᇿᒈৼᔮᕹ ݣݸ ݣݸ ݣݸ ग़ᔮᕹᖀᖅوአݶӞӻRDSහഝପ ӧݶӱۓᔮᕹԏᳵӧᚆፘᦢᳯᤒ RDSහഝପ
13 .DBೆړ Kindergarten Community Card API API API kindergarten Community Card ݣݸ ݣݸ ݣݸ ৼݱᔮᕹׁᩢጱᤒᇿᒈೆړ ᇿᒈRDSහഝପ ਫሿහഝପԆړᐶ හഝପᇔቘᵍᐶ Kindergarten Community Card RDS master RDS master RDS master RDS slave RDS slave RDS slave
14 .ྍڡ๐ۓ۸ Kindergarten Card API RPC᧣አ API kindergarten Card ݣݸ ݣݸ HessianਫሿᓌܔRPC᧣አ ᇿᒈᒫӣො๐ۓ RPC᧣አ RPC᧣አ Push๐ۓ SMSᎨמ๐ۓ
15 .ᨮ࣐ᤍ SLB SLB Nginx Nginx Nginx ग़SLBᨮ࣐ᤍ ग़Nginxݻݍդቘᨮ࣐ᤍ ܔعᅩඳᵑ ᔮᕹ1 ᔮᕹ2 ᔮᕹ3 ᔮᕹ1 ᔮᕹ2 ᔮᕹ3 ᔮᕹ1 ᔮᕹ2 ᔮᕹ3
16 .ದຝ Androidᘌᇇ IOSᘌᇇ PC web አಁ੶ Androidਹᳩᇇ IOSਹᳩᇇ ᘍ۪APP SLB SLB ള੶ف Nginx Nginx Nginx Kindergarten Card Community ᔮᕹ੶ Agent Check ᒫӣො SMS๐ۓ IM๐ۓ Push๐ۓ ๐੶ۓ MQ ਂ੶ؙ Memchache Redisᵞᗭ RDS
17 .ದຝᇙᅩ ړୗ ᔮᕹᕆ ྍڡ๐ۓ ຝ ೆړ ۸ DBᇔቘᵍ MQձۓ SLBᨮ ᐶ ྍ۸ ࣐ᤍ
18 .4 ᆷݎ๗-ங๐ۓຝ
19 .ங๐ۓದຝਫෞॶ ӱۓṛ᭛ ӱۓ᭦ᬋ ӱ࣋ۓว ݎ ᘠݳ ॔ አಁᥢཛྷ ᎸݎՈާ դᎱᥢཛྷ ᆷݎ ಘୟ ᛆᙡ
20 .ਫෞங๐ۓጱپӻىᲫᅩ զ๐ۓԅ ຂᘠݳ ṛಘ Ӿஞ • զ๐ۓԅӾஞ҅Ӟڔ᮷ฎ๐ྯ҅ۓӻ๐ۓ᮷ᰒܔӞӱۓᬰᤈᤰ҅ۑᦤכᚆਠෆᘳᨱܔӞ • ຂᘠݳ҅๐ۓԏᳵۑᚆᇿᒈ҅ᚆड़ᇿᒈ᮱ᗟ҅๐ۓԏᳵፘׁᩢ • ṛಘ҅ړවᩒრ҅ࢫᴚݶܐૡ֢҅ݢ෫ᴴಘ҅ๅṛጱդᎱ᯿አሲ
21 .Dubboங๐ۓຝ ဳٙӾஞᵞᗭ 2 subscribe 1 register 3 notify ங ங๐ۓၾᩇᘏ ங๐ۓ׀ᘏ ๐ ౮ᆧጱṛᚆړୗຝ҅ྲᑞਧ ۓ ᓕ Consumer 4 invoke Provider ෫ᖲളفSpringຝ ቘ ଘ ٍ॓๐ဳۓ̵ٙݎሿ̵᪠ኧ̵ᨮ࣐ᤍ̵ᴳᕆ̵᯿ ݣ ᧣ᜓ Consumer Provider դᎱრ҅ݢզਧګ۸ಘۑᚆ 5 count ங๐ۓፊഴଘݣ
22 .Dubboங๐ۓຝಘԏദ๐ۓ ԅྯӞӻ๐ړۓᯈӞӻAPPID҅consumer᭗ᬦ attachmentappIdփ᭓ᕳprovider ӧ᭗ᬦ Consumerᦡᗝғ RpcContext.getContext().setAttachment(“appId”,123); ࣁproviderݐappIdғ invoke ḵᦤ String appId=invocation.getAttachment(“appId”); Consumer Provider ദ๐ۓ ᬬࢧᕮຎ ᭗ᬦ რappId ᥝᦢᳯጱappId ݢզᦢᳯጱളݗ app1 app2 com.biz.UserProvider.getUser app1 app2 com.biz.PushProvider.* app2 App3 *
23 .Dubboங๐ۓຝಘԏᕹᦇӾஞ pull push Consumer Filebeat pull push Logstash pull push Consumer Filebeat ElasticSea Dubboള Kafka pull push Logstash rch ݗᚆ Cluster Cluster ᕹᦇ pull push Provider Filebeat pull push Logstash push pull Provider Filebeat
24 .Dubboங๐ۓຝಘԏᕹᦇӾஞಸᤒ ളݗᘙഭᤈ ᔄࣳ ๐ۓ ොဩ ᘙ>=100ms හ ጯྲړ PROVIDER com.ibeiliao.aaa.bbbProvider test 1000 10000 10% Consumer com.ibeiliao.ccc.ddd get 100 10000 1% ളݗ०ᨳഭᤈ ᔄࣳ ๐ۓ ොဩ ०ᨳහ හ ጯྲړ PROVIDER com.ibeiliao.eee.fffProvider add 50 10000 0.5% Consumer com.ibeiliao.ee1.ff2 test 20 10000 0.2%
25 .Dubboங๐ۓຝಘԏᕹᦇӾஞಸᤒ ᔮᕹᦢᳯᰁഭᤈ ๋ṛQPS॒ቘᳵ>1sጱ ᔮᕹݷᑍ ᦢᳯᰁ ྲฌॠ ๋ṛQPS ๋ṛQPSᳵ හᰁ ᔮᕹ1 10000000 +20% 3000 2018-02-18 18ғ00ғ00 20 ᔮᕹ2 3000000 -10% 900 2018-02-18 19ғ00ғ00 10 ളᦢݗᳯᰁഭᤈ ๋ṛQPS॒ቘᳵ>1sጱ ളݷݗᑍ ᦢᳯᰁ ྲฌॠ ๋ṛQPS ๋ṛQPSᳵ හᰁ ളݗ1 2000000 -1% 800 2018-02-18 19ғ00ғ00 5 ളݗ2 400000 +0% 100 2018-02-18 20ғ00ғ00 1
26 .ங๐ۓຝଘჶᄍᬰ ࣘܔ๐ۓ ࣘܔ๐ۓ ۖா ᐒ܄ ۖா ᐒ܄ ۖா ᐒ܄ ۖா ᐒ܄ դᎱ դᎱ դᎱ դᎱ ๐ۓ ๐ۓ ๐ۓ ๐ۓ ࣘܔᤒ ۖாᤒ ᐒ܄ᤒ ۖாᤒ ᐒ܄ᤒ ۖா ᐒ܄ ᕮ ᕮ ᕮ ᕮ ᕮ හഝପ හഝପ 1 ܔӞ๐ۓ 2 ܔӞ๐ۓ 3 ग़๐ۓ 4 ग़๐ۓ ܔӞᤒᕮ ग़ᤒᕮ ग़ᤒᕮ ग़හഝପ
27 .ங๐ۓຝਫෞ ᔮᕹ ங๐ۓA ங๐ۓB ங๐ۓC ᇿᒈӱۓೆړங๐҅ۓᇿᒈ᮱ᗟ ங๐ۓA ங๐ۓB ங๐ۓC ᔮᕹۑᚆق᮱᭗ᬦ᧣አங๐ۓਫሿ҅ᔮᕹӧᚆፗ ളᦢᳯDB ྯӻங๐ۓ᮷ᖌಷᇿᒈጱDB ங๐ۓD ங๐ۓE ங๐ۓF ங๐ۓG ங๐ۓD ங๐ۓE ங๐ۓF ங๐ۓG
28 .ங๐ۓຝໜֺ—ቔᕆۖாங๐ۓ Kindergarten Kindergarten API ᓕቘݣݸ Timeline Timeline Timeline ங๐ۓ ங๐ۓ ங๐ۓ ቔᕆۖாங๐ۓӱ᧣ۓአො᭐ก҅ӱۓො෫ᵱဳىਫሿᕡᜓ դᎱ॔አ҅ᇿᒈங๐ۓᕟկ҅ӱۓᔮᕹӧٚව៧ቔᕆۖாӱۓ᭦ᬋ դᎱ Redisᵞᗭ Redis Redis Redis ਫෞԧړପړᤒ҅ᥴ٬ԧܔහഝପහഝᰁय̵़හഝ॒ቘᚆํێᴴጱኒ ᷀ᳯ᷌҅ളݗጱෆ֛ᚆ܋ԧپ ړପړᤒ Timeline DB Timeline DB Timeline DB
29 .ங๐ۓຝໜֺ—ቔᕆۖாங๐ۓRedisᵞᗭ Redisᵞᗭ Ԇᜓᅩ3ݣ๐ۓ A B C Redis3.xᇇ؉ᵞᗭcluster 6ݣ҅3ӻԆᜓᅩ҅3ӻᜓᅩ A1 B1 C1 ᜓᅩ3ݣ๐ۓ