Storing Information in IS 6.1 Memory

Hi,

We are looking for a way to store in the memory of the IS some fairly complex configuration data (so using pub.storage is not an option). The natural answer seems to store everything in a static class, with a service doing the load at the package start.

However, as access to data would have to be synchronized, there is a risk of the access of this component becoming a bottleneck, especially as our project is very high volume.

I would like to know if someone already used static objects in the IS memory as ‘memory storage’ and if so, what were the issues involved (especially performance).

Thanks for your help.

The contraint is the requirement that “access to the data would have to be synchronized”. This means that there isn’t a way to have multiple concurrent read operations, then you will always have a bottleneck.

I would think that configuration data could have a “synchronized mode” for use during development, when the configuration data is being changed often, but then could be set to run in unsynchronized read mode during production. You could have a service that could set the mode back to synchronized in case the production system configuration needs to be tweeked. You configuration get/set methods could look something like:

private HashMap configData = new HashMap();
private static boolean shouldSynchronize = true;
private static int DATA1_DEFAULT = 10;

public int getConfigData1(int data1Value)
{
   if (shouldSynchronize) {
      synchronize(configData) {
         return getConfigData1Unsynchronized();
      }
   else
      return getConfigData1Unsynchronized();
}  
private int getConfigData1Unsynchronized() 
{
   Integer data1 = (Integer)configData.get("data1");
   if (data1 != null) return data1.intValue();
   else return DATA1_DEFAULT;
}
public void setConfigData1(int data1Value)
{
  synchronize(configData) {
     setConfigData1Unsynchronized(data1Value);
  }
}  
private void setConfigData1Unsynchronized(int data1Value) 
{
   configData.put("data1", new Integer(data1Value));
}
public void setShouldSynchronize(boolean value) 
{
   shouldSynchronize = value;
}

public boolean isShouldSynchronize() 
{
   return shouldSynchronize;
}

What does everyone think?

We have implemented something like this in IS 6.0.2. Once the data is in memory it does not change very much so having to synchronizing the writes is not a big issue, the reads are unsynchronized and the information is stored in a static attribute.

So far we have not had performance issues where the memory lookups are a bottleneck since the reads are unsynchronized. Memory has not been an issue since we try to keep the amount of information that is stored this way relatively small.

One implementation reads information from a database to load the memory store as a startup service and has admin functions to clear the memory store and list its contents. The other implementation is more along the lines of a cache for the DB, if an entry is needed it is looked up in the DB and also stored in memory so that the next time that entry is used we do not have to go back to the DB, it also has a service to clear the memory.

For low volume of configuration data we could use the server file storage; however, I would suggest the of static xref table ATC_XREF table for high volume storage. You could peronalize the five colums: App_id; Obj_name; native_id(enter this value); canonical_id(enter this value); latch(default= ‘N’)

After having two pointers ( native_id and canonical_id) to the configuation data you could do a look up for these values in your flow by calling the services from the <WmPublic//pub.synchronization.xref> folder.

Let me know if you need more information.

Regards,
Animesh

Can someone tell me where is the ATC_XREF table? How can I access this table if I need to do a bulk load of data. Also, what are the performance impacts of using the XREF table Vs any other database table?

Thanks,