Additional relation(column) or nested relationships
Assuming I have three models (Client -> Project -> Task) and I want to retrieve client informations of a task is it better to have an additional relation between task and client by adding column in table tasks(client_id) instead of using three joins or with... every-time, this is the conclusion that I've come to :
Pros:
Easy to retrieve data specifically when you need to use complex queries ex: getting statistics..), better performance, make life easier.
Cons:
Having unnecessary duplicate data, if you need to move tasks to another project both both project and tasks need to be updated, maybe bad practice for database structure.
is that good for an application that need to be scalable(add new features in future), could something go wrong or cause problems in futures.