SQL++ - 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 collections:

  • users: 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}.

  • 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}.

  • 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.

Try also running the following queries to examine the content of a user profile and stats blob:

SELECT * FROM jungleville._default.users LIMIT 1

SELECT * FROM jungleville._default.stats LIMIT 1


To run this example, click the button in the top right corner of the code editor.

Code Editor

Output