beating the final boss: launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... ·...
TRANSCRIPT
AWS GAMING
BeatingtheFinalBoss:Launchyourgame!
Ozkan Can – Solutions Architect, AWS
@_ozkancan
Theserversarebusyatthistime.Pleasetryagainlater.(ErrorCode:42– OOPS)
ERROR
Retry
READY FOR LAUNCH
PRESSREVIEWS
APPSTOREFEATURING
SOCIALMEDIA
MARKETINGPROMOTIONS
WORST-CASESCENARIOx50PLAY
ERS
TIME
?!
CUSTOMERRATINGS
AWS GAMING
Traditional:Rigid AWS:Elastic
Servers
Demand
Capacity
ExcessCapacityWasted$$
Demand
UnmetDemandUpsetPlayersMissedRevenue:(
SCALE TO WHAT YOU NEED – PAY FOR WHAT YOU USE
AWS GAMING
ANTI-PATTERN - MONOLITH
AWS GAMING
MULTIPLAYERGAMELOGIC
AI
SHOPMODULE
AUTHENTICATIONFRAUD
DETECTION
MATCHMAKING CHAT
BI+ETL
GAMEDATA
ANTI-PATTERN – MONOLITH SCALING
AWS GAMING
MULTIPLAYERGAMELOGIC
AI
SHOPMODULE
AUTHENTICATIONFRAUD
DETECTION
MATCHMAKING CHAT
BI+ETL
GAMEDATA
MULTIPLAYERGAMELOGIC
AI
SHOPMODULE
AUTHENTICATIONFRAUD
DETECTION
MATCHMAKING CHAT
BI+ETL
GAMEDATA
DECOUPLING
AWS GAMING
MULTIPLAYERGAMELOGIC
AI
SHOPMODULE
AUTHENTICATIONFRAUD
DETECTION
MATCHMAKING CHAT
BI+ETL
GAMEDATA
Service Oriented Architecture
AWS GAMING
AUTHENTICATION BI+ETLHTTP(S)
Service Oriented Architecture
AWS GAMING
AUTHENTICATION
BI+ETLHTTP(S)
AUTHENTICATION
AUTHENTICATION
HTTP(S)
ElasticLoadBalancer
Service Oriented Architecture
AWS GAMING
AUTHENTICATION BI+ETL
HTTP(S)AUTHENTICATION
AUTHENTICATION
HTTP(S)BI+ETL
BI+ETL
200TX/sec 50TX/sec200TX/sec 50TX/sec
ElasticLoadBalancer
ElasticLoadBalancer
Event-Driven Architecture
AWS GAMING
AUTHENTICATION BI+ETL
AUTHENTICATION
AUTHENTICATION
HTTP(S)BI+ETL
BI+ETL
200TX/sec 50TX/sec
ElasticLoadBalancer
(ELB)
AmazonSimple
QueueService(SQS)
Event-Driven Architecture
AWS GAMING
AUTHENTICATION BI+ETLv1.0
AUTHENTICATION
AUTHENTICATION
HTTP(S)BI+ETLv2.0
BI+ETLv3.0
200TX/sec 50TX/sec
ElasticLoadBalancer
(ELB)
AmazonSimple
QueueService(SQS)
GLOBAL REACH
AWS GAMING
COMMON GAME BACKEND CONCEPTS
• ThinkintermsofAPIs• HTTP+JSON• Getfriends,leaderboard• Binaryassetdata• Multiplayerservers• Highavailability• Scalability
https://aws.amazon.com/jp/solutions/case-studies/nintendo-dena/
AWS GAMING
ELB• Chooseregion• >=2AvailabilityZones• AmazonEC2forapp• ElasticLoadBalancing• AmazonRelationalDatabaseService
• Multi-AZ
Region
CORE (HA) GAME BACKEND
AWS GAMING
ELB
Region
SCALE IT OUT
• AmazonSimpleStorageService(S3)• Gamedata• Assets• User-generatedcontent• Analytics
AWS GAMING
AMAZON S3
Secure,durable,highly-scalableobjectstorage.Storeandretrieveanyamountofdatafromanywhereontheweb
“WithAWS,wehavetremendousflexibility,andwenevergetintoasituationwherethereissomethingwecan’tdo.”
“TheflexibilityoftheAWSCloudallowsustodothingsthatweotherwisecouldn’tdo.”
AWS GAMING
ELB
Region
CloudFrontCDN
SCALE IT OUT
• AmazonS3forgamedata• Assets• User-generatedcontent• Analytics
• AmazonCloudfront
AWS GAMING
AMAZON CLOUDFRONT
GlobalCDNthatacceleratesdeliveryofyourDLC,UpdatePatches,APIs,videocontentorotherfiles.
Segadidn'tprovideusaquote,buttheydouseCloudFront andtheywouldhavesaidsomeverynicethingsinthisquote.Youhavetotrustusonthis!
“BycombiningthepowerofAWScompute&storagewiththeAmazonCloudFront contentdeliverynetwork,wecanprovideanexcellentuserexperiencetoeverybodyplayingourgames&watchingourvideocontent—regardlessoftheirgeographicallocation,”
AWS GAMING
ELB
Region
CloudFrontCDN
SCALE IT WAY OUT
• AmazonS3forgamedata• Assets• User-generatedcontent• Analytics
• AmazonCloudFront• AutoScalingGroup
• Capacityondemand• Respondtousers• Automatichealing
AWS GAMING
ELB
Region
CloudFrontCDN
SCALE IT WAY OUT
• AmazonS3forgamedata• Assets• User-generatedcontent• Analytics
• AmazonCloudFront• AutoScalingGroup
• Capacityondemand• Respondtousers• Automatichealing
• AmazonElastiCache• Memcached &Redis
AWS GAMING
ELB
Region
CloudFrontCDN• Gamesarewriteheavy
• Cachingoflimiteduse• Key-Value• Binarystructures• Database=bottleneck
WRITING IS PAINFUL
AWS GAMING
SHARDING IS NOT FUN
AWS GAMING
• Fully-managed• NoSQL datastore• Provisionedthroughput• Secondaryindexes• PUT/GETkeys• TTLEviction• DocumentSupport• 400KBItems• AmazonDynamoDB Accelerator(Cache)
ELB
Region
CloudFrontCDN
AMAZON DYNAMODB
AWS GAMING
• Hashkey=Primarykey• Rangekey=Subkey• Rangekey=Sortkey• Othersattributesareundefined
• So…HowtosortbasedonTopScore?
UserID(hashkey)
BoardName(range key)
TopScore TopScoreDate
"101" "Galaxy Invaders" 5842 "2014-09-15T17:24:31"
"101" "MeteorBlasters" 1000 "2014-10-22T23:18:01"
"101" "Starship X" 24 "2014-08-31T13:14:21"
"102" "Alien Adventure" 192 "2014-07-12T11:07:56"
"102" "Galaxy Invaders" 0 "2014-09-18T07:33:42"
"103" "AttackShips" 3 "2014-10-19T01:13:24"
"103" "Galaxy Invaders" 2317 "2014-09-11T06:53:00"
"103" "MeteorBlasters" 723 "2014-10-19T01:14:24"
"103" "Starship X" 42 "2014-07-11T06:53:03"
EXAMPLE: LEADERBOARD IN DYNAMODB
AWS GAMING
• Createasecondaryindex!• SethashkeytoBoardName• SetrangekeytoTopScore• Projectextraattributesasneeded• CannowquerybyBoardName,SortedbyTopScore
• Handlesmanycommongamingusecases
BoardName(hashkey)
TopScore(range key)
UserID
"Alien Adventure" 192 "101"
"AttackShips" 3 "103"
"Galaxy Invaders" 0 "102"
"Galaxy Invaders" 2317 "103"
"Galaxy Invaders" 5842 "101"
"MeteorBlasters" 723 "103"
"MeteorBlasters" 1000 "101"
"Starship X" 24 "101"
"Starship X" 42 "103"
UserID(hashkey)
BoardName(range key)
TopScore TopScoreDate
"101" "Galaxy Invaders" 5842 "2014-09-15T17:24:31"SECONDARY INDEXES
AWS GAMING
• Scalartypes:String,Number,Binary,Boolean,Null• Multi-valuetypes:StringSet,NumberSet,BinarySet• Documenttypes:List,Map• Documentcontentaddressing
"name": “TerryCrews",
"games": ["Megablast","Spacerace"],
"score": {"Megablast" : 123,"Spacerace" : 41
}
"name": {"S": "Martin"
}"games": {"L": [ { "S": "Megablast" },
{ "S": "Spacerace" } ]},"score": {"M": {"Megablast": { "N": "123" },"Spacerace": { "N": "41" }
}}
"name": {"S": "Martin"
}"games": {"L": [ { "S": "Megablast" },
{ "S": "Spacerace" } ]},"score": {"M": {"Megablast": { "N": "123" },"Spacerace": { "N": "41" }
}}
document.score.Megablast
DYNAMODB DOCUMENTS
AWS GAMING
AMAZON DYNAMODB
FullymanagedNoSQLdatabasewithsingledigitlatencyatanyscale
“Using AmazonDynamoDB freesus frombuilding,maintaining,&sharding largereal-time data intensive projects.”
ByusingAWS,FrontierGamescanscalecomputeresourceseasilytohandlelargespikesinusertrafficwithpopulartitles,andissavingupto30percentcomparedtousingatraditionaltechnologyinfrastructure,
AWS GAMING
Region
MULTIPLAYER GAME SERVERS
• APIbackendapp• Coresession• Matchmaking
• S3+CloudFront• DLC,assets• Gamesaves• User-generatedcontent
• Publicservertier• Directclientsocket• Scaleonplayers
AWS GAMING
Region
MULTIPLAYER GAME SERVERS
①LoginviaAPI②Requestmatchmaking③GetgameserverIP
AWS GAMING
Region
MULTIPLAYER GAME SERVERS
①LoginviaAPI②Requestmatchmaking③GetgameserverIP④Connecttoserver⑤Pulldownassets⑥Otherplayersjoin
AWS GAMING
Region ARegion B
AWS GAMING
PRE-LAUNCH CHECKLIST
AWS GAMING
• SECURITYISJOBZERO• Designforfailure• ConsiderServiceLimits• Monitoreverything• Considerdataaccesspatterns• Decommissionunusedresources• Planforunplannedevents:AWSSupport• ReadtheWell-ArchitectedFrameworkWhitepaper• ScheduleaWell-ArchitectedReviewwithyourAWSaccountteam
https://aws.amazon.com/architecture/well-architected/
AWS GAMING
Focusonyourplayers!
AWS GAMING
Infrastructureisnotadifferentiator.
AWS GAMING
Don’tlimityourselfbytechnology.
BEGIN YOUR JOURNEY WITH AWS!