Using signals for denormalizing counts

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 that it's difficult to keep your denormalized data updated.

We will take a look at an example of how to improve our queries by denormalizing counts. The drawback is that we have to keep the redundant data updated. We will denormalize data from our Image model and use Django signals to keep the data updated.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset