使用 asp.net mvc 搭配 windows azure 建構可擴展網站
DESCRIPTION
使用 ASP.NET MVC 搭配 Windows Azure 建構可擴展網站. Sky Chang 天空的垃圾場 Blog.sanc.idv.tw. Sky Chang. Windows Azure 微軟最有價值專家. s [email protected]. 天空的垃圾場. ASP.NET MVC ALM Windows Azure. b log.sanc.idv.tw. 資料來源. Windows Azure : http://www.windowsazure.com 天空的垃圾場 : http:// blog.sanc.idv.tw - PowerPoint PPT PresentationTRANSCRIPT
使用 ASP.NET MVC 搭配Windows Azure 建構可擴展網站
Sky Chang天空的垃圾場Blog.sanc.idv.tw
Sky ChangWindows Azure 微軟最有價值專家
天空的垃圾場blog.sanc.idv.tw
• ASP.NET MVC• ALM• Windows [email protected]
m
資料來源
Windows Azure : http://www.windowsazure.com
天空的垃圾場 : http://blog.sanc.idv.tw
Study4.TW : http://study4.tw
Windows Azure 雲端平台開發夥伴社群https://www.facebook.com/cloudexpert
Azure Taiwan User Group : https://www.facebook.com/groups/AzureTWUG/
MSDN : http://social.msdn.microsoft.com/Forums/zh-tw/home
Cloud ServiceDemo
!! 警告 !!今天沒有笑話,如過程中有任何睡意,屬於正常現象
Agenda
Cloud Service
SLA 99.95
Storage ( 程式架構 )
Scaling - Cloud Service Cache ( LB 、 Session)
Azure 架構 ( Web Role and Work Role )
Cloud Service
Your Datacenter
Virtualization
O/S
Hardware
Network
Data
Applications
Firewall
Web Sites
Applications
Data
Cloud Services
Applications
Firewall Rules
Data
Virtual Network
Virtual Machines
Virtual Network
Data
Applications
Firewall Rules
O/S
Focus on the Application
Windows Azure
What is a Cloud Service?
此容器包含了關聯的 Service Roles
Web Role Worker Role
Web Role
就是 -> IIS 7, 7.5 or IIS 8.0*ASP.NET 3.5 SP1, 4.0 or 4.5* – 64bit Hosts•Web Forms or MVC
•FastCGI applications (e.g. PHP)
Worker Role Patterns
Queue Polling Worker•Poll and Pop Messages 透過 while(true) 進行迴圈•E.g. 背景處理大量資料Listening Worker Role•建立 TCP Listener 或 WCF Service 、 Web API Host
•E.g. 執行 .NET SMTP server 或 WCF Service
External Process Worker Role•利用 OnStart 或 Run method 執行 Process.Start()
•啟動 Task 在背景工作•E.g. 執行 database server, web server, 分散式 cache
Cloud ServiceDemo
守則一 不要想著放上雲 要想著如何放Web Role 和 Work Role 各有不同的效能,請選擇適合的家
Scaling
1保留實體
:-)
實體
共享Web Role or Work Role
2實體
:-)
實體
:-)
實體
Web Role or Work Role
2共享
實體
:-)
實體
:-):-)
:-) :-)
:-)
:-) :-)
實體
Web Role or Work Role
實體
:-)
CPU 使用率
auto-scaling
實體
:-)
實體
:-)
ScalingDemo
守則二 架構更勝於擴充雖然可以輕易擴展,但不代表不用背負 app 的效能。
Cloud Service Cache
:-) :-) :-)
Cloud Service load balance
:-) :-) :-)
SQL Database ( Azure Cache )
Cloud Service load balance
Cache on Role co-located
Cache on Role Caching on Dedicated Role
Cloud Service CacheDemo
守則三 設計無狀態的網站天然的尚好 !!!
Storage
Persistent Disks and Highly Durable
Windows Azure Storage
Windows Azure Storage (Disaster Recovery)
Virtual Machine
Persistent Disks and Highly Durable
Windows Azure Storage
Windows Azure Storage (Disaster Recovery)
Virtual Machine
Virtual Machine
洋蔥架構 應用程式係圍繞著一個獨立的物件模型
來建構。 內層定義介面,外層實作介面。 耦合的方向是朝向中央。 應用程式的所有核心程式碼可以在與基
礎建設分離的情況下正常運行。 ( By 蔡煥麟老師翻譯 )
核心 : IOC & DI
洋蔥架構
架構 DemoDemo
守則四 要 Interface 化隔離…才是自保之道
SLA 99.95
Service Level Agreements
包含項目Compute Hardware 故障 (disk, cpu, memory)
Datacenter 故障 - Network 故障 , power 故障Hardware 升級 , Software 維護– Host OS 升級
不包含項目VM 容器崩潰 , 客戶 OS 自行升級
99.95% for multiple role
instances4.38 hours of downtime 每一年
Server 2
SLA 99.95
Availability set
Server 1
Fault and Update DomainsFault Domains•代表有可能一起失敗的同一組資源•例如同一個機架、同一台 Server
Update Domains•代表一起更新的同一組資源•例如 OS 更新
Fault Domain
Rack
Fault and Update DomainsFault Domain
Rack
INSTANCE
INSTANCE
INSTANCE
INSTANCE
INSTANCE
INSTANCE
INSTANCE
INSTANCE
UD #1
UD #1
UD #2
UD #2
Virtual Machine Availability SetsUpdate Domains are honored by host OS updates
Fault DomainRack
Fault DomainRack
IIS1
SQL1
IIS2
SQL2
UD #2
UD #2
UD #1
UD #1
SQL Server2
SQL Server1
End to End Highly Available SolutionRedundancy at every level
IIS Web Application
Web Role
IIS Web Application
Web Role
LB
SQ
L M
irro
ring
Internet
SQL-AVSET
IIS-AVSET
守則五 真的需要 99.95!?事情沒有你想的那麼簡單… .
Azure 架構
Queue-Based Load Leveling Pattern
Queue-Based Load Leveling Pattern
Asynchronous Messaging
Azure 架構Demo
守則六 搭配雲端的架構
And then !? User Story 、 Test Case 、 BDD 、 TDD 、 Unit Test
SQL Server AlwaysOn ( HA ) Windows Azure Active Directory
天空的垃圾場
Thank You
50
提醒
上滿 4 堂課 交回問卷 問卷禮
Microsoft MVP Award報名申請 : [email protected]
參加美國微軟產品組線上會議 MVP logo
使用權
提供產品建議給微軟產品組
美國 MVP全球年會
MSDN Online combo Subscription
MVP 專屬討論區 Knowledge Base
Technical Support3 個專業資訊人員技術支援服務
MVP 專屬 live meeting account
MVA 學習資源 ( 持續更新中文課程 )• 立即上手 Windows Azure
http://aka.ms/mva-azure-overview • SQL Server 2014 線上交易記憶體內資料庫簡介
http://aka.ms/mva-sql2014 • 針對網站開發人員的 Visual Studio 使用技巧
http://aka.ms/vstips4web • Web Services 開發實戰 : 使用 ASP.NET Web API 2
http://aka.ms/mva-webapi2 • Visual Studio Online 與 Git 版本控管實戰
http://aka.ms/mva-vso-git • 使用 App Studio 快速開發 Windows Phone 應用程式
http://aka.ms/mva-appstudio
天空的垃圾場