[prev in list] [next in list] [prev in thread] [next in thread] 

List:       japple-user
Subject:    Re: [japple-user] Use of ServletContext for storing static information shared across all users
From:       John Shimer <jshimer () saucontech ! com>
Date:       2002-04-04 20:12:18
[Download RAW message or body]


Michael Schulz wrote:

>
>
>As we are designing our object model, a concern arises regarding using the
>ac or dc accessor for everything.  If userA views a list of digital cameras
>and then userB views that same list, the ac or dc context for each user 
>will
>contain a duplicate set of items. 
>
We would place the digital camera list into temp which is cleared after 
each request ends. This keeps memory usage down, but does require repeat 
trips to the database.

Most of our japple applications rely on the database to serve as the 
central cache of data. With this approach memory usage from within the 
application servers is kept to a minimum and the data is always current. 
Overall application design is also simplified, and this makes the 
applications easier to create and maintain.

Successful implementation requires that your database performance can 
keep up with user demand. 

> Now if we scale up to 1,000 users, we 
>see
>that the duplication of data and potential waste of RAM on the server is
>significant.
>
>We have confirmed that our japple jsp jmo's can access the Servlet API
>ServletContext very easily.  Furthermore, any java object can be placed in
>the servlet context.  So we are thinking about coding some jmo jsp's that
>look in the servlet context first to see if the desired data exists.  If 
>the
>data does exist, the content will be a japple DataModel or
>DataModelCollection, and it can be referenced directly in the jsp.  If the
>content does not exist, the jsp will call a service that loads the content
>from the database and places it in the servlet context, and then proceed to
>use that data.  Our first component to use this approach will be our 
>catalog
>index.  Furthermore, we will be use a scheduled service to update the 
>cached
>index on a regular basis so the data does not become too stale.  We
>anticipate updating the index 2 or 3 times per day.
>
>we have some questions about this approach:
>
>        has anyone else used this approach?
>
Not that I know of. As mentioned earlier, we use the database as a 
central point to share data from.

>
>
>        can anyone see any issues that might prevent this design from being 
>useful?
>
Keeping the data fresh, would be the main issue that I see. Secondly, 
you might have a synchronization issue with populating the shared area. 
For example, if two clients request the same list, that has not been 
cached, at the same time, you would want to synchronize this so that 
multiple initializations are not performed.

>
>
>        is there a reason that japple does not store anything in the
>servletContext?
>
The japple engine has been designed so that it can exist outside of a 
servlet container (ie Tomcat). In these other environments, the 
servletContext would not be available.

>
>
>        is our concern about loading up the user (aka Java Servlet API
>SessionContext) data model with a large amount of data unfounded?
>
Absolutely not, you want to keep the size of  state held on to by the 
SessionContext to a minimum.

>
>
>Any and all feedback or insight regarding these questions are appreciated.
>
>-Michael Schulz
>
>_______________________________________________
>japple-user mailing list
>japple-user@japple.org
>http://www.japple.org/mailman/listinfo/japple-user
>



_______________________________________________
japple-user mailing list
japple-user@japple.org
http://www.japple.org/mailman/listinfo/japple-user
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic