Hi,
We are running an Online Fashion store based on Oscar since last couple of months. Right now we are working on optimising the performance of the application and as all know, the major bottleneck is always Datasbase access. The performance is inversely proportional to the number of DB access (roughly) besides other things.
Our products/product types are heavily attribute dependant - which we show on the product details page. Also, our products (like shoes, clothes) have multiple variants based on size and colors and a buyer can choose a specific variant based on these attributes. All these information are rendered on the product details page. Now, a major drawback of EAV model (though it makes the creation of attributes dynamic) is that it is results in huge number of queries to DB for the product details page (almost hitting 100+ queries) - hence, resulting in poor performance of the app server for the page.
I reduced the queries to almost 40 by using prefetch_related but still I think it's quite a lot. Hence, I have added the attributes directly to the Product model (probably not the best approach) considering that right now almost all our products have similar attributes. I compromised on the flexibility of attributes creation and also loosing the attributes being attached to the Product types. But this significantly improved the performance (which is obvious) by reducing the number of queries.
Well, someone could suggest template caching from DTL would be good but still for a page being rendered the first time or after cache expiry- the page loading is hit.
Would really appreciate if anyone could suggest the best approach for the above issue without compromising on the flexibility of attributes.
Thanks.