InMemory Compression : Can this be an Aspect ?

Discussions

EJB design: InMemory Compression : Can this be an Aspect ?

  1. I don't have much background on AOP and have never used the same in any of my projects. But I do have the basic understanding of the cross-cutting concerns and the power and applicability of AOP.

    Having set the context of my exposure to AOP, I would like to know the experts' opinion about not so strange requirement of compressing the data in memory and modelling it as an Aspect of the system.

    One of my applications queries out thousands of record from the database and keeps it in memory, since a lot of viewing and summary generation takes place. To optimize the memory requirement of this application, various options were discussed and one of those was to keep the data compressed.

    Now how much part of this data can be compressed so that performance is not severely hit by it are some questions which needs to be worked out. But generally thinking from a design view-point I thought of modeling it as an Aspect, so that it can be configured and applied at API level without doing much code changes and making the whole deal seamless.

    So just wanted know, how apt would it be from the AOP perspective and whether any such framework already exists which support InMemory DataCompression in applications ?

    thanks
    Nikhil.
  2. IMHO although AOP is suited to this task in terms of IO retrieval being a seperate aspect to data processing view generation etc I dont think its a good idea.

    Work on your SQL the time taken to compress stuff will be too big.
    If you are keeping stuff in memory for fast access, be aware that good SQL with cached prepared statements will make retrieval times acceptable in most cases.

    Regards

    Greg