title: where should we store calculation of list of entities in spring boot?
body: <p>I have a list of entities, for example, my class &quot;Chain&quot; contains a list of entities &quot;Segment&quot;.
  The segment has some information for example property &quot;distance&quot;.
  I should calculate some value based on distance every time any segment changes.
  for example when segment added or removed or...
  I am using Spring Boot and its repositories.</p>
  <p>I know that storing result in Chian and updating them is NOT a good idea.
  But what's the best practice in this case?
  where should I store results?</p>