Case Study II . Social Game
In this section we look at some typical queries that are needed for a social game applicaton.
Let’s imagine that we are building a game called jungleville that uses the following three buckets:
-
jungleville: this bucket contains the player profile data and game related data such as level, experience and various other gameplay information. Keys in this bucket are named in the following format: zid-jungle-{user_id}.
-
jungleville_stats: this bucket contains the systems stats such as frame-rate, game loading
time, and player-vs-player stats. Keys in this bucket are named in the following format: zid-jungle-stats-{user_id}.
-
jungleville_inbox: In jungleville, each player has an inbox. Messages sent to a player are appened
to the existing array of messages. When a message is consumed by a player those messages
are removed from the message array. Run the query on the right to see what a message in jungleville looks like.
SELECT * FROM jungleville_inbox LIMIT 1
Try also running the following queries to examine the content of a user profile and stats blob:
SELECT * FROM jungleville LIMIT 1
SELECT * FROM jungleville_stats LIMIT 1