1 / 54

使用 ASP.NET MVC 搭配 Windows Azure 建構可擴展網站

使用 ASP.NET MVC 搭配 Windows Azure 建構可擴展網站. Sky Chang 天空的垃圾場 Blog.sanc.idv.tw. Sky Chang. Windows Azure 微軟最有價值專家. s ky.chang@mentortrust.com. 天空的垃圾場. ASP.NET MVC ALM Windows Azure. b log.sanc.idv.tw. 資料來源. Windows Azure : http://www.windowsazure.com 天空的垃圾場 : http:// blog.sanc.idv.tw

Download Presentation

使用 ASP.NET MVC 搭配 Windows Azure 建構可擴展網站

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 使用ASP.NET MVC搭配Windows Azure建構可擴展網站 Sky Chang 天空的垃圾場 Blog.sanc.idv.tw

  2. Sky Chang Windows Azure 微軟最有價值專家 sky.chang@mentortrust.com 天空的垃圾場 • ASP.NET MVC • ALM • Windows Azure blog.sanc.idv.tw

  3. 資料來源 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

  4. Cloud Service Demo

  5. !!警告!! 今天沒有笑話,如過程中有任何睡意,屬於正常現象

  6. Agenda Cloud Service SLA 99.95 Storage ( 程式架構 ) Scaling - Cloud Service Cache ( LB 、 Session) Azure架構 ( Web Role and Work Role )

  7. Cloud Service

  8. Windows Azure • Your Datacenter • Virtual Machines • Cloud Services • Web Sites Applications Applications Applications Applications Data Data Data Data Firewall Firewall Rules Firewall Rules Network Virtual Network Virtual Network O/S O/S Virtualization Hardware Focus on the Application

  9. What is a Cloud Service? 此容器包含了關聯的Service Roles Web Role Worker Role

  10. 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)

  11. 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

  12. Cloud Service Demo

  13. 守則一 不要想著放上雲 要想著如何放 Web Role和Work Role各有不同的效能,請選擇適合的家

  14. Scaling

  15. Web Role or Work Role 共享 實體 保留實體 :-) 1

  16. Web Role or Work Role 實體 實體 實體 :-) :-) 2

  17. Web Role or Work Role 共享 實體 實體 實體 :-) :-) :-) :-) :-) :-) :-) :-) 2

  18. auto-scaling CPU 使用率 實體 實體 實體 :-) :-) :-)

  19. Scaling Demo

  20. 守則二 架構更勝於擴充 雖然可以輕易擴展,但不代表不用背負app的效能。

  21. Cloud Service Cache

  22. Cloud Service loadbalance Network Load Balancer Web Role instance Web Role instance Web Role instance :-) :-) :-)

  23. Cloud Service loadbalance Network Load Balancer Web Role instance Web Role instance Web Role instance :-) :-) :-) SQL Database ( Azure Cache )

  24. Cache on Role co-located

  25. Cache on Role Caching on Dedicated Role

  26. Cloud Service Cache Demo

  27. 守則三 設計無狀態的網站 天然的尚好!!!

  28. Storage

  29. Persistent Disks and Highly Durable Windows Azure Storage (Disaster Recovery) Windows Azure Storage Virtual Machine

  30. Persistent Disks and Highly Durable Windows Azure Storage (Disaster Recovery) Windows Azure Storage Virtual Machine Virtual Machine

  31. 洋蔥架構 • 應用程式係圍繞著一個獨立的物件模型來建構。 • 內層定義介面,外層實作介面。 • 耦合的方向是朝向中央。 • 應用程式的所有核心程式碼可以在與基礎建設分離的情況下正常運行。 • (By 蔡煥麟老師翻譯 ) • 核心 : IOC & DI

  32. 洋蔥架構

  33. 架構Demo Demo

  34. 守則四 要Interface化 隔離…才是自保之道

  35. SLA 99.95

  36. Service Level Agreements Availability set 99.95% for multiple role instances 4.38 hours of downtime 每一年 Server 2 Server 1 包含項目 Compute Hardware 故障(disk, cpu, memory) Datacenter 故障 - Network 故障, power 故障 Hardware 升級, Software 維護– Host OS 升級 不包含項目 VM容器崩潰, 客戶OS自行升級 SLA 99.95

  37. Fault Domains 代表有可能一起失敗的同一組資源 例如同一個機架、同一台Server Update Domains 代表一起更新的同一組資源 例如OS更新 Fault and Update Domains

  38. Fault and Update Domains Fault Domain Fault Domain Rack Rack Web Role UD #1 UD #2 INSTANCE INSTANCE INSTANCE INSTANCE Worker Role UD #1 UD #2 INSTANCE INSTANCE INSTANCE INSTANCE

  39. Virtual Machine Availability SetsUpdate Domains are honored by host OS updates Fault Domain Fault Domain Rack Rack Virtual Machine Virtual Machine Availability Set IIS2 IIS1 UD #2 UD #1 Availability Set Virtual Machine Virtual Machine SQL1 SQL2 UD #1 UD #2

  40. End to End Highly Available SolutionRedundancy at every level SQL Server1 SQL-AVSET IIS-AVSET IIS Web Application Internet • Web Role • SQL Mirroring LB IIS Web Application SQL Server2 • Web Role

  41. 守則五 真的需要99.95!? 事情沒有你想的那麼簡單….

  42. Azure 架構

  43. Queue-Based Load Leveling Pattern

  44. Queue-Based Load Leveling Pattern

  45. Asynchronous Messaging

  46. Azure 架構 Demo

  47. 守則六 搭配雲端的架構

  48. And then !? • User Story、Test Case、BDD、TDD、Unit Test • SQL Server AlwaysOn ( HA ) • Windows Azure Active Directory

  49. Thank You 天空的垃圾場

  50. 提醒 上滿4堂課 交回問卷 問卷禮

More Related