Am I missing something about these considerations about Leaderboard's database's schema?
- by misiMe
I just finished to develop a mobile game, now I want to implement an online leaerboard using mysql. I'm wondering about the database's schema, I thought about some possibilities:
(I didn't got in detail with syntax because my question is just about the logic of it)
Name: string; Score: integer
I thought to ask the name just the first time. If, in the future, you will modify that, it will call just an update to the name associated with your id.
Leaderboard(ID, Name, Score)
ID: integer autoincrement, PrimaryKey
With this kind of idea maybe the db will grow fast because if you choose everytime a different name for the score, it will add a new entry.
Leaderboard(PhoneId, Name, Score)
Here PhoneId will be the unique identifier of the phone, PrimaryKey. A con of this choice is that if you want to play with your friends' phone, you can't put a different name for the score.
Leaderboard(Name, Score)
Here Name is PrimaryKey. With that, if you enter a name that already exists, you will be prompted to choose another one.
Do you agree with this considerations? What will you do? Am I missing something?