SlideShare ist ein Scribd-Unternehmen logo
1 von 103
網站上線了,然後呢?
陳小風
TechPodcastNight
http://mvc.tw
自我介紹
 陳鋒逸(陳小風)
 經歷
 KKTIX 工程師
 微軟最有價值專家 (MVP)
 SkillTree兼任講師
 社群研討會講師
 TechPodcastNight
 twMVC
 AgileCommunity.tw
 Javascript.tw
粉絲團: 愛流浪的小風
軟體和教堂非常類似
建成之後我們就開始祈禱…
3
http://mvc.tw
Software in 2017
 趨勢變化
 競爭激烈
 時間就是金錢
http://mvc.tw
對產品的共識不一致
5
我們眼中的產品
實際的產品
老闆希望的產品 PM 想像的產品
股東理想中的產品 使用者用到的產品
http://mvc.tw
 提早確認
 修正方向
修
正
修
正
修
正
修
正
適應改變
在產品上線之前
工程師平均一天工作 12 小時…
在產品上線之後
工程師平均一天工作 12 小時…
On Call 24 小時…
7
http://mvc.tw
產品團隊的挑戰
持續交付新產品
保持系統穩定
瞭解服務狀態
應付意外狀況
持續交付高品質軟體
9
對軟體開發來說
最困難的不是如何上線…
是如何快速、持續把新版本上線…
10
http://mvc.tw
持續交付的痛點
穩定性
相容性
可回復性
應變性
http://mvc.tw
你有聽過測試嗎?
 驗證結果符合預期
 找出潛在問題
 安全防護網
 有重構的機會
http://mvc.tw
你的測試怎麼做?
http://mvc.tw
你做的是測試嗎?
 預期會發生的行為 => 驗證
 找出意料外的行為 => 測試
 讓 驗證 自動化
順暢
穩定防呆
http://mvc.tw
100
120
137
160
20
17
23
15
SPRINT 1 SPRINT 2 SPRINT 3 SPRINT 4
Code Increasement
測
試
工
作
量
程式碼行數與測試需求
15
http://mvc.tw
為什麼需要自動化測試
0
1
2
3
4
5
6
7
8
2 4 6 8 10 12
測試人員需求
有自動化測試 沒自動化測試
測試人員是原本的 7 倍
http://mvc.tw
惡性循環
開發時間少
測試問題多
加班趕工上線
發現程式很難改
投入更多資源
http://mvc.tw
讓測試自動化
單元
測試
整合
測試
壓力
測試
驗收
測試
系統
測試
http://mvc.tw
有測試就安全了嗎?
涵蓋率 重複 安全性
風格 技術債
http://mvc.tw
自動化部署
 避免手誤
 標準化流程
 節省時間
 減少人力介入
21
http://mvc.tw
Source Code Production
CI Server
Build Unit Test
Integration Test
Code Analysis
Deploy
持續交付流程
22
http://www.ambysoft.com/essays/whyAgileWorksFeedback.html
23
http://mvc.tw
Developer
 工具不是萬能
 人工確認
 Definition of Done
 同步資訊
24
http://mvc.tw
Source Code Production
CI Server
Build Unit Test
Integration
Test
Code
Analysis
Deploy
Code Review
Pair Programming
持續交付流程
http://mvc.tw
Development
Test
RD
QA
Test DB
開發
測試
Production DBStage
測試
Production
使用服務
正式上線
Multiple Stage
26
http://mvc.tw
環境落差
 環境不一致
 資料量大
 資料複雜度高
 效能問題
 架構問題
27
http://mvc.tw
Canary & Rolling Release
App
1
App
1
App
1
App
1
App
1
App
1
App
1
App
1 V2
App
1 V2
App
1 V2
App
1 V2
App
1 V2
App
1 V2
App
1 V2
CI Server
app.com
Canary
Production
http://mvc.tw
壓力測試的難題
 與現實有落差
 人類 vs 機器
 測試的死角
 瞬間的瓶頸
29
30
Unique User Count / Minutes
31
http://mvc.tw
 PhantomJs
 根據 Request Log
 根據 GA
 客制化腳本
 同時發動
模擬使用者行為
32
http://mvc.tw
Customize Script
Runner
Admin
模擬使用者行為
33
http://mvc.tw
Recap
 確保品質
 持續交付
 避免意外
 有效產出
34
Immutable Infrastructure
35
http://mvc.tw
WebSite
Database
Redis
網站架構
36
http://mvc.tw
App App
Redis Database
• Stateless
• Recoverable
• Reuse
• Scale out & Scale up
Scalable Application
37
http://mvc.tw
Maintainable
• Install
• Setup
• Maintain
38
http://mvc.tw
Maintainable
• Install
• Setup
• Maintain
39
http://mvc.tw
App App
Redis Database
Terraform
Infrastructure as Code
40
http://mvc.tw
App
Redis Database
Puppet
provition
Infrastructure as Code
41
http://mvc.tw
App
DockerWeb
DB
Redis
Infrastructure as Code
42
http://mvc.tw
Branch A
Web
DB
Redis
Infrastructure as Code
43
Testing
Environment
Branch B
Web
DB
Redis
Production
Environment
App App
Web Web Web Web
DB
Redis
http://mvc.tw
Terraform
 使用 HCL / JSON
 容易閱讀
 支援多平台
 可匯入現有資源
 搭配版本控管
44
http://mvc.tw
多平台
https://www.terraform.io/docs/providers/
目前有 70 多個 Provider
45
http://mvc.tw
版本控管
46
http://mvc.tw
Puppet
 Provision
 Package AWS AMI
 Role Profile Pattern
 Easy Reuse
 Auto Scaling Group
47
Role
Nginx
Rails
Fluentd
AMI
Cloudwatch Log
http://mvc.tw
Docker
 快速建置環境
 開發與正式環境一致
 環境隔離
 資源有效利用
 降低維運成本
 比虛擬化更輕量
http://mvc.tw
WebSite
Database
Redis
20%
50%
15%
資源最佳化
http://mvc.tw
Docker
WebSite
Database
Redis
Docker
http://mvc.tw
Recap
 Stateless
 Scalable
 Stable
 Reuseable
51
System Monitor and
Profiling
52
http://mvc.tw
監控維度
Infrastruc
ture
Server
Application
Flow
http://mvc.tw
App App
Redis Database
AWS
CloudWatch
• ELB Request Count
• CPU Usage
• Network Thoughput
• Disk IO
Intrastructure Status
54
http://mvc.tw
Cloudwatch Dashboard
http://mvc.tw
AWS Cloudwatch
56
http://mvc.tw
App
Monit
• CPU Usage
• Memory Usage
• Disk Usage
• Application Status
• Custom Script
Server Status
57
http://mvc.tw
M/ Monit
http://mvc.tw
Application Level
Nginx
Rails Go
• Access Log
• Error Log
• Audit Log
• Others
Application Status
59
http://mvc.tw
Logs
60
工程師就是要用 Terminal
http://mvc.tw
替 Log 加分
 Centralize
 持續分析
 資料視覺化
 監控問題
 預防異常
62
http://mvc.tw
ELK
Web Server Buffer
AWS CloudWatch Log
63
http://mvc.tw
Kibana
http://mvc.tw
Log Processing
Normalize Filter Aggregate Visualizize
http://mvc.tw
Log as
Dashboard
66
http://mvc.tw
Log as
Dashboard
http://mvc.tw
Flow Status
 服務流程是否正常
 交易中斷
 無法登入
 歷史數據比較
 可透過 Google Analytics 實現
http://mvc.tw
Flow
Status
69
http://mvc.tw
Dashboard
即時更
新
健康狀
況
關鍵資
訊
資訊整合
70
App App 2 DB Redis Network
App 3 App 4 Request CacheApp 5
71
http://mvc.tw
Profiling
 特定時間
 狀態分析
 資訊記錄
 效能改善
 系統優化
Infrastr
ucture
Server
Applica
tion
Flow
72
http://mvc.tw
Analysis Event
Infrastr
ucture
Server
Applica
tion
Flow
Collect Data
73
Cron Job
http://mvc.tw
Profile Record
http://mvc.tw
Profile Record
http://mvc.tw
Profile Record
http://mvc.tw
 資訊收集
 分析應用
 關注重點
Recap
77
Chatops
78
http://mvc.tw
Notification
79
Infrastructure
CI Server
DashboardSlack
http://mvc.tw
 即時通知
 信箱不會爆炸
 盡量避免雜訊
 重要訊息
 減少干擾
Notification
Infrastructure
CI Server
Dashboard
Slack
80
http://mvc.tw
 即時通知
 信箱不會爆炸
 盡量避免雜訊
 重要訊息
 減少干擾
Notification
81
http://mvc.tw
Interaction
82
Infrastructure
CI Server
DashboardSlack
http://mvc.tw
Interaction
83
Infrastructure
CI Server
Dashboard
Slack
Robot
http://mvc.tw
 不需要介面
 指令操作
 權限管理
 隨時隨地
Robot
84
Slack
Robot
http://mvc.tw
Query Log Aggregation
85
Slack
Robot Dashboard
http://mvc.tw
主動查詢
被動提醒
86
http://mvc.tw
Apply Infrastructure
87
Slack
Robot Infrastructure
設定系統機器數量
http://mvc.tw
Apply Infrastructure
88
Slack
Robot
App
http://mvc.tw
Query Server Status
89
Slack
Robot
http://mvc.tw
綜合應用
90
InfrastructureDashboard
Slack
Robot
User
Request
機器數量不足 是否加開機器?
http://mvc.tw
 降低門檻
 方便操作
 重點提示
 改善流程
Recap
91
http://mvc.tw
 有效利用資源
 減少重複工作
 可靠度
 穩定性
總結
92
 解決問題
 預防問題
 工具只是輔助
 持續改善
http://mvc.tw
 減少浪費
 達成目標
 消除瓶頸
解決問題
團隊文化
93
http://mvc.tw
人 工具>
94
http://mvc.tw 95
96
版本
控制
產品
單元
測試
整合
測試
代碼
風格
自動
部署
結對
編程
Code
Review
持續
集成
實例化
需求
敏捷
開發
Terraform
Puppet
Docker
不可變
架構
架構即
代碼
Bash
Automation
自動
延展
高可
用性
Elastic
Search
Fluentd
Kibana
Cloud
Watch
Monit
Dashboard
Alarm
Chatops
Notification
Operation
http://mvc.tw 97
產品
穩定
持續交付
http://mvc.tw
謝 謝 大 家
98
http://mvc.tw
兩週舉辦一次的 Friday Night 線上版科技宅聚會, 晚上 9
點到 10點,分享關於近期學習的新知,也分享工程師職涯路
上的酸甜苦辣。
Tech Podcast Night
@TechPodcastNight
@TechPodcastNight
@Tech-Podcast-Night-Taipei
http://mvc.tw
Blog 是記錄知識的最佳平台
100
https://dotblogs.com.tw
http://mvc.tw
Jetbrains 重構必備工具
101
https://www.jetbrains.com/resharper/
http://mvc.tw
業界師資、實戰教學
102
https://skilltree.my
謝謝各位
• 本投影片所包含的商標與文字皆屬原著作者所有。
• 本投影片使用的圖片皆從網路搜尋。
• 本著作係採用姓名標示-非商業性-相同方式分享 3.0 台灣授權。閱讀本授權條款,請到
http://creativecommons.org/licenses/by-nc-sa/3.0/tw/,或寫信至Creative Commons, 444 Castro
Street, Suite 900, Mountain View, California, 94041, USA.
h t t p s : / / m v c . t w

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

twMVC#41 The journey of source generator
twMVC#41 The journey of source generatortwMVC#41 The journey of source generator
twMVC#41 The journey of source generator
 
twMVC#44 讓我們用 k6 來進行壓測吧
twMVC#44 讓我們用 k6 來進行壓測吧twMVC#44 讓我們用 k6 來進行壓測吧
twMVC#44 讓我們用 k6 來進行壓測吧
 
twMVC#42 Azure DevOps Service Pipeline設計與非正常應用
twMVC#42 Azure DevOps Service Pipeline設計與非正常應用twMVC#42 Azure DevOps Service Pipeline設計與非正常應用
twMVC#42 Azure DevOps Service Pipeline設計與非正常應用
 
twMVC#33玩轉 Azure 彈性部署
twMVC#33玩轉 Azure 彈性部署twMVC#33玩轉 Azure 彈性部署
twMVC#33玩轉 Azure 彈性部署
 
twMVC#23 | 快速上手 Azure Functions
twMVC#23 | 快速上手 Azure FunctionstwMVC#23 | 快速上手 Azure Functions
twMVC#23 | 快速上手 Azure Functions
 
twMVC#30 | 你應該瞭解的 container-on-azure-二三事
twMVC#30 | 你應該瞭解的 container-on-azure-二三事twMVC#30 | 你應該瞭解的 container-on-azure-二三事
twMVC#30 | 你應該瞭解的 container-on-azure-二三事
 
twMVC#21 | 你所不知道的 Visual Studio
twMVC#21 | 你所不知道的 Visual StudiotwMVC#21 | 你所不知道的 Visual Studio
twMVC#21 | 你所不知道的 Visual Studio
 
twMVC#21 | 以實例說明ASP.NET Web API 服務的開發與測試過程
twMVC#21 | 以實例說明ASP.NET Web API 服務的開發與測試過程twMVC#21 | 以實例說明ASP.NET Web API 服務的開發與測試過程
twMVC#21 | 以實例說明ASP.NET Web API 服務的開發與測試過程
 
twMVC#19 | opserver監控服務的解決
twMVC#19 | opserver監控服務的解決twMVC#19 | opserver監控服務的解決
twMVC#19 | opserver監控服務的解決
 
twMVC#36讓 Exceptionless 存管你的 Log
twMVC#36讓 Exceptionless 存管你的 LogtwMVC#36讓 Exceptionless 存管你的 Log
twMVC#36讓 Exceptionless 存管你的 Log
 
twMVC#42 Azure IoT Hub for Smart Factory
twMVC#42 Azure IoT Hub for Smart FactorytwMVC#42 Azure IoT Hub for Smart Factory
twMVC#42 Azure IoT Hub for Smart Factory
 
twMVC#29 -Learning Machine Learning with Movie Recommendation
twMVC#29 -Learning Machine Learning with Movie RecommendationtwMVC#29 -Learning Machine Learning with Movie Recommendation
twMVC#29 -Learning Machine Learning with Movie Recommendation
 
twMVC#25 | ASP.NET MVC A/B Testing 的眉眉角角
twMVC#25 | ASP.NET MVC A/B Testing 的眉眉角角twMVC#25 | ASP.NET MVC A/B Testing 的眉眉角角
twMVC#25 | ASP.NET MVC A/B Testing 的眉眉角角
 
twMVC#26 | Redis資料型別與場景的連結
twMVC#26 | Redis資料型別與場景的連結twMVC#26 | Redis資料型別與場景的連結
twMVC#26 | Redis資料型別與場景的連結
 
twMVC#29 | 當.Net Core 遇到AWS Lambda
twMVC#29 | 當.Net Core 遇到AWS LambdatwMVC#29 | 當.Net Core 遇到AWS Lambda
twMVC#29 | 當.Net Core 遇到AWS Lambda
 
twMVC#43 YARP
twMVC#43 YARPtwMVC#43 YARP
twMVC#43 YARP
 
twMVC#26 | 淺談 ASP.NET Caching 技術與實踐
twMVC#26 | 淺談 ASP.NET Caching 技術與實踐twMVC#26 | 淺談 ASP.NET Caching 技術與實踐
twMVC#26 | 淺談 ASP.NET Caching 技術與實踐
 
twMVC#22 | 一個微信專案從0到.000的效能調教之路
twMVC#22 | 一個微信專案從0到.000的效能調教之路twMVC#22 | 一個微信專案從0到.000的效能調教之路
twMVC#22 | 一個微信專案從0到.000的效能調教之路
 
twMVC#24 | 開發團隊的敏捷之路(未完成)
twMVC#24 | 開發團隊的敏捷之路(未完成)twMVC#24 | 開發團隊的敏捷之路(未完成)
twMVC#24 | 開發團隊的敏捷之路(未完成)
 
動手打造 application framework-twMVC#15
動手打造 application framework-twMVC#15動手打造 application framework-twMVC#15
動手打造 application framework-twMVC#15
 

Ähnlich wie twMVC#31網站上線了然後呢

微軟實戰課程日:玩轉雲端 技術與架構
微軟實戰課程日:玩轉雲端 技術與架構微軟實戰課程日:玩轉雲端 技術與架構
微軟實戰課程日:玩轉雲端 技術與架構
Jeff Chu
 
20130823微軟雲端平台開發者日
20130823微軟雲端平台開發者日20130823微軟雲端平台開發者日
20130823微軟雲端平台開發者日
twMVC
 
深入研究雲端應用程式平台-AppFabric
深入研究雲端應用程式平台-AppFabric深入研究雲端應用程式平台-AppFabric
深入研究雲端應用程式平台-AppFabric
John Chang
 
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
Scourgen Hong
 

Ähnlich wie twMVC#31網站上線了然後呢 (20)

SignalR實戰技巧 twmvc#17
SignalR實戰技巧 twmvc#17 SignalR實戰技巧 twmvc#17
SignalR實戰技巧 twmvc#17
 
專案分層架構 twMVC#18
專案分層架構 twMVC#18專案分層架構 twMVC#18
專案分層架構 twMVC#18
 
twMVC#18 | 專案分層架構
twMVC#18 | 專案分層架構twMVC#18 | 專案分層架構
twMVC#18 | 專案分層架構
 
twMVC#06 | Wiindows市集應用程式 開發心得分享
twMVC#06 | Wiindows市集應用程式 開發心得分享twMVC#06 | Wiindows市集應用程式 開發心得分享
twMVC#06 | Wiindows市集應用程式 開發心得分享
 
Windows 市集應用程式 開發心得分享 -twMVC#6
Windows 市集應用程式 開發心得分享 -twMVC#6Windows 市集應用程式 開發心得分享 -twMVC#6
Windows 市集應用程式 開發心得分享 -twMVC#6
 
Meteor
MeteorMeteor
Meteor
 
微軟實戰課程日:玩轉雲端 技術與架構
微軟實戰課程日:玩轉雲端 技術與架構微軟實戰課程日:玩轉雲端 技術與架構
微軟實戰課程日:玩轉雲端 技術與架構
 
一個微信專案從0到000的效能調教
一個微信專案從0到000的效能調教一個微信專案從0到000的效能調教
一個微信專案從0到000的效能調教
 
twMVC#01 | ASP.NET MVC 的第一次親密接觸
twMVC#01 | ASP.NET MVC 的第一次親密接觸twMVC#01 | ASP.NET MVC 的第一次親密接觸
twMVC#01 | ASP.NET MVC 的第一次親密接觸
 
輕鬆上手Asp.net web api 2.1-twMVC#14
輕鬆上手Asp.net web api 2.1-twMVC#14輕鬆上手Asp.net web api 2.1-twMVC#14
輕鬆上手Asp.net web api 2.1-twMVC#14
 
twMVC#14 | 輕鬆上手ASP.NET Web API 2
twMVC#14 | 輕鬆上手ASP.NET Web API 2twMVC#14 | 輕鬆上手ASP.NET Web API 2
twMVC#14 | 輕鬆上手ASP.NET Web API 2
 
Webify 一键部署
Webify 一键部署Webify 一键部署
Webify 一键部署
 
20130823微軟雲端平台開發者日
20130823微軟雲端平台開發者日20130823微軟雲端平台開發者日
20130823微軟雲端平台開發者日
 
ASP.NET Core 3.0 新功能
ASP.NET Core 3.0 新功能ASP.NET Core 3.0 新功能
ASP.NET Core 3.0 新功能
 
與 Asp.net mvc 的第一次親密接觸 - twMVC#1
與 Asp.net mvc 的第一次親密接觸 - twMVC#1與 Asp.net mvc 的第一次親密接觸 - twMVC#1
與 Asp.net mvc 的第一次親密接觸 - twMVC#1
 
Beyond rails server
Beyond rails serverBeyond rails server
Beyond rails server
 
深入浅出 V cloud director
深入浅出 V cloud director深入浅出 V cloud director
深入浅出 V cloud director
 
深入研究雲端應用程式平台-AppFabric
深入研究雲端應用程式平台-AppFabric深入研究雲端應用程式平台-AppFabric
深入研究雲端應用程式平台-AppFabric
 
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
 
網站上線了,然後呢?
網站上線了,然後呢?網站上線了,然後呢?
網站上線了,然後呢?
 

Mehr von twMVC

Mehr von twMVC (14)

twMVC 47_Elastic APM 的兩三事
twMVC 47_Elastic APM 的兩三事twMVC 47_Elastic APM 的兩三事
twMVC 47_Elastic APM 的兩三事
 
twMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC#46_SQL Server 資料分析大躍進 Machine Learning ServicestwMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
 
.NET 7 家族新成員: Microsoft Orleans v7
.NET 7 家族新成員:Microsoft Orleans v7.NET 7 家族新成員:Microsoft Orleans v7
.NET 7 家族新成員: Microsoft Orleans v7
 
twMVC#46 一探 C# 11 與 .NET 7 的神奇
twMVC#46 一探 C# 11 與 .NET 7 的神奇twMVC#46 一探 C# 11 與 .NET 7 的神奇
twMVC#46 一探 C# 11 與 .NET 7 的神奇
 
twMVC#44 如何測試與保護你的 web application with playwright
twMVC#44 如何測試與保護你的 web application with playwrighttwMVC#44 如何測試與保護你的 web application with playwright
twMVC#44 如何測試與保護你的 web application with playwright
 
twMVC#43 C#10 新功能介紹
twMVC#43 C#10 新功能介紹twMVC#43 C#10 新功能介紹
twMVC#43 C#10 新功能介紹
 
twMVC#41 hololens2 MR
twMVC#41 hololens2 MRtwMVC#41 hololens2 MR
twMVC#41 hololens2 MR
 
twMVC#36C#的美麗與哀愁
twMVC#36C#的美麗與哀愁twMVC#36C#的美麗與哀愁
twMVC#36C#的美麗與哀愁
 
twMVC#36.NetCore 3快速看一波
twMVC#36.NetCore 3快速看一波twMVC#36.NetCore 3快速看一波
twMVC#36.NetCore 3快速看一波
 
twMVC#30 | Bootstrap 搶先玩
twMVC#30 | Bootstrap 搶先玩twMVC#30 | Bootstrap 搶先玩
twMVC#30 | Bootstrap 搶先玩
 
twMvc#30 | 技術人員與業務團隊的無礙的溝通法則
twMvc#30 | 技術人員與業務團隊的無礙的溝通法則twMvc#30 | 技術人員與業務團隊的無礙的溝通法則
twMvc#30 | 技術人員與業務團隊的無礙的溝通法則
 
twMVC#29 | 從電影推薦預測開始學機器學習
twMVC#29 | 從電影推薦預測開始學機器學習twMVC#29 | 從電影推薦預測開始學機器學習
twMVC#29 | 從電影推薦預測開始學機器學習
 
twMVC#28 | visual studio 2017 新功能介紹
twMVC#28 | visual studio 2017 新功能介紹twMVC#28 | visual studio 2017 新功能介紹
twMVC#28 | visual studio 2017 新功能介紹
 
twMVC#27 | C# 7.0 新功能介紹
twMVC#27 | C# 7.0 新功能介紹twMVC#27 | C# 7.0 新功能介紹
twMVC#27 | C# 7.0 新功能介紹
 

twMVC#31網站上線了然後呢