Architecting high traffic websites with rapid changes in data on AWS
-
Upload
aws-user-group-brisbane -
Category
Technology
-
view
234 -
download
0
description
Transcript of Architecting high traffic websites with rapid changes in data on AWS
Australia’s #1 horse racing website
Our Brands
PuntersParadise.com.au BestOdds.com.au rleague.com
+ over 110 individual content websites
Stupid shit we do
More stupid shit we do
Why AWS?
Normal 30 days
12 month traffic
Melbourne Cup Day 2012
• 13,350 concurrent users peak load
• 550,000 uniques in a few hours
• Almost 3 x more visitors than Flemington racecourse
• Residents of Darwin loose internet
PuntersParadise.com.au
Our year on year growth
Visits
2009 572,000
2010 796,000
2011 1,731,000
2012 3,008,000
2013 3M + so far
PuntersParadise.com.au
Migrated to AWS about here
2008
2009
2010
2011
2012
Melbourne Cup Uptime History
The early days.
Immediate wins
We killed our pets and started producing cattle
Automated builds
Performance issues were obvious
Survived 1st Melbourne Cup!
Tech was there
Cache Servers
Web Servers
ElastiCache
RDS
ELB
ELB
Our Basic Stack
Odds Comparison
Cache Servers
Web Servers
ElastiCache
RDS
ELB
ELB
Our Basic Stack
Feed Server
On any given day..
8-10 races per meeting
On any given day..
Average of 12 race meetings per day
On any given day..
+ 45 sporting games
On any given day..
+ 8 greyhound meetings x 10 races
On any given day..
x2 bet types (win/place or sport margin/outrights)
x12 bookmakers!
On any given day..
On any given day..
Odds can change every few seconds
Two problems here.
Delivery
Processing
Our first attempt
while(true) { //some magic in here $market = getMarketInQueue(); //web requests to XML/JSON feeds $market->hitUpBookmakers(); //save to DB $market->saveOddsToMySQL(); }
How it works
//this sucks. Doesn’t feel right. $market->saveOddsToMySQL();
Push that puppy
while(true) { //some magic in here $market = getMarketInQueue(); //web requests to XML/JSON feeds $market->hitUpBookmakers(); //ahhh. That feels better $market->saveOddsToDynamoDB(); //like a boss $market->pushOddsToPusher(); }
Push that puppy
"2081715-Average-FixedWin": { "sid": 2081715, "bt": "FixedWin", "b": "Average", "f": [ [ 1381882761, 1 ] ], "p": null, "ps": null
Pushed Message
From DynamoDB
"2081715-Average-FixedWin": { "sid": 2081715, "bt": "FixedWin", "b": "Average", "f": [ [ 1381882761, 1 ] ], "p": null, "ps": null
"2081715-Average-FixedWin": { "sid": 2081715, "bt": "FixedWin", "b": "Average", "f": [ [ 1381882761, 1 ] ], "p": null, "ps": null
"2081715-Average-FixedWin": { "sid": 2081715, "bt": "FixedWin", "b": "Average", "f": [ [ 1381882761, 1 ] ], "p": null, "ps": null
Template language
Cache Servers
Web Servers
ElastiCache
RDS
ELB
ELB
Our Full Stack
Feed Servers
Pusher.com DynamoDB
Cache Servers
Web Servers
ElastiCache
RDS
ELB
ELB
Whats next?
Feed Servers
Pusher.com DynamoDB
Autoscale!
Autoscale!
AWS Reference Architecture
Too easy. Let’s just do that..
Autoscaling the feedserver
Feed Server Feed Server
Controller
Autoscaling the feedserver
Feed Server Feed Server
Controller
Autoscaling the feedserver
Feed Server Feed Server Feed Server
Autoscaling the feedserver
Feed Server 1 Feed Server 2 Feed Server 3
Autoscaling the feedserver
Autoscaling the feedserver
Autoscaling the feedserver
Our advice
Let everything get hit by a bus Empower the worker, not the boss Utilise the AWS API as much as possible It’s easy. We can all do it.
One last cool thing…