1 Reply Latest reply on Mar 26, 2004 3:50 AM by Ulf Schroeter

    Is FastLaneReader pattern scalable?

    neilthorne Newbie

      I've used FastLaneReader pattern in the past to create read only lists.

      My concern with it though, is that since there is no caching at the appserver layer (unless you write it yourself), you will end up having lots of calls into the database for the same reads, plus a lot of serialization overhead.

      Once I get lots of users making calls and I don't write some caching layer eventually the database connection will become a bottleneck right?

      How do Read Only beans compare?

      I should get caching for free - better than FLR wrt. dev time
      The JDBC calls are done for me (CMP) - better than FLR wrt. dev time
      No transaction overhead since RO (?) - no extra overhead there
      Built in Security - (I need it) so better than FLR unless I wrap with Session bean anyway
      The JDBC calls might not be optimal - worse than FLR but only for the first look up, and I doubt the JDBC call is that bad (?) ?

      once caching is in place then I imagine the difference between the two solutions is minimal anyway wrt. performance - so is it a question of just getting to grips with JBoss caching strategies for CMP beans?

      Should I leave FLR alone?

        • 1. Re: Is FastLaneReader pattern scalable?
          Ulf Schroeter Novice

          I think that you have to evaluate the performance of both approaches. CMP entity creation includes A LOT of processing overhead, especially in situations where you generate things like multi entity reports ! To get an impression, just debug into the internals of a simple entity create or find operation....

          You also have to think about the effectivness of CMP entity caching.
          Even with CMP entity caching there will be database access for most of your find operations, because the the CMP engine has to query for a collection of primary keys of all entities affected by you find criterias ! In a second step the CMP engine will retrieve all entities based on that PK query and maybe will find some entities in the cache, but others might require additional ( and under worse circumstances even multiple ) database queries !

          Therefore DO NOT overestimate the performance benefit of caching. As always you have to measure the performance of different strategies !