Ionut Antiu
www.get-jukebox.com
@johnnyantiu
1. What are we talking about
2. What is Style Jukebox
3. What were the challenges
4. Wrap up
Style Jukebox is a High Fidelity cloud-music streaming service
that helps you keep all your music – be it bought, self-produced,
or imported from CDs or other media, always backed up and
synced across all your devices.
TRACTION
125,000+ registered users
52,000+ MAU
Peak of 13,000 users DAU
4,5+ million songs stored in the Cloud
50,000 – 100,000 songs listened daily
Low latency
Scalability
High Availability
OBJECTIVES
What is the basic Cloud architecture?
“LE SERVER”
Database SQL
Storage
API
LE CLIENT APP LE CLIENT APP LE CLIENT APP
“LE SERVER”
API
LE CLIENT APP LE CLIENT APP LE CLIENT APP
STORAGE
Windows Azure Storage Blobs
DATABASE
SQL Azure
Scale Up
Scale Out
Database, API, Content bandwidth, Website
Scale Up
One operation that cannot
be divided requires more compute power
(Audio/Video encoding, Your own DB, etc.)
Basic A1
1 Core AMD CPU
1,75 GB RAM
EUR 41/month*
G5, 32 cores
Intel Xeon
448 GB RAM
6 TB
EUR 4865/month*
Scale Out
Used for API, Website, etc.
Ex: Each machine can have a limited number of connected users
Basic A1
1 Core AMD CPU
1,75 GB RAM
EUR 41/month*
4x
Basic A1
1 Core AMD CPU
1,75 GB RAM
EUR 41/month*
SYNC SERVICE
API (GetSongURL, Login)
LE CLIENT APP LE CLIENT APP LE CLIENT APP
STORAGE
Windows Azure Storage Blobs
DATABASE
SQL Azure
BLOCK SERVICE
API (DownloadSong, UploadSong)
SYNC SERVICE
API (GetSongURL, Login)
LE CLIENT APP LE CLIENT APP LE CLIENT APP
STORAGE
Windows Azure Storage Blobs
DATABASE
SQL Azure
BLOCK SERVICE
API (DownloadSong, UploadSong)
MEMCACHE
Redis
Memcache Worker
The Memcache Worker
predicts and prepares the
results
Memcache Hit Ratio 86-91%
Reduced time of response with
80% to an average of 250ms
SYNC SERVICE
API (GetSongURL, Login)
LE CLIENT APP LE CLIENT APP LE CLIENT APP
STORAGE
Windows Azure Storage Blobs
DATABASE
SQL Azure
BLOCK SERVICE
API (DownloadSong, UploadSong)
MEMCACHE
Redis
Memcache Worker
CDN
Windows Azure CDN
CDN Worker
SYNC SERVICE
API (GetSongURL, Login)
LE CLIENT APP LE CLIENT APP LE CLIENT APP
STORAGE
Windows Azure Storage Blobs
DATABASE
SQL Azure
BLOCK SERVICE
API (DownloadSong, UploadSong)
MEMCACHE
Redis
Memcache Worker
CDN
Windows Azure CDN
CDN Worker
STORAGE
Upload Buffer
Upload Processing
SYNC SERVICE
API (GetSongURL, Login)
LOAD BALANCER
LE CLIENT APP LE CLIENT APP LE CLIENT APP
STORAGE
Windows Azure Storage Blobs
DATABASE
SQL Azure
BLOCK SERVICE
API (DownloadSong, UploadSong)
LOAD BALANCER
MEMCACHE
Redis
Memcache Worker
CDN
Windows Azure CDN
CDN Worker
STORAGE
Upload Buffer
Upload Processing
Download Processing
Load Balancer
Integrated in the Azure Cloud Services
Makes sure all instances have the same load
Auto-Scale creates new instances or removes automatically
SYNC SERVICE
API (GetSongURL, Login)
LOAD BALANCER
LE CLIENT APP LE CLIENT APP LE CLIENT APP
STORAGE
Windows Azure Storage Blobs
DATABASE
SQL Azure
BLOCK SERVICE
API (DownloadSong, UploadSong)
LOAD BALANCER
MEMCACHE
Redis
Memcache Worker
CDN
Windows Azure CDN
CDN Worker
STORAGE
Upload Buffer
Upload Processing
Download Processing
TRAFFIC MANAGER
SYNC SERVICE – WEST US
API (GetSongURL, Login)
DATABASE - AMSTERDAM
SQL Azure
SYNC SERVICE – WEST US
API (GetSongURL, Login)
DATABASE - AMSTERDAM
SQL Azure
~ 9,000 km * 3 calls = ~ 30,000 km
30,000 km : 300,000km/s = 100 ms
LE CLIENT APP LE CLIENT APP LE CLIENT APP
TRAFFIC MANAGER
SYNC – WEST US
API x VMs
LOAD BALANCER
BLOCK – WEST US
API x VMs
LOAD BALANCER
SYNC – WEST EU
API x VMs
LOAD BALANCER
BLOCK – WEST EU
API x VMs
LOAD BALANCER
CDN
Windows Azure CDN
STORAGE
Windows Azure Storage Blobs
MAIN DATABASE – WEST EU
SQL Azure
MEMCACHE – WEST EU
Redis
SLAVE DATABASE – WEST US
SQL Azure
MEMCACHE 2 – WEST US
Redis
STORAGE
Upload Buffer
Traffic Manager
stylejukebox.trafficmanager.net
4 VM machines
in West Europe
4 VM machines
in West US
Closest location to the user
Load balancing
Fail-over
Works for Websites, Cloud Services
Azure Datacenters
How to test?
Test 1
1,000 concurrent users
1 core machine
Test 2
1,000 concurrent users
4 core machine
$ 0,4 more per hour
Autoscale applies to Cloud Services and Websites
1 core machine can handle 200
connections simultaneous
4 core machine can handle 1,000
connections simultaneous
Monitoring
NewRelic
Always prepare for things to go wrong
Ex: Routers on the Internet
Low latency
Scalability
High Availability
OBJECTIVES
Ionut Antiu
www.get-jukebox.com
@johnnyantiu

How to scale to 100k users using Windows Azure

  • 1.
  • 2.
    1. What arewe talking about 2. What is Style Jukebox 3. What were the challenges 4. Wrap up
  • 3.
    Style Jukebox isa High Fidelity cloud-music streaming service that helps you keep all your music – be it bought, self-produced, or imported from CDs or other media, always backed up and synced across all your devices.
  • 4.
    TRACTION 125,000+ registered users 52,000+MAU Peak of 13,000 users DAU 4,5+ million songs stored in the Cloud 50,000 – 100,000 songs listened daily
  • 5.
  • 6.
    What is thebasic Cloud architecture?
  • 7.
    “LE SERVER” Database SQL Storage API LECLIENT APP LE CLIENT APP LE CLIENT APP
  • 8.
    “LE SERVER” API LE CLIENTAPP LE CLIENT APP LE CLIENT APP STORAGE Windows Azure Storage Blobs DATABASE SQL Azure
  • 9.
    Scale Up Scale Out Database,API, Content bandwidth, Website
  • 10.
    Scale Up One operationthat cannot be divided requires more compute power (Audio/Video encoding, Your own DB, etc.) Basic A1 1 Core AMD CPU 1,75 GB RAM EUR 41/month* G5, 32 cores Intel Xeon 448 GB RAM 6 TB EUR 4865/month*
  • 11.
    Scale Out Used forAPI, Website, etc. Ex: Each machine can have a limited number of connected users Basic A1 1 Core AMD CPU 1,75 GB RAM EUR 41/month* 4x Basic A1 1 Core AMD CPU 1,75 GB RAM EUR 41/month*
  • 12.
    SYNC SERVICE API (GetSongURL,Login) LE CLIENT APP LE CLIENT APP LE CLIENT APP STORAGE Windows Azure Storage Blobs DATABASE SQL Azure BLOCK SERVICE API (DownloadSong, UploadSong)
  • 13.
    SYNC SERVICE API (GetSongURL,Login) LE CLIENT APP LE CLIENT APP LE CLIENT APP STORAGE Windows Azure Storage Blobs DATABASE SQL Azure BLOCK SERVICE API (DownloadSong, UploadSong) MEMCACHE Redis Memcache Worker
  • 14.
    The Memcache Worker predictsand prepares the results Memcache Hit Ratio 86-91% Reduced time of response with 80% to an average of 250ms
  • 15.
    SYNC SERVICE API (GetSongURL,Login) LE CLIENT APP LE CLIENT APP LE CLIENT APP STORAGE Windows Azure Storage Blobs DATABASE SQL Azure BLOCK SERVICE API (DownloadSong, UploadSong) MEMCACHE Redis Memcache Worker CDN Windows Azure CDN CDN Worker
  • 16.
    SYNC SERVICE API (GetSongURL,Login) LE CLIENT APP LE CLIENT APP LE CLIENT APP STORAGE Windows Azure Storage Blobs DATABASE SQL Azure BLOCK SERVICE API (DownloadSong, UploadSong) MEMCACHE Redis Memcache Worker CDN Windows Azure CDN CDN Worker STORAGE Upload Buffer Upload Processing
  • 17.
    SYNC SERVICE API (GetSongURL,Login) LOAD BALANCER LE CLIENT APP LE CLIENT APP LE CLIENT APP STORAGE Windows Azure Storage Blobs DATABASE SQL Azure BLOCK SERVICE API (DownloadSong, UploadSong) LOAD BALANCER MEMCACHE Redis Memcache Worker CDN Windows Azure CDN CDN Worker STORAGE Upload Buffer Upload Processing Download Processing
  • 18.
    Load Balancer Integrated inthe Azure Cloud Services Makes sure all instances have the same load Auto-Scale creates new instances or removes automatically
  • 20.
    SYNC SERVICE API (GetSongURL,Login) LOAD BALANCER LE CLIENT APP LE CLIENT APP LE CLIENT APP STORAGE Windows Azure Storage Blobs DATABASE SQL Azure BLOCK SERVICE API (DownloadSong, UploadSong) LOAD BALANCER MEMCACHE Redis Memcache Worker CDN Windows Azure CDN CDN Worker STORAGE Upload Buffer Upload Processing Download Processing TRAFFIC MANAGER
  • 21.
    SYNC SERVICE –WEST US API (GetSongURL, Login) DATABASE - AMSTERDAM SQL Azure
  • 22.
    SYNC SERVICE –WEST US API (GetSongURL, Login) DATABASE - AMSTERDAM SQL Azure ~ 9,000 km * 3 calls = ~ 30,000 km 30,000 km : 300,000km/s = 100 ms
  • 23.
    LE CLIENT APPLE CLIENT APP LE CLIENT APP TRAFFIC MANAGER SYNC – WEST US API x VMs LOAD BALANCER BLOCK – WEST US API x VMs LOAD BALANCER SYNC – WEST EU API x VMs LOAD BALANCER BLOCK – WEST EU API x VMs LOAD BALANCER CDN Windows Azure CDN STORAGE Windows Azure Storage Blobs MAIN DATABASE – WEST EU SQL Azure MEMCACHE – WEST EU Redis SLAVE DATABASE – WEST US SQL Azure MEMCACHE 2 – WEST US Redis STORAGE Upload Buffer
  • 24.
    Traffic Manager stylejukebox.trafficmanager.net 4 VMmachines in West Europe 4 VM machines in West US Closest location to the user Load balancing Fail-over Works for Websites, Cloud Services
  • 25.
  • 26.
  • 30.
    Test 1 1,000 concurrentusers 1 core machine
  • 34.
    Test 2 1,000 concurrentusers 4 core machine $ 0,4 more per hour
  • 37.
    Autoscale applies toCloud Services and Websites 1 core machine can handle 200 connections simultaneous 4 core machine can handle 1,000 connections simultaneous
  • 38.
  • 39.
  • 43.
    Always prepare forthings to go wrong Ex: Routers on the Internet
  • 44.
  • 45.