Correlation is a pattern which is similar to bi-directional sync but this sync happen only whenever there is a requirement of having similar data set in another system. Think a large bank having different branches across cities. If any Customer A is register to Branch X then there is a no need to sync this Customer A information to other branches (if required then this can be done using bi-directional sync). Now if same Customer A moves to different city and go to Branch Y to open his account then through Correlation pattern we can get the actual Customer A information from Branch X and sync it with Branch Y
Correlation pattern is more about intersection of data sets which means data which is common between two system (Customer A data available in both Branch X and Y) and happen naturally (Customer A move to different city)
Real challenge is how we can define the customer in both branch say if both use different way of storing customer information. Filter criteria to select customer from different system should be correct otherwise we end up creating a wrong dataset in another system. Example finding a Customer on SSN will make sense over first name and last name or include both SSN and name. if we only go with first name and last name there are good chances we might end up creating wrong data set in another system.
MuleSoft API led approach in Correlation
Source system can be group of system which participate in providing the data set e.g. Brach X, Y, Z and others providing Customer data. Target can be one of the System which need similar data in case of any need. Like Brach Y need Customer A data from Branch X
Process API – We can have an interface to provide Customer data where data can come from any of the System – Bank Branch X, Y and Z. Similarly it can provide the interface to create the data set in the target System – Branch Y
System APIs – for all the systems which participate in providing the data set.
Here Canonical definition of Customer in interface will take more precedence over the context bounded as this will help in uniformly defining the Customer entity throughout organization.
Reference blog – data-integration-patterns-correlation