I'm designing a DB for an app, where people could save their game records and get some statistics. Game could be played 1x1 or 2x2 players.

I expect ~20 active users per day, if that matters.

I thought aboust this simple design:

games table:

users table:

player2 and player4 might be nullable. Both scores are integer values.

For the first time I'd like to serve some stats for users: how many game was played, winrate, last N matches and so on.

games table doesn't look like scaleable table, but keep in mind, ~20 active users per day.

What do you guys think? Can I go with such simple schema? Thanks in advance!

P. S. I've tried another design at the very beginning:

games - many to many through user_games(user_id and game_id foreign keys) with users. But I've faced an issue while representating data - scores wasn't attached to players evidently.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.