What is best practice for creating associations and why?

0
Hi All I would like to know what is best practice for creating associations with Image and File Document entities and why ? I have below two Cases. Which one is better to implement? (Or are they both the same?) Case1 Case2  
asked
1 answers
1

Personally I dont see issue with both. They both has some pros and cons.

  1. In future, if you want to separate Task and Incident with specific attributes for each, then you might endup with migration problems. Like Task could have its own attributes and associations, so does the incidents. In which case, if it is case 1, then you may end up with huge data set for both Task and incident which you must handle with ASU’s or any specific migration strategy.
  2. If there are more records, then probably retrieving could be slower for Task and Incident. 

 

May be, If you want to go with CASE 1, I would advice to have an ENUM which determines whether the document is for INCIDENT or TASK, which ofcourse can identified with association, but attribute reduces complexity of query.

So, IMHO, it purely depends on what your organization needs to develop in future together with data growth. 

answered