Chap 3 - about duplication

what is the meaning of this phrase : “is the benefit of having this sum precomputed surpassing the cost and trouble of keeping it in sync ?”

Hi @Khammassi_HoussemEdd,

When you choose to denormalise data (for example, storing a precomputed sum) there are pros & cons.

The phrase you quoted is describing the tradeoff between updating a sum on every related write (denormalisation) versus computing this total on every related read. This is described in more detail with the Computed Pattern.

The “trouble of keeping in sync” is referring to denormalised data: if there are any unexpected gaps in your application logic, precomputed sums could get out of sync with the independently stored values that the sum represents.

Regards,
Stennie

1 Like

this is so clear
Thank you so much
Regards
Houssem

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.