Is it worth the MySQL samp normalization?
#1

Option 1:

Table1
id_user | Name | Health | Armour | Money | Skin
1 | Juan | 100.0 | 100.0 | 100 | 5
2 | Juan2 | 100.0 | 100.0 | 100 | 5

Option 2:

Table 1
id_user | Name
1 | Juan
2 | Juan2

Table 2
id_reference | value_action | Value
1 | Health | 100
1 | Armour | 100
1 | Money | 50
1 | Skin | 5
2 | Health | 100
2 | Armour | 100
2 | Money | 50
2 | Skin | 5

Option 1 or Option 2

Which would be better imagining having millions of users and data.
Reply
#2

first one cause it is nice to have userid as kind of index.
Nobody uses the second option

Although Im not sure why you are storing Health and Armour ??
Reply
#3

It is always a good practice to normalize your db.
Reply
#4

which one is your favorite?
Reply
#5

Probably option 1 in this case.
but if you were saving something like player weapons, option 1 wouldn't be good, you'd have to use another table.
Reply
#6

To finish the post, things like
wanted level
time Jail
jail
etc.
it is better to normalize it or to add it in columns is to have an idea
Reply
#7

I would store login data, skills, money, wanted, jail and stuff like that in one table and use another table for inventory.
Reply
#8

It's ok for all the data you need upon login to be in one table.

But extra data (like inventory, stats, etc.) can be in a separated, and nothing happens if you keep all in one row.

It's the matter of slight speed and best practice.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)