NoSQL Games

3,103 views

Published on

This talk explains how we use NoSQL databases at wooga to scale our backend services to deal with the data of millions of players every day. Learn from our experience running Basho's Riak in production and how to use Amazon S3 as a database.

Published in: Technology

NoSQL Games

  1. 1. NOSQL GAMES Patrick Huesler wooga GmbH
  2. 2. Do you like toplay?
  3. 3. technicalchallenges
  4. 4. monthly active users20,543,500for Diamond Dash http://www.appdata.com/apps/facebook/127995567256931-diamond-dash (03/10/2012)
  5. 5. daily active users3,871,133for Diamond Dashhttp://www.appdata.com/apps/facebook/127995567256931-diamond-dash (03/10/2012)
  6. 6. backend traffic up to 6,500 RPSfor Monster World
  7. 7. what does mean that for aDatabase?
  8. 8. read/write ratio?write heavy
  9. 9. Wooga’sEVOLUTIONof architecture
  10. 10. Facebook Game backend Flash Reporting iOS
  11. 11. Built with LAMP... well, nginx instead of apache
  12. 12. mysql doesscale
  13. 13. for certainuse cases
  14. 14. with the right people
  15. 15. To thecloud
  16. 16. Let’s use Railsinstead of PHP
  17. 17. load balancerapp server app server app server master shard 1 master shard 2 slave shard 2 slave shard 2
  18. 18. longstory short
  19. 19. load balancerapp app app app app app app appapp app app app app app app appapp app app app app app app appdb db db db db db db dbdb db db db db db db db
  20. 20. differentuse case
  21. 21. arcade games Are NOTfarming games
  22. 22. This is NOTgoing to work
  23. 23. but there is Lightat the end of the tunnel
  24. 24. MoveSLOW PARTS to redis
  25. 25. rinsE and REPEAT
  26. 26. back todedicated
  27. 27. More bangfor the buck
  28. 28. FasterMachines
  29. 29. fasternetwork
  30. 30. Let’s useREdisall the way
  31. 31. load balancerapp server app server app server redis redis slave
  32. 32. REDISHASH
  33. 33. all is well inRedis Land
  34. 34. Memory Leaks
  35. 35. how does BGSAVEwork again?
  36. 36. dumps areno longer working
  37. 37. This is NOTgoing to work
  38. 38. Fix it withRestore on Demand
  39. 39. Redis Disk Store(never really supported)
  40. 40. Let’s goStateful
  41. 41. no databaseis faster than no database
  42. 42. Let’s use S3all the way
  43. 43. Let’s useerlang
  44. 44. http://www.slideshare.net/wooga/from-0-to-1000000-daily-users-with-erlang
  45. 45. http://www.slideshare.net/wooga/from-0-to-1000000-daily-users-with-erlang
  46. 46. projectSPARTAN
  47. 47. it has to be readyyesterday
  48. 48. It has to scaleenormously
  49. 49. node.js
  50. 50. What DB Scaleswithout sharding?
  51. 51. what DB hasmasterlessreplication?
  52. 52. AsyncSaving
  53. 53. Riak
  54. 54. good enoughfor now
  55. 55. good enoughfor good
  56. 56. life withRiak
  57. 57. 1 { 2 "userId" : 1000000011100, 3 "xp" : 20, 4 "coins" : 400, 5 "cash" : 300, 6 "rooms" : [ 7 { 8 "id" : 1, 9 "type" : "x-ray",10 "status" : "busy"11 }12 ]13 }14
  58. 58. no SPoFis plain awesome
  59. 59. bitcask wassuboptimalfor our use case
  60. 60. Do notmap/reduceover all keys!
  61. 61. dreadfululimit
  62. 62. the tale ofriak Attach
  63. 63. Monsters goMobile
  64. 64. An iOS client is NOT a flash client
  65. 65. do we need adatabase at all?
  66. 66. Could we just use s3in a stateless architecture?
  67. 67. do we need abackend at all?
  68. 68. what if theclient writes to S3?
  69. 69. wooga.com/ jobs
  70. 70. Referenced Presentationshttp://www.slideshare.net/wooga/how-to-handle-1000000-daily-users-without-using-a-cache-railswaycon-2012http://www.slideshare.net/wooga/event-stream-processing-with-kafka-berlin-buzzwords-2012http://www.slideshare.net/wooga/from-0-to-1000000-daily-users-with-erlang
  71. 71. CreditsPolar bear: http://www.flickr.com/photos/bestrated1/167630455/sizes/o/Family: http://www.flickr.com/photos/adwriter/212098009/sizes/o/cart: http://www.flickr.com/photos/41304880@N05/6187541490/cow closeup: http://www.flickr.com/photos/sovietuk/227465632/sizes/o/sparta: http://www.flickr.com/photos/legofenris/5008721616/sizes/l/tank: http://www.flickr.com/photos/markkelley/1581559810/sizes/l/bomb: http://www.flickr.com/photos/7969902@N07/511234695/

×