Sounds like a block execution to me. Often we have to process many records in a routine and several developers reuse the business layer (java or c#) for this, but, experience shows that you will end up compensating in hardware the implementation or suffering to optimize code and bank trying to gain milliseconds by changing small snippets of code, when, in fact, much of the time spent in the routine is spent on network traffic, connection opening and batch execution management.
The ultimate solution to this does not exist, it will depend a lot on your long-term vision of the system and the size of the records and processing actions you perform, as well as the architecture of your system.
If you don’t want to drill through the layers and really want to ensure that the business rules are always in coding (c#, java,c++ etc.), then you will suffer a little to gain performance.
A simple alternative is to reevaluate whether you really need to pass the list of parameters that is the result of the filter, when you can simply pass the filter and operate the select in the database.
An advantage in this is that you will use only a few parameters circulating through the network (faster) and as you will not have to break the list, will only once in the bank.
Another alternative is to serialize in a string and pass the parameters you need, in my view, if you select this data and a filter, you can pass the filter values to a precedent is faster and easier.
Even, if you carry out a batch processing with the data that is passed (the many records) you could do this in the process that receives the parameters or create a form of scheduling based on filters to process the records in a job.
Avoiding Locking User Screen Expecting Transaction Responses.
You really need 2000 parameters?
– Renan Gomes
Yes, as it will depend on the filters provided on the request screen, which can vary greatly.
– WyllianNeo
But will there be more than 2,000 options on the request screen? If with this request screen you mean a query, it is not very logical to put so many parameters for choice... In my view, it is logical.
– Gustavo Cinque
No, it’ll be some combos, which will search these records in another database, which populate my list, so it depends on the value passed on the combos. I’m sorry if you got confused before, now I’ve been able to clarify?
– WyllianNeo