For example. 2 Datasources, the 1 database you are allowed to meddle with, the other you are not. The 2 datasources contains Person records and you need to perform the following functions.
- Find matching persons from both data sources
- Run business rules on these matched persons (this might be to check whether the person has received a salary increase and so forth
- Mark the orphan persons and persist the person's to a database.
The reason for the question is performance and ensuring that an optimal solutions is used. Looping through each and every matched person might be slow but doing it in code is definitely maintainable.
Note: There might be 40k Persons to run business rules on.