Feb 4, 2010

Informatica: Caches


Types of Caches;
1.Static Cache
2. Dynamic Cache
3. persistence cache


Definitions;

Static cache: U can configure a static or readonly cache for only lookup table.By default informatica server creates a static cache.It caches the lookup table and lookup values in the cache for each row that comes into the transformation.when the lookup condition is true,the informatica server does not update the cache while it prosesses the lookup transformation. 

Dynamic cache: If u want to cache the target table and insert new rows into cache and the target,u can create a look up transformation to use dynamic cache.The informatica server dynamically inerts data to the targettable. 


Persistence cache: If you want to save and reuse the cache files, you can configure the transformation to use a persistent cache. Use a persistent cache when you know the lookup table does not change between session runs.
The first time the Integration Service runs a session using a persistent lookup cache, it saves the cache files to disk instead of deleting them. The next time the Integration Service runs the session, it builds the memory cache from the cache files. If the lookup table changes occasionally, you can override session properties to recache the lookup from the database. 
Shared cache. You can share the lookup cache between multiple transformations. You can share an unnamed cache between transformations in the same mapping. You can share a named cache between transformations in the same or different mappings.

static cache is one in which data when changed in the target table cannot be incorporated in the look up while the session is running.
when you use a dynamic cache any changes to the target table gets reflected in the lookup even if the record is being inserted or updated in the same mapping run priorly
By default lookup is static.
Dynamic is used whn the records coming frm the source to target in multiple times. i.e if
1)emp_id=101...city=hyd...age=25...                          (first this is inserted to target)
2)at second time when 101 employee is changing his city frm hyd to chennai here we need to update the target table with city name as chennai. thn how lookup cache knows tht a
record is updated...
3) if it is static lookup, after updating tht record it will not refresh the lookup cache.... where as if it is dynamic cache it will refresh the cache....
4) Based on our requirement we r going to use.....
Use dynamic cache, if target itself is a lookup table.

tell me the scenario where I should use dynamic cache. 
We use dynamic cache when the target table is also the lookup table. In this scenario we need the data just inserted into the target to be reflected in the cache also , so we go for dynamic caching. This dynamic caching will enable us to flag rows for insert,update or no change.
We use static cache when the lookup is not a target or there is no need for the lookup cache to be in sync with the Target table.


difference between static cache and dynamic cache:
In case of dynamic cache, when we are inserting a new row it checks the lookup cache to see if it exists, if not inserts it into the target as well as the cache but in case of static cache the new row is written only in the target and not the lookup cache.
The lookup cache remains static and does not change during the session but incase of dynamic cache the server inserts, updates in the cache during session.



For a cached lookup the entire rows (lookup table) will be put in the buffer, and compare these rows with the incomming rows.

where as uncached lookup, for every input row the lookup will query the lookup table and get the rows.

In Cache Lookup a cache will be created of that Lookup table and IS query once for mapping rows for Uncache lookup No cache will be build and IS query for each Mapping rows.
So for performance Go for Cache lookup if Lookup table size< Mapping rows
Go for UnCache lookup if Lookup table size> Mapping rows

8 comments:

  1. Nice post. Great blog. Thanks for the share. Keep posting such kind of information on your blog.
    html5 audio player

    ReplyDelete
  2. is the static cache built every time the session run...?

    Thanks
    Bira Kishore
    kishore.msg2u@gmail.com

    ReplyDelete
    Replies
    1. yes. by default if you use static option it will create.

      Delete
  3. Replies
    1. Cache is a infa generated file to store the data from the o/p of transformation.
      For example
      If u unchecked the option of cache in lkp trns it will directly hit the DB and runs for every i/p record which will make perf degrade.

      Delete
  4. Please clarify following doubts
    1.we are sharing cache in persistence cache(we can reuse the lookup in different transformation) then why to opt for shared cache.
    2.when should we go for shared cache.
    3.Difference between shared and persistent cache.

    Thanks,
    *****

    ReplyDelete
    Replies
    1. By default, the Integration Service shares the cache for Lookup transformations in a mapping that have compatible caching structures. For example, if you have two instances of the same reusable Lookup transformation in one mapping and you use the same output ports for both instances, the Lookup transformations share the lookup cache by default.

      pls check this:
      https://community.informatica.com/solutions/sharing_unnamed_cache_session

      Delete
  5. I have a small doubt ,

    What is the difference between Cache and cache file in Informatica?

    If there is any limit for cache?

    ReplyDelete