After Hours Academic

Question 8: Gaming duration

Phil is building a gaming app. One of the things he needs to track are a user's stats from all their previous gaming sessions. Stats include things like duration of play, score, level, etc. Phil wants to be able to show summary of the statistics for each user (e.g., average duration) as well as across all users of the app. He is trying to decide whether to store the stats in a row-based DBMS (e.g., Postgres, MySQL) or a column-based DBMS (e.g., AWS Redshift). What would you suggest?

Solution coming up in the next post!


Solution for single access blog:

Instead of using a generic lock (which any user has to acquire to access the blog), Jesse should use a reader-writer lock. A reader writer lock allows multiple readers to access a resource simultaneously. But it enforces that only a single writer (i.e., no other readers or writers) can access the resource if it holds a reader-writer lock. So, when a user wants to update their blog, they can acquire the reader-writer lock as a writer. This would ensure that no one can read the blog while it is being modified. Once the update is done, the user can release the lock and other users (e.g., multiple readers) can acquire it as a reader and access the blog simultaneously.

#databases #qna