SlideShare a Scribd company logo
1 of 11
Download to read offline
@Author Aaron Chu
微服務架構
心懷感恩、面對起落、
擁抱生命的禮物 ~
@Github
github.com/agilego99
Aaron
@Mail
chukuo99@gmail.com
@Author Aaron Chu
入門微服務
@Author Aaron Chu
單體應用走
向服務化
入門
微服務
@Author Aaron Chu
思考題:
想想你現在的業務場景,如
果是單體應用的話,是否需
要進行服務化拆分? 如果需
要的話,你覺得是縱向拆分
還是橫向拆分合適? 具體可
以拆分到什麼粒度?
@Author Aaron Chu
何時該進行服務化拆分?
@Author Aaron Chu
服務化拆分
兩種姿勢
• 這種服務化拆分方式是縱向拆分,是從業務維度進
行拆分。 標準是按照業務的關聯程度來決定,關聯
比較密切的業務適合拆分為一個微服務,而功能相
對比較獨立的業務適合單獨拆分為一個微服務。
業務維度進行拆分:縱向拆分
• 另一種服務化拆分方式是橫向拆分,是從公共且獨
立功能維度拆分。 標準是按照是否有公共的被多個
其他服務調用,且依賴的資源獨立不與其他業務耦
合。
公共且獨立功能維度拆分:橫向拆分
@Author Aaron Chu
服務化拆分的前置條件(Cont.)
從單體應用遷移到微服務架構時必將面臨也必須解決的問題:
• 服務如何定義
• 對於微服務來說,每個服務都運行在各自的進程之中,透過通訊接口向外部傳達自身訊息,
無論採用哪種通訊協定,是 HTTP 還是 RPC,服務之間的調用都通過接口描述來約定,約
定內容包括接口名、接口參數以及接口返回值。
• 服務如何發佈和訂閱
• 拆分為微服務獨立部署後,服務提供者該對外暴露自己的地址,需要一個類似登記處的地
方(好比電話簿所提供的功能) ,記錄每個服務提供者的位址以供服務調用者查詢,提供
服務調用者查詢所需要調用的服務的位址 ,在微服務架構裡,這個地方就是註冊中心
一般情況下,業務系統引入新技術就必然會帶來架構的複雜度提升,在具體決策前,需要認識到新架構會帶來哪
些新的問題,這些問題你和你的團隊是否能夠解決? 如何解決? 是自己投入人力建設,還是採用業界開源方案?
@Author Aaron Chu
服務化拆分的前置條件(Cont.)
• 服務如何監控
• 對於一個服務,運維團隊所關心的 QPS(調用量)、AvgTime(平均耗時)以及 P999(99.9% 的請求
性能在多少毫秒以內)這些指標。 需要以一種通用的監控方案,能夠覆蓋業務埋點、資料收集、資料處
理,最後到資料展示的全鏈路功能。
• 服務如何治理
• 拆分為微服務架構後,服務的數量變多了,依賴關係也變複雜了。 比如一個服務的性能有問題時,依賴
的服務都勢必會受到影響。 可以設定一個調用性能閾值,如果一段時間內一直超過這個值,那麼依賴服
務的調用可以直接返回,這就是熔斷,也是服務治理最常用的手段之一。
• 故障如何定位
• 在單體應用拆分為微服務之後,一次使用者調用可能依賴多個服務,每個服務又部署在不同的節點上,
如果使用者調用出現問題,需要有一種解決方案能夠將一次使用者請求進行標記,並在多個依賴的服務
系統中繼續傳遞,以便串聯所有路徑,從而進行故障定位。
@Author Aaron Chu
本節重點
無論是縱向拆分還是橫向拆分,都是將單體應用龐雜的功能進
行拆分,抽離成單獨的服務部署。但並不是說功能拆分的越細
越好,過度的拆分反而會讓服務數量膨脹變得難以管理,因此
找到符合自己業務現狀和團隊人員技術水準的拆分粒度才是可
取的。 我建議的標準是按照每個開發人員負責不超過 3 個大
的服務為標準,畢竟每個人的精力是有限的,所以在拆分微服
務時,可以按照開發人員的總人數來決定。
@Author Aaron Chu
@Author Aaron Chu
小結附錄

More Related Content

Recently uploaded

chat gpt账号购买👉top233.com👈chat gpt账号批发购买
chat gpt账号购买👉top233.com👈chat gpt账号批发购买chat gpt账号购买👉top233.com👈chat gpt账号批发购买
chat gpt账号购买👉top233.com👈chat gpt账号批发购买
larondahannae1n
 

Recently uploaded (20)

上海高端外围包夜【选妞网址☆qmm123.com】上海外围网红模特
上海高端外围包夜【选妞网址☆qmm123.com】上海外围网红模特上海高端外围包夜【选妞网址☆qmm123.com】上海外围网红模特
上海高端外围包夜【选妞网址☆qmm123.com】上海外围网红模特
 
迷奸水网上订购【网址☆THC88.com】迷奸水网上购买
迷奸水网上订购【网址☆THC88.com】迷奸水网上购买迷奸水网上订购【网址☆THC88.com】迷奸水网上购买
迷奸水网上订购【网址☆THC88.com】迷奸水网上购买
 
虾漫抖阴【破解版下载:K782.com】☆☆☆官网下载☆☆☆人妖视频破解版app最新下载地址
虾漫抖阴【破解版下载:K782.com】☆☆☆官网下载☆☆☆人妖视频破解版app最新下载地址虾漫抖阴【破解版下载:K782.com】☆☆☆官网下载☆☆☆人妖视频破解版app最新下载地址
虾漫抖阴【破解版下载:K782.com】☆☆☆官网下载☆☆☆人妖视频破解版app最新下载地址
 
三唑仑-迷药-乖乖水【网址☆THC88.com】什么地方能买到迷药
三唑仑-迷药-乖乖水【网址☆THC88.com】什么地方能买到迷药三唑仑-迷药-乖乖水【网址☆THC88.com】什么地方能买到迷药
三唑仑-迷药-乖乖水【网址☆THC88.com】什么地方能买到迷药
 
上海长宁区外围预约【选妞网址☆qmm123.com】上海长宁区嫩模
上海长宁区外围预约【选妞网址☆qmm123.com】上海长宁区嫩模上海长宁区外围预约【选妞网址☆qmm123.com】上海长宁区嫩模
上海长宁区外围预约【选妞网址☆qmm123.com】上海长宁区嫩模
 
台北国外妞【选妞网址☆qmm123.com】台北外围资源上门
台北国外妞【选妞网址☆qmm123.com】台北外围资源上门台北国外妞【选妞网址☆qmm123.com】台北外围资源上门
台北国外妞【选妞网址☆qmm123.com】台北外围资源上门
 
汤头条【破解版下载:K782.com】☆☆☆官网下载☆☆☆成人资源破解版app最新下载地址
汤头条【破解版下载:K782.com】☆☆☆官网下载☆☆☆成人资源破解版app最新下载地址汤头条【破解版下载:K782.com】☆☆☆官网下载☆☆☆成人资源破解版app最新下载地址
汤头条【破解版下载:K782.com】☆☆☆官网下载☆☆☆成人资源破解版app最新下载地址
 
三唑仑购买方式【网址☆THC88.com】三唑仑购买渠道
三唑仑购买方式【网址☆THC88.com】三唑仑购买渠道三唑仑购买方式【网址☆THC88.com】三唑仑购买渠道
三唑仑购买方式【网址☆THC88.com】三唑仑购买渠道
 
直播盒子【破解版下载:K782.com】☆☆☆官网下载☆☆☆爱微奶破解版app最新下载地址
直播盒子【破解版下载:K782.com】☆☆☆官网下载☆☆☆爱微奶破解版app最新下载地址直播盒子【破解版下载:K782.com】☆☆☆官网下载☆☆☆爱微奶破解版app最新下载地址
直播盒子【破解版下载:K782.com】☆☆☆官网下载☆☆☆爱微奶破解版app最新下载地址
 
撸撸社【破解版下载:K782.com】☆☆☆官网下载☆☆☆醉花视频破解版app最新下载地址
撸撸社【破解版下载:K782.com】☆☆☆官网下载☆☆☆醉花视频破解版app最新下载地址撸撸社【破解版下载:K782.com】☆☆☆官网下载☆☆☆醉花视频破解版app最新下载地址
撸撸社【破解版下载:K782.com】☆☆☆官网下载☆☆☆醉花视频破解版app最新下载地址
 
网上哪卖迷药如何买【网址☆THC88.com】网上能买到吗迷药
网上哪卖迷药如何买【网址☆THC88.com】网上能买到吗迷药网上哪卖迷药如何买【网址☆THC88.com】网上能买到吗迷药
网上哪卖迷药如何买【网址☆THC88.com】网上能买到吗迷药
 
春药购买虾皮shopee【网址☆THC88.com】春药买卖
春药购买虾皮shopee【网址☆THC88.com】春药买卖春药购买虾皮shopee【网址☆THC88.com】春药买卖
春药购买虾皮shopee【网址☆THC88.com】春药买卖
 
开房信息查询网站【下单查询网站:KF367.com】手机号查询开房记录,查开房记录,开房信息查询,查询酒店入住记录信息
开房信息查询网站【下单查询网站:KF367.com】手机号查询开房记录,查开房记录,开房信息查询,查询酒店入住记录信息开房信息查询网站【下单查询网站:KF367.com】手机号查询开房记录,查开房记录,开房信息查询,查询酒店入住记录信息
开房信息查询网站【下单查询网站:KF367.com】手机号查询开房记录,查开房记录,开房信息查询,查询酒店入住记录信息
 
发春药在哪卖【网址☆THC88.com】发春药怎么购买
发春药在哪卖【网址☆THC88.com】发春药怎么购买发春药在哪卖【网址☆THC88.com】发春药怎么购买
发春药在哪卖【网址☆THC88.com】发春药怎么购买
 
如何买卖迷药价格【网址☆THC88.com】如何买迷药
如何买卖迷药价格【网址☆THC88.com】如何买迷药如何买卖迷药价格【网址☆THC88.com】如何买迷药
如何买卖迷药价格【网址☆THC88.com】如何买迷药
 
迷奸药制作方法【网址☆THC88.com】迷奸药制作方法是什么
迷奸药制作方法【网址☆THC88.com】迷奸药制作方法是什么迷奸药制作方法【网址☆THC88.com】迷奸药制作方法是什么
迷奸药制作方法【网址☆THC88.com】迷奸药制作方法是什么
 
chat gpt账号购买👉top233.com👈chat gpt账号批发购买
chat gpt账号购买👉top233.com👈chat gpt账号批发购买chat gpt账号购买👉top233.com👈chat gpt账号批发购买
chat gpt账号购买👉top233.com👈chat gpt账号批发购买
 
开房信息社工库查询【下单查询网站:KF367.com】通过身份证号码查询开房时间,查开房记录,开房信息查询,查询酒店入住记录信息
开房信息社工库查询【下单查询网站:KF367.com】通过身份证号码查询开房时间,查开房记录,开房信息查询,查询酒店入住记录信息开房信息社工库查询【下单查询网站:KF367.com】通过身份证号码查询开房时间,查开房记录,开房信息查询,查询酒店入住记录信息
开房信息社工库查询【下单查询网站:KF367.com】通过身份证号码查询开房时间,查开房记录,开房信息查询,查询酒店入住记录信息
 
黑桃A资源【破解版下载:K782.com】☆☆☆官网下载☆☆☆韩漫破解版app最新下载地址
黑桃A资源【破解版下载:K782.com】☆☆☆官网下载☆☆☆韩漫破解版app最新下载地址黑桃A资源【破解版下载:K782.com】☆☆☆官网下载☆☆☆韩漫破解版app最新下载地址
黑桃A资源【破解版下载:K782.com】☆☆☆官网下载☆☆☆韩漫破解版app最新下载地址
 
uu短视频【破解版下载:K782.com】☆☆☆官网下载☆☆☆抖音网红资源破解版app最新下载地址
uu短视频【破解版下载:K782.com】☆☆☆官网下载☆☆☆抖音网红资源破解版app最新下载地址uu短视频【破解版下载:K782.com】☆☆☆官网下载☆☆☆抖音网红资源破解版app最新下载地址
uu短视频【破解版下载:K782.com】☆☆☆官网下载☆☆☆抖音网红资源破解版app最新下载地址
 

Featured

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

微服務架構|02|入門微服務|單體應用走向服務化