Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Riak: Distributed Storage for Games You Don't Have to Worry About

Riak: Distributed Storage for Games You Don't Have to Worry About

Presented at Gamelab 2013 in Barcelona

Tom Santero

June 27, 2013
Tweet

More Decks by Tom Santero

Other Decks in Technology

Transcript

  1. Distributed storage for games
    you don’t have to worry about
    Press Start
    (c) 2013 Basho Technologies
    All rights reserved.
    Riak

    View Slide

  2. Player Select
    Tom Santero
    tsantero
    on github
    on twitter
    @basho.com
    {

    View Slide

  3. Basho Technologies
    we make riak...

    View Slide

  4. I <3 video games

    View Slide

  5. video games have changed

    View Slide

  6. When I was a kid...

    View Slide

  7. Kids Today...

    View Slide

  8. Evolution of games largely characterized by
    rapid development of processing technology

    View Slide

  9. What happened?

    View Slide

  10. Online / multiplayer
    gaming experiences

    View Slide

  11. meanwhile...

    View Slide

  12. Amazon.com

    View Slide

  13. View Slide

  14. Riak

    View Slide

  15. masterless, distributed
    key/value datastore

    View Slide

  16. deployed as a
    cluster
    of nodes

    View Slide

  17. key / value

    View Slide

  18. map/reduce engine
    Full-text search
    secondary indexes

    View Slide

  19. scale

    View Slide

  20. Global Availability

    View Slide

  21. Used by...
    and more...

    View Slide

  22. Why?

    View Slide

  23. Users vote for
    your games with:
    their time
    their money
    Downloads
    recommendations

    View Slide

  24. View Slide

  25. Fault Tolerance

    View Slide

  26. High Write Throughput

    View Slide

  27. Cost of operations
    predictable latency
    easy to scale
    small teams

    View Slide

  28. SHIP IT!
    Did you test the code?

    View Slide

  29. Did you test the Infrastructure?

    View Slide

  30. Thousands  of  players  across  the  world  are  playing  and  
    having  a  good  experience  –  in  fact,  more  than  700,000  
    cities  have  been  built  by  our  players  in  just  24  hours.  
    But  many  are  experiencing  server  instability  and  
    consequently,  the  rollout  in  North  America  has  been  
    challenging.  It's  also  now  evident  that  players  across  
    Europe  and  Asia  are  experiencing  the  same  frustration.  
    Our  priority  now  is  to  quickly  and  dramatically  increase  
    the  number  and  stability  of  our  servers  and,  with  that,  
    the  number  of  players  who  can  simultaneously  access  the  
    game.  We  added  servers  today,  and  there  will  be  several  
    more  added  over  the  weekend.  We're  working  as  hard  as  
    possible  to  make  sure  everyone  gets  to  experience  the  
    amazing  game  we  built  in  SimCity.

    View Slide

  31. NOT
    Acceptable

    View Slide

  32. Build a cross-platform
    gaming experience
    with Riak

    View Slide

  33. Authentication
    and profiles
    key value
    oauth JSON/XML/enc
    uuid JSON/XML/enc
    email JSON/XML/enc
    } device_id
    last_session
    other_pointers

    View Slide

  34. Authentication
    and profiles
    key value
    oauth JSON/XML/enc
    uuid JSON/XML/enc
    email JSON/XML/enc
    } device_id
    last_session
    other_pointers
    Cross Platform!

    View Slide

  35. Session and
    game state
    key value
    user riak
    sessionid JSON/XML/enc
    uuid JSON/XML/enc
    PUT sessions/sessionID
    GET sessions/sessionID

    View Slide

  36. Session and
    game state
    key value
    user riak
    connection
    sessionid JSON/XML/enc
    uuid JSON/XML/enc
    session created
    PUT sessions/sessionID
    GET sessions/sessionID

    View Slide

  37. Session and
    game state
    key value
    user riak
    connection
    save progress
    sessionid JSON/XML/enc
    uuid JSON/XML/enc
    session created
    PUT sessions/sessionID
    GET sessions/sessionID

    View Slide

  38. Session and
    game state
    key value
    user riak
    connection
    save progress
    sessionid JSON/XML/enc
    uuid JSON/XML/enc
    X
    terminate conn
    session created
    PUT sessions/sessionID
    GET sessions/sessionID

    View Slide

  39. Session and
    game state
    key value
    user riak
    connection
    save progress
    sessionid JSON/XML/enc
    uuid JSON/XML/enc
    X
    terminate conn
    reconnect
    session created
    session created
    ...
    PUT sessions/sessionID
    GET sessions/sessionID

    View Slide

  40. user created
    content
    avatars
    images
    etc...

    View Slide

  41. In-Game purchases
    game inventory
    P
    a
    y
    m
    e
    n
    t
    transaction log
    player’s inventory
    game

    View Slide

  42. Social Graphs
    Player 1 is friends with Player 2
    Player 3
    Player 2 is friends with Player 3
    player 4
    player 6
    via secondary index
    CRDT

    View Slide

  43. Notification Systems
    event based messages
    grab via 2i or m/r
    asynchronous delivery
    via:
    urbanairship
    kafka / Rabbitmq
    apple/android servers

    View Slide

  44. Support rapid growth

    View Slide

  45. in-game statistics
    A/B testing
    in-game messaging

    View Slide

  46. Level 1
    complete

    View Slide

  47. To proceed to
    Level 2
    come visit our booth

    View Slide

  48. Questions?
    tsantero
    on github
    on twitter
    @basho.com
    {

    View Slide