44
True story of re- architecting website for scale on Windows Azure Sergejus Barinovas @sergejusb | bebetterdeveloper.com

True story of re architecting website for scale on windows azure

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: True story of re architecting website for scale on windows azure

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

1,3 billion+ web transactions / day

3 datacenters / 300+ servers

BACKGROUND

Page 3: True story of re architecting website for scale on windows azure

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

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

~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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

FURTHER SCALING

strategy for the future

Page 25: True story of re architecting website for scale on windows azure

Website gets more requests than can handle

SCALING ISSUE #5

Page 26: True story of re architecting website for scale on windows azure

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

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

Database gets more queries than can handle

SCALING ISSUE #6

Page 29: True story of re architecting website for scale on windows azure

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

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

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

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

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

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

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

DEMO

scaling bebetterdeveloper.com

Page 37: True story of re architecting website for scale on windows azure

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

WINDOWS AZURE SERVICES

Page 39: True story of re architecting website for scale on windows azure

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

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

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

HAPPY SCALING!Sergejus Barinovas@sergejusb | bebetterdeveloper.com

Page 43: True story of re architecting website for scale on windows azure

 

Page 44: True story of re architecting website for scale on windows azure

Q&A