Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

GMG302 Scaling Social Games with Ubisoft - AWS re: Invent 2012


Published on

Game success leads to rapid and unpredictable growth, and high-levels of read and write traffic can make scaling games even more difficult. In this session Ubisoft and AWS cover the architectural best practices for building scalable apps and the best ways to adjust your app if it begins to slow down. This session mainly focuses on scaling databases, and we focus on the following technologies: Couchbase, Cassandra, MySQL, Amazon RDS, and Amazon DyanmoDB.

  • Be the first to comment

GMG302 Scaling Social Games with Ubisoft - AWS re: Invent 2012

  1. 1. Amazon Elastic Amazon Relational Amazon DynamoDBCompute Cloud Database Service (EC2) (RDS)
  2. 2. MySQL App MServers
  3. 3. MySQL M Asynchronous Replication AppServers MySQL S
  4. 4. MySQL M AppServers MySQL S
  5. 5. MySQL M Asynchronous Replication AppServers MySQL S
  6. 6. MySQL M Asynchronous Replication AppServers MySQL S
  7. 7. AppServers MySQL M
  8. 8. MySQL S Asynchronous Replication AppServers MySQL M
  9. 9. data data data dataMySQL data data data data M data data data data
  11. 11. data data MySQL MySQL App logs logs M SServers Asynchronous Replication
  12. 12. data data MySQL MySQL logs logs M S Asynchronous Replication AppServers Memcached Instance01
  13. 13. - High concurrency of requests- Maximum instance size- I/O capacity on the EBS volumes- Latency on the EBS volumes
  14. 14. - Client-side caching- Request batching- Stripe over multiple EBS volumes- Shard the users between multiple data base instances:…function getDbId($userID) { $db_id = ($userID % CONFIG::NUM_SHARDS); return $db_id; }…- Cache extensively - Memcache - Application server cache
  15. 15. MySQL MySQL data logs data logs Memcached M S Shard_N Shard_N ... App MySQL MySQL data logs data logs MemcachedServers M Shard_01 S Shard_01 Memcached MySQL MySQL data logs data logs M S Main_01 Main_01
  16. 16. - Persistence from Memcache to MySQL- Failure of Memcache will degrade performance of the shard- Horizontal scalability during growth- Cluster maintenance
  17. 17. - Change database technology – what will that mean? - New knowledge to be build in dev and ops - Changes in the development process - Data abstraction layer - Data relation model - Changes in the operational process - Cluster extension and upgrades - Monitoring, backup and recovery - Technology maturity and support
  18. 18. - Change the least code as possible - Re-use work already done around Memcache - Change data structure and relation: USR_ACHVM_ID: USR_ID: {USR_ACC: { “type_id": 1,{ "status": 1, “cntr": 2, “id": 83463746374, "xp": 2, “mtime": 1352203436, “activation_time": 1351203195, “mtime": 1352203436, “reached": 1352203195, “lastlogin_time": 1352203034, "last_active": 1352203195, “sub_achvms": [2,3,4,6],... "last_action": 1352203200, ...} "frnd_lst": [34234234,12425434,34311234], } “team_lst": [34234234,34311234], “data": [], ... }
  19. 19. Couchbase data MySQL data logs Node_N S ... Main_02 App Couchbase dataServers MySQL data logs Node_02 M Main_01 Couchbase data Node_01
  20. 20. - Improved performance- Allowed for easier scalability- Simplified the data layer- Facilitated the cluster operations and monitoring
  21. 21. - Serialization and deserialization- Secondary indexes*- Text search*- Cluster replication ** - will be addressed in v2.0 of Couchbase or existingworkarounds
  22. 22. - Know the limitations of each component from your stack- Do not implement new technology as a fashion trend- Don’t cut corners for delivery – you will work twice as hard to fix them- Development and operation teams are the best allies for success
  23. 23. rds-modify-db-instance mydbinstance -c db.m1.xlarge --apply-immediately
  24. 24. Synchronous Replication AppServers
  25. 25. AppServers
  26. 26. Synchronous Replication AppServers
  27. 27. AppServers
  28. 28. Synchronous App ReplicationServers
  29. 29. Scaling with Amazon DynamoDB
  30. 30. We are sincerely eager to hear your feedback on thispresentation and on re:Invent. Please fill out an evaluation form when you have a chance.