Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... ·...

38
AWS GAMING Beating the Final Boss: Launch your game! Ozkan Can – Solutions Architect, AWS @_ozkancan

Transcript of Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... ·...

Page 1: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

AWS GAMING

BeatingtheFinalBoss:Launchyourgame!

Ozkan Can – Solutions Architect, AWS

@_ozkancan

Page 2: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

Theserversarebusyatthistime.Pleasetryagainlater.(ErrorCode:42– OOPS)

ERROR

Retry

Page 3: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

READY FOR LAUNCH

PRESSREVIEWS

APPSTOREFEATURING

SOCIALMEDIA

MARKETINGPROMOTIONS

WORST-CASESCENARIOx50PLAY

ERS

TIME

?!

CUSTOMERRATINGS

AWS GAMING

Page 4: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

Traditional:Rigid AWS:Elastic

Servers

Demand

Capacity

ExcessCapacityWasted$$

Demand

UnmetDemandUpsetPlayersMissedRevenue:(

SCALE TO WHAT YOU NEED – PAY FOR WHAT YOU USE

AWS GAMING

Page 5: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

ANTI-PATTERN - MONOLITH

AWS GAMING

MULTIPLAYERGAMELOGIC

AI

SHOPMODULE

AUTHENTICATIONFRAUD

DETECTION

MATCHMAKING CHAT

BI+ETL

GAMEDATA

Page 6: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

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

Page 7: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

DECOUPLING

AWS GAMING

MULTIPLAYERGAMELOGIC

AI

SHOPMODULE

AUTHENTICATIONFRAUD

DETECTION

MATCHMAKING CHAT

BI+ETL

GAMEDATA

Page 8: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

Service Oriented Architecture

AWS GAMING

AUTHENTICATION BI+ETLHTTP(S)

Page 9: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

Service Oriented Architecture

AWS GAMING

AUTHENTICATION

BI+ETLHTTP(S)

AUTHENTICATION

AUTHENTICATION

HTTP(S)

ElasticLoadBalancer

Page 10: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

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

Page 11: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

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)

Page 12: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

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)

Page 13: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

GLOBAL REACH

AWS GAMING

Page 14: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

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

Page 15: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

ELB• Chooseregion• >=2AvailabilityZones• AmazonEC2forapp• ElasticLoadBalancing• AmazonRelationalDatabaseService

• Multi-AZ

Region

CORE (HA) GAME BACKEND

AWS GAMING

Page 16: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

ELB

Region

SCALE IT OUT

• AmazonSimpleStorageService(S3)• Gamedata• Assets• User-generatedcontent• Analytics

AWS GAMING

Page 17: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

AMAZON S3

Secure,durable,highly-scalableobjectstorage.Storeandretrieveanyamountofdatafromanywhereontheweb

“WithAWS,wehavetremendousflexibility,andwenevergetintoasituationwherethereissomethingwecan’tdo.”

“TheflexibilityoftheAWSCloudallowsustodothingsthatweotherwisecouldn’tdo.”

AWS GAMING

Page 18: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

ELB

Region

CloudFrontCDN

SCALE IT OUT

• AmazonS3forgamedata• Assets• User-generatedcontent• Analytics

• AmazonCloudfront

AWS GAMING

Page 19: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

AMAZON CLOUDFRONT

GlobalCDNthatacceleratesdeliveryofyourDLC,UpdatePatches,APIs,videocontentorotherfiles.

Segadidn'tprovideusaquote,buttheydouseCloudFront andtheywouldhavesaidsomeverynicethingsinthisquote.Youhavetotrustusonthis!

“BycombiningthepowerofAWScompute&storagewiththeAmazonCloudFront contentdeliverynetwork,wecanprovideanexcellentuserexperiencetoeverybodyplayingourgames&watchingourvideocontent—regardlessoftheirgeographicallocation,”

AWS GAMING

Page 20: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

ELB

Region

CloudFrontCDN

SCALE IT WAY OUT

• AmazonS3forgamedata• Assets• User-generatedcontent• Analytics

• AmazonCloudFront• AutoScalingGroup

• Capacityondemand• Respondtousers• Automatichealing

AWS GAMING

Page 21: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

ELB

Region

CloudFrontCDN

SCALE IT WAY OUT

• AmazonS3forgamedata• Assets• User-generatedcontent• Analytics

• AmazonCloudFront• AutoScalingGroup

• Capacityondemand• Respondtousers• Automatichealing

• AmazonElastiCache• Memcached &Redis

AWS GAMING

Page 22: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

ELB

Region

CloudFrontCDN• Gamesarewriteheavy

• Cachingoflimiteduse• Key-Value• Binarystructures• Database=bottleneck

WRITING IS PAINFUL

AWS GAMING

Page 23: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

SHARDING IS NOT FUN

AWS GAMING

Page 24: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

• Fully-managed• NoSQL datastore• Provisionedthroughput• Secondaryindexes• PUT/GETkeys• TTLEviction• DocumentSupport• 400KBItems• AmazonDynamoDB Accelerator(Cache)

ELB

Region

CloudFrontCDN

AMAZON DYNAMODB

AWS GAMING

Page 25: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

• 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

Page 26: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

• 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

Page 27: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

• 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

Page 28: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

AMAZON DYNAMODB

FullymanagedNoSQLdatabasewithsingledigitlatencyatanyscale

“Using AmazonDynamoDB freesus frombuilding,maintaining,&sharding largereal-time data intensive projects.”

ByusingAWS,FrontierGamescanscalecomputeresourceseasilytohandlelargespikesinusertrafficwithpopulartitles,andissavingupto30percentcomparedtousingatraditionaltechnologyinfrastructure,

AWS GAMING

Page 29: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

Region

MULTIPLAYER GAME SERVERS

• APIbackendapp• Coresession• Matchmaking

• S3+CloudFront• DLC,assets• Gamesaves• User-generatedcontent

• Publicservertier• Directclientsocket• Scaleonplayers

AWS GAMING

Page 30: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

Region

MULTIPLAYER GAME SERVERS

①LoginviaAPI②Requestmatchmaking③GetgameserverIP

AWS GAMING

Page 31: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

Region

MULTIPLAYER GAME SERVERS

①LoginviaAPI②Requestmatchmaking③GetgameserverIP④Connecttoserver⑤Pulldownassets⑥Otherplayersjoin

AWS GAMING

Page 32: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

Region ARegion B

AWS GAMING

Page 33: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

PRE-LAUNCH CHECKLIST

AWS GAMING

• SECURITYISJOBZERO• Designforfailure• ConsiderServiceLimits• Monitoreverything• Considerdataaccesspatterns• Decommissionunusedresources• Planforunplannedevents:AWSSupport• ReadtheWell-ArchitectedFrameworkWhitepaper• ScheduleaWell-ArchitectedReviewwithyourAWSaccountteam

https://aws.amazon.com/architecture/well-architected/

Page 34: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

AWS GAMING

Focusonyourplayers!

Page 35: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

AWS GAMING

Infrastructureisnotadifferentiator.

Page 36: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

AWS GAMING

Don’tlimityourselfbytechnology.

Page 37: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,
Page 38: Beating the Final Boss: Launch your game!aws-de-media.s3-eu-west-1.amazonaws.com/images... · AMAZON CLOUDFRONT Global CDN that accelerates delivery of your DLC, Update Patches, APIs,

BEGIN YOUR JOURNEY WITH AWS!