architectural patterns for the cloud
TRANSCRIPT
APRIL 12, 2023 | SLIDE 1
APRIL 12, 2023 | SLIDE 2
Architectural Patterns for the CloudMaarten Balliauw@maartenballiauw
APRIL 12, 2023 | SLIDE 4
Who am I? Maarten Balliauw Antwerp, Belgium www.realdolmen.com Focus on web
ASP.NET MVC, Windows Azure, SignalR, ... MVP Windows Azure & ASPInsider
http://blog.maartenballiauw.be @maartenballiauw Author: Pro NuGet - http://amzn.to/pronuget
APRIL 12, 2023 | SLIDE 5
Agenda Quick recap: Windows Azure What’s different in the cloud? Rethinking apps Conclusion
APRIL 12, 2023 | SLIDE 6
Quick recapWindows Azure
APRIL 12, 2023 | SLIDE 7
Windows Azure is a cloud platform
On-demand Self-service Pay per use Highly automated
APRIL 12, 2023 | SLIDE 8
Windows Azure Components
Application Services Storage Services Foundation Services
Compute
BI Marketplace
Storage SQL Azure
CDN
Service Bus
Connect
Caching ACS
APRIL 12, 2023 | SLIDE 9
What’s differentin the cloud?
APRIL 12, 2023 | SLIDE 10
Differences with your infrastructure
Uniform Automated Designed for failure Designed for scale It’s not in your datacenter
APRIL 12, 2023 | SLIDE 11
Uniform Every machine +/- the same No specialized hardware No specialized OS*
APRIL 12, 2023 | SLIDE 12
DemoCustomizing the Windows Azure virtual machine
APRIL 12, 2023 | SLIDE 13
Automated Makes decisions on provisioning &
updating Monitors health The platform knows what’s best
Not necessarily for your app…
APRIL 12, 2023 | SLIDE 14
Designed for failure
ROLE
VM1 VM3
VM5 VM8
VM2 VM4
VM6 VM9
VM6 VM9UD 1
UD 2
APRIL 12, 2023 | SLIDE 15
Designed for scale Scale out Stateless
ROLE
VM1 VM2 VM3 VM4
APRIL 12, 2023 | SLIDE 16
It’s not in your datacenter Integration Authentication
APRIL 12, 2023 | SLIDE 17
Rethinking appsWhat do I have to think about?
APRIL 12, 2023 | SLIDE 18
Scenario: Newspaper website National & International Sudden spikes in usage Dynamic content Static content
APRIL 12, 2023 | SLIDE 19
Current architecture Will work on the cloud! Will fail on the cloud!
WEB FARM
APRIL 12, 2023 | SLIDE 20
Design for failure
APRIL 12, 2023 | SLIDE 21
Assume everything will fail Automated service maintenance Compute node crash Storage throttling SQL Azure throttling Connectivity Your code
APRIL 12, 2023 | SLIDE 22
Retry everythingSQL Azure Error 40501The service is currently busy. Retry the request after 10 seconds.
Retry against anything that might be externalSQL Azure, Windows Azure Storage, Service Bus, …
http://windowsazurecat.com/2011/02/transient-fault-handling-framework/
APRIL 12, 2023 | SLIDE 23
The entire datacenter fails! Run in 2+ datacenters Keep data synchronized
All data or limit scope
APRIL 12, 2023 | SLIDE 24
Refactoring the architecture
WEB FARM WEB FARM
SQL Azure Data Sync
APRIL 12, 2023 | SLIDE 25
Windows Azure Data CentersNorth America Region Europe Region Asia Pacific Region
North Central US
South Central US
Northern Europe
Western Europe East Asia
South East Asia
50ms
100ms
APRIL 12, 2023 | SLIDE 26
Windows Azure Traffic Manager
APRIL 12, 2023 | SLIDE 27
Windows Azure Traffic Manager Strategies
Round-robin Fail-over Performance (geo)
Solves datacenter outage
APRIL 12, 2023 | SLIDE 28
Are we there yet?
WEB FARM WEB FARM
APRIL 12, 2023 | SLIDE 29
Solutions to a SPOF being down
Set a monitoring endpoint for TM Take the entire datacenter out of the loop
Take the SPOF out of the story Degrade gracefully
APRIL 12, 2023 | SLIDE 30
Refactoring our architecture
WEB FARM WEB FARM
APRIL 12, 2023 | SLIDE 31
Design for scale*and failure
APRIL 12, 2023 | SLIDE 32
Belgians are not used to snow
What will happen to our architecture?
APRIL 12, 2023 | SLIDE 33
Here’s what will happen…
WEB FARM WEB FARM
APRIL 12, 2023 | SLIDE 34
Solution: scale out! Add more VM’s! Autoscaling (WASABi)
Windows Azure Autoscaling Application Block Enterprise Library http
://entlib.codeplex.com/wikipage?title=WASABiBetaReleaseNotes&referringTitle=EntLib5Azure
APRIL 12, 2023 | SLIDE 35
Solution: scale out! Add more VM’s! Autoscaling (as-a-Service)
www.opstera.com
APRIL 12, 2023 | SLIDE 36
Here’s what will happen…
WEB FARM WEB FARM
APRIL 12, 2023 | SLIDE 37
SQL Azure Monitored by the platform The platform does not like high DB traffic
Throttling & retries
APRIL 12, 2023 | SLIDE 38
Caching Most of our users are doing reads Cache content near where it’s needed
Windows Azure Caching Blob Storage
APRIL 12, 2023 | SLIDE 39
Refactoring our architecture
WEB FARM WEB FARM
APRIL 12, 2023 | SLIDE 40
Caching How do you populate it? When do you populate it? When do you invalidate it?
APRIL 12, 2023 | SLIDE 41
Work asynchrounously Read from cache Present? Use cache Not present? Ask to cache it & read from
DB
APRIL 12, 2023 | SLIDE 42
Refactoring our architecture
WEB FARM WEB FARM WORKER FARM
APRIL 12, 2023 | SLIDE 43
A typical web request… 1 request is dynamic 493 requests are static*
Get that static content out of your servers! Cache content near where it’s needed
APRIL 12, 2023 | SLIDE 44
Windows Azure CDN
APRIL 12, 2023 | SLIDE 45
Refactoring our architecture
WEB FARM WEB FARM WORKER FARM
APRIL 12, 2023 | SLIDE 46
Conclusion
APRIL 12, 2023 | SLIDE 47
Key takeaways Cloud is different Design for failure Design for scale Work asynchronously Cache close to where it’s needed Also think price vs. Allowed outage
APRIL 12, 2023 | SLIDE 48
One more… Learn from others! Amazon - http://slidesha.re/AlaHIG Trello - http://bit.ly/xO5G9e YouPorn - http://bit.ly/yUSanQ StackOverflow - http://bit.ly/xkLvH9 InstaGram - http://bit.ly/xbWuzx … (highscalability.com)
APRIL 12, 2023 | SLIDE 49
THANK YOU!
http://blog.maartenballiauw.be@maartenballiauw
http://amzn.to/pronugetor Install-Package ProNuGet