Question

Here is my question, On google i could find many post that we can implement SCD2 using Dynamic cache...

When we have a dynamic Cache... Suppose a New record comes it gets inserted.... If a changed records comes in then the existing gets updated.

So consider a scenario where a changed records comes in... the existing record will get changed.

Now for SCD2... we update existing and new is inserted as current.

Using Newlookup port we can identify if there is change or new or no change.... and can definitely update insert target as per SCD2 .

But in this case your target table and dynamic cache will be unsynchronized. As your cache will only be updated but your target will have update as well as new record insert as per SCD2 history maintenance.

So if your cache gets unsynchronized with target ...then how can we say SCD2 can be implemented using Dynamic lookup.

Please share your views.

No correct solution

OTHER TIPS

Basically you want to keep only current row versions in sync with lookup cache. Once new row is processed, it goes to Lookup cache and the target table:

Lookup cache                   |    DB Table
Key    Active   Description    |    Key    Active   Description    
-------------------------------------------------------------------
AA1    1        The Moon            AA1    1        The Moon

Now if we get a row with the same key, but description updated:

Lookup cache                   |    DB Table
Key    Active   Description    |    Key    Active   Description    
-------------------------------------------------------------------
AA1    1        The Sun             AA1    1        The Sun
                                    AA1    0        The Moon

Lookup cache will be updated, we insert new row to target table and mark existing row as inactive. Now if you compare active rows, lookup cache is in sync with DB.

Lookup keeps only active records from the target table. That's why we use lookup override. Our motto should be to keep these active records in sync in both lookup and target table. in SCD2, Updated record is inserted in target table with new start date as active record and old record will be end dated. So we need to replace old record with new record in lookup cache to keep the active records in sync.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top