There are some cases when you would like to denormalize your data. Denormalization is making data redundant in a way that it optimizes read performance. You have to be careful about denormalization and only start using it when you really need it. The biggest issue you will find with denormalization is it's difficult to keep your denormalized data updated.
We will see an example of how to improve our queries by denormalizing counts. The drawback is that we have to keep the redundant data updated. We are going to denormalize data from our
Image model and use Django signals to keep the data updated.
Django comes with a signal dispatcher that allows
receiver functions to get notified when certain ...