Thursday, April 26, 2007

Dual Authoritative Data Sources

I have found that in some environments it is a requirement that MIIS sync data that can be authoritative from multiple sources.
After some deep thinking, I came up with a very good way of doing this.

Here's how to handle it.

On each ma you setup an import flow that flow to it's own metaverse attribute

Example:

Import Flow

Data Source 1 Metaverse
givenName => DS1_givenName

Data Source 2 Metaverse
givenName => DS2_givenName

You need to create advanced flow rule extensions to flow to each metaverse attribute.
In the advanced flows you need to check if there is a null value in the data source.
This is so that when one of your data sources flows a delete, the metaverse attribute gets populated with a value.
You can use any type of character or characters in the metaverse to represent a null metaverse value.
We do this because if you have no value in the datasource then there will be no value in the metaverse attribute. We need to have this in the metverse attribute because any time a value is flowed to the metaverse, a date value is set.
We will use this date value in the advanced export flow code to determine which value is the newest value.

Example:

Export Flow

Metaverse Data Source 1

DS1_givenName + DS2_givenName => givenName

Metaverse Data Source 2

DS1_givenName + DS2_givenName => givenName

In the export flow code you need to compare the date values on each metaverse attribute by returning the LastContributionTime value from the metaverse attribute.

Here's an example.

mventry("metaverse attribute").LastContributionTime

Once you figure out which value is the newest, then you can check each value to see if it is representing a null value, if it is then you should flow a delete to the data source otherwise just flow the attribute value.

When implementing a solution like this, you really need to think about how everything is going to flow and what data source will take precedence from the beginning.

When you project the metaverse object from the first data source and import these values, they will have that current date timestamped on the attributes.

Now when you join the other data source it will also flow values to the metaverse and these attributes will be newer than the previous data source attributes because the dates are more current then the others.

With some proper planning and testing this solution can be implemented without error.

Good Luck...