B1SLayer icon indicating copy to clipboard operation
B1SLayer copied to clipboard

Large batch request, best approach ?

Open WitmondPaul opened this issue 11 months ago • 1 comments

Hi Bruno,

What is the best solution to update a large number of special prices ? We must update 1.000.000 prices on a regular basis.

Regards,

Paul

WitmondPaul avatar Mar 12 '24 08:03 WitmondPaul

Hi, @WitmondPaul.

Batch requests are not really meant for such a large procedure (updating all in one go). Each operation inside a batch is processed sequentially by Service Layer, so the larger your batch, the longer it will take for it to complete. The main advantages of batch requests is the reduction of the network latency and the possibility to use a global transaction.

However, that does not mean will couldn't use batch requests for this. For your use case, I believe the best approach would be to split this load into several batches (100 updates per batch or so), but more importantly, developing it in a way that you can send several batch requests in parallel (non-sequentially), taking advantage of the asynchronous programming model in C#.

If you are not familiar with this concept, I recommend the reading: https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/

bgmulinari avatar Mar 12 '24 14:03 bgmulinari