In Drupal 7, we have big product catalog where we need to update price and stock frequently via Cronjobs.
If we update only 5000 prices then also it takes around 20 min. In each iteration we use node_load()
and node_save()
functions to update for each product in database.
It seems that these functions are consuming more memory and taking more execution time to just update 1/2 fields in database. It’s drupal’s API, so it would be integrated to some other stuff (like node revision) so I doubt that we can simply replace node functions with direct queries.
But I think, this scenario would be common when we manage large product catalog in drupal.
Can anyone suggest better/optimized approach for this scenario where it doesn’t break the integrity with drupal platform?