RoR: ¿Una gran mesa o relación con otra?

I am writing a site, which provides a simple users implementation.

The users table has values such as e-mail, name, password, salt that will be used very often, and values such as age and hobbies etc that will not be used often.

Should I use one big table or 2 tables with relations?

preguntado el 31 de enero de 12 a las 08:01

1 Respuestas

The type of database table you use shouldn't depend on the frequency of the data that is used but the relationship between that data.

For your situation I'd suggest two tables and a link table but not how you split it:

Users table including email, name, password, salt and age Hobbies table including hobbie name Interest table including hobbie_id and user_id to specify which users have which hobbies.

If the hobbies is just a free text entry then I suggest using one table

Respondido el 31 de enero de 12 a las 13:01

Thank for reply! In my presentation i have two tables like users[:id,:name,:password,:salt, :add_data_id] and add_data[:age,:hobbies,:full_name] or one with all of this attributes - Kvet

I'd say one with all the data - Navidad

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.