Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large batch request, best approach ? #64

Open
WitmondPaul opened this issue Mar 12, 2024 · 1 comment
Open

Large batch request, best approach ? #64

WitmondPaul opened this issue Mar 12, 2024 · 1 comment

Comments

@WitmondPaul
Copy link

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

@bgmulinari
Copy link
Owner

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants