Recently I had this discussion with some other developers about how too many columns in a table , or too many attributes on a model is a code smell . Some argue that a Model with too many Attribute is doing too many things , and should be split . But what If the Model actually requires those attributes ?
Let me take the example of a users
table .
A user can have
first_name
, last_name
, street_name
, city
, state
, age
, etc .
According to the argument , I assume street_name
, city
and state
should be moved into a different table . I agree that related data are grouped together this way , but if the application is querying for the user with his address as well , wont that be a more expensive operation, since they're in 2 tables now ?
So what is the right way to model tables with a lot of attributes ? ( Should we also consider these cases : when 1. the number of rows are going to be less 2. the number of rows are going to be huge )