Bulk update of prices - Most optimal way?

Vote:
 

Hi everybody.

We have a solution with around 200.000 variants/SKUs each of them having around 40 price points (one per market - we have 40 markets).

Once a week we need to adjust all price points for all variants, and we are looking for the most optimal way of doing it. Do any of you have experience in how to bulk update ~8.000.000 million prices in one go?

We have tried to use PriceServiceExtensions.SetCatalogEntryPricesIfNotReadOnly(catalogKeys, priceValuesSubset) to bulk insert prices (e.g. 20.000 price values at a time), but we often end up with an unresponsive server.

#246426
Jan 05, 2021 19:12
Vote:
 

I am working on a solution were we have 135 000 items in the catalog and 56 markets. Every night we process quite a lot of changes from the backend ERP systems.

We use parallell processing and run batches of 100 items at once using Save method on IPriceDetailService with list of IPriceDetailValue as parameter. You need to experiment a bit on how many you can process in one go - often it depends on the capacity of the database.

#246495
Jan 07, 2021 8:14
Vote:
 

Hi Mari - We havent tried the IPriceDetailService yet - Is there a reason for using that compared to the IPriceService?

#246498
Jan 07, 2021 8:33
Vote:
 

Implementation was done a couple of years back in time, can't remember details. But we tried different approaches and at the ended up with IPriceDetailService as best fit based upon requirements. 

Looking into it now, I might lean on IPriceService as best option. Suggested readings:

https://vimvq1987.com/price-optimizing-to-be-or-not-to-be/

https://devblog.gosso.se/2020/11/update-prices-properly-in-episerver-commerce/

#246499
Jan 07, 2021 9:04
Vote:
 

Thank you Mari - We will try to experiment with our different options.

#246500
Jan 07, 2021 9:13
Vote:
 

IPriceDetailService  is best (if not only option) for saving individual price. Like if you only want to update a price in a specific market. IPriceService is for batch saving, it's overwritting all prices of a specific SKU. If you are updating all (or majority) prices of SKUs IPriceService might be a better option. If you are updating only 1-2 prices per SKU, IPriceDetailService might work better. That's in theory. I really need to do some test to try out :) 

#246634
Jan 11, 2021 12:01
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.