![Page 1: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/1.jpg)
True story of re-architecting website for scale on Windows AzureSergejus Barinovas@sergejusb | bebetterdeveloper.com
![Page 2: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/2.jpg)
1,3 billion+ web transactions / day
3 datacenters / 300+ servers
BACKGROUND
![Page 3: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/3.jpg)
Lithuanian-based startup
20K+ unique visitors per month
can go viral any day soon
A STORY…
![Page 4: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/4.jpg)
INITIAL ARCHITECTURE
HOSTING WINDOWS AZURE
website, blogstatic content
database
photos
Linux | Apache | MySQL | PHP
Linux | Nginx | FTP
![Page 5: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/5.jpg)
~260K page views / month
~9K page views / day
~1K page views / hour
~0,2 page views / second
IS 20K+ UNIQUE VISITORS A LOT?
but spikes up-to
50 page views / second
![Page 6: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/6.jpg)
Cloud gives more flexibility and scalability options
Windows Azure is Microsoft’s Cloud Platform
BizSpark gives Windows Azure for free for 1 year
Let’s move!
MOTIVATION
![Page 7: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/7.jpg)
WINDOWS AZURE VIRTUAL MACHINE
Windows Server or Linux
Attachable storage
Scaling and load balancing
Virtual private network
![Page 8: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/8.jpg)
BEFORE
HOSTING WINDOWS AZURE
website, blogstatic content
database
photos
Linux | Apache | MySQL | PHP
Linux | Nginx | FTP
![Page 9: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/9.jpg)
AFTER
WINDOWS AZURE
website, blogstatic content
database
photos
Linux | Apache | MySQL | PHP
Linux | Nginx | FTP
![Page 10: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/10.jpg)
Dedicated VM for storing content is suboptimal in
the cloud
Manual management & scaling
No backups
SCALING ISSUE #1
![Page 11: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/11.jpg)
WINDOWS AZURE BLOB STORAGE
Highly available (3 copies) and
scalable
Can be exposed publically over
HTTP
Geo-replication across datacenters
9+ trillion objects
![Page 12: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/12.jpg)
BEFORE STEP #1
WINDOWS AZURE
website, blogstatic content
database
photos
Linux | Apache | MySQL | PHP
Linux | Nginx | FTP
![Page 13: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/13.jpg)
AFTER STEP #1
WINDOWS AZURE
website, blogstatic content
database
photos
Linux | Apache | MySQL | PHP
HTTP
![Page 14: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/14.jpg)
Static content on the same VM as website and
blog
Different scalability targets
Photos are part of static content
SCALING ISSUE #2
![Page 15: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/15.jpg)
BEFORE STEP #2
WINDOWS AZURE
website, blogstatic content
database
photos
Linux | Apache | MySQL | PHP
HTTP
![Page 16: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/16.jpg)
AFTER STEP #2
WINDOWS AZURE
website, blogdatabase
static content
Linux | Apache | MySQL | PHP
HTTP
![Page 17: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/17.jpg)
Database on the same VM as website and blog
Very different scalability targets and strategies
SCALING ISSUE #3
![Page 18: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/18.jpg)
BEFORE STEP #3
WINDOWS AZURE
website, blogdatabase
static content
Linux | Apache | MySQL | PHP
HTTP
![Page 19: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/19.jpg)
AFTER STEP #3
WINDOWS AZURE
database static content
Linux | MySQL HTTP
website, blog
Linux | Apache | PHP
![Page 20: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/20.jpg)
Blog on the same VM as website
Different scalability targets
SCALING ISSUE #4
![Page 21: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/21.jpg)
WINDOWS AZURE WEBSITES
Cloud hosting
ASP.NET, Node.js or PHP runtimes
Git, Dropbox, TFS, VS, etc.
deployment
Auto-scaling
![Page 22: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/22.jpg)
BEFORE STEP #4
WINDOWS AZURE
database static content
Linux | MySQL HTTP
website, blog
Linux | Apache | PHP
![Page 23: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/23.jpg)
AFTER STEP #4
WINDOWS AZURE
database static content
Linux | MySQL HTTP
website
Linux | Apache | PHP
blog
IIS | PHP
![Page 24: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/24.jpg)
FURTHER SCALING
strategy for the future
![Page 25: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/25.jpg)
Website gets more requests than can handle
SCALING ISSUE #5
![Page 26: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/26.jpg)
BEFORE STEP #5
WINDOWS AZURE
database static content
Linux | MySQL HTTP
website
Linux | Apache | PHP
blog
IIS | PHP
![Page 27: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/27.jpg)
BEFORE STEP #5
WINDOWS AZURE
database static content
Linux | MySQL HTTP
website
Linux | Apache | PHP
blog
IIS | PHP
![Page 28: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/28.jpg)
Database gets more queries than can handle
SCALING ISSUE #6
![Page 29: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/29.jpg)
BEFORE STEP #6
WINDOWS AZURE
database static content
Linux | MySQL HTTP
website
Linux | Apache | PHP
blog
IIS | PHP
![Page 30: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/30.jpg)
AFTER STEP #6
WINDOWS AZURE
read-onlydatabase
static content
HTTP
website
Linux | Apache | PHP
blog
IIS | PHP
write-onlydatabase
Linux | MySQL
Linux | MySQL
![Page 31: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/31.jpg)
Read-only database gets more queries than can
handle
SCALING ISSUE #7
![Page 32: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/32.jpg)
BEFORE STEP #7
WINDOWS AZURE
read-onlydatabase
static content
HTTP
website
Linux | Apache | PHP
blog
IIS | PHP
write-onlydatabase
Linux | MySQL
Linux | MySQL
![Page 33: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/33.jpg)
AFTER STEP #7
WINDOWS AZURE
read-onlydatabase
static content
HTTP
website
Linux | Apache | PHP
blog
IIS | PHP
write-onlydatabase
Linux | MySQL
Linux | MySQL
![Page 34: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/34.jpg)
Write-only database gets more queries than can
handle
SCALING ISSUE #8
![Page 35: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/35.jpg)
This is a nice issue to have
Split write-only database into shards with multiple
read-only slaves for each shard accessed via layer
of distributed cache
IN SHORT
![Page 36: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/36.jpg)
DEMO
scaling bebetterdeveloper.com
![Page 37: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/37.jpg)
ARCHITECTURE
WINDOWS AZURE
database static content
SQL Database
HTTP
blog
IIS | PHP
DB
![Page 38: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/38.jpg)
WINDOWS AZURE SERVICES
![Page 39: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/39.jpg)
Windows Azure Virtual Machine for VMs
Windows Azure Blob Storage for static content
Windows Azure Website for hosting web site
DISCUSSED WINDOWS AZURE SERVICES
![Page 40: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/40.jpg)
Windows Azure Service Bus for messaging
Windows Azure Cache Service for distributed
caching
Windows Azure Notification Hubs for push
notification
Windows Azure HDInsight for big data
OTHER WINDOWS AZURE SERVICES
![Page 41: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/41.jpg)
FULL LIST OF WINDOWS AZURE SERVICES
DATA SERVICES
SQL Database
Storage
HDInsight
Cache
Backup
Recovery
Manager
APP SERVICES
Media Services
Service Bus
Notification Hubs
BizTalk Services
Active Directory
Multi-Factor Auth
NETWORK
SERVICES
Virtual Network
Traffic Manager
COMPUTE
Virtual Machines
Web Sites
Mobile Services
Cloud Services
Pricing calculator: http://www.windowsazure.com/en-us/pricing/calculator/?
scenario=full
![Page 42: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/42.jpg)
HAPPY SCALING!Sergejus Barinovas@sergejusb | bebetterdeveloper.com
![Page 43: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/43.jpg)
![Page 44: True story of re architecting website for scale on windows azure](https://reader033.vdocument.in/reader033/viewer/2022061114/54582b04af79596b478b6587/html5/thumbnails/44.jpg)
Q&A