Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Which is better to use - EHCache, OSCache or Swarmcache

  1. #1

    Default Which is better to use - EHCache, OSCache or Swarmcache

    I have some relatively large XML documents that I would like to cache for a period of time. I already cache the query from the DB using OSCache with Ibatis SQL Maps. I would like to know you opinion of caching the XML document that is then create from this data. Would you suggest using EHCache, OSCache or SwarmCache? Why?

    If you have done this analysis before, please share any performace results you may have. Thank you.

  2. #2
    Join Date
    Aug 2004
    Posts
    19

    Default

    I think JBoss Cache is better . JBoss cache is a fully transactional, cluster-safe caching system.

  3. #3
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    Take a look at Table 14.1. Cache Providers, it summarize some of the differences between these cache providers.
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  4. #4

    Default

    Funny thing, I was reading 'Hibernate in Action' this weekend and saw the comparison in the book. Thanks though.

    I decided to go with Ehcache and re-used Ben's code and bean set up for what was done in Acegi. I wanted to use OSCache but the documentation is very weak.

  5. #5
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    Great choice

    Spring Framework 1.1.1 allows for configuring EHCache using IOC. Take a look at package org.springframework.cache.ehcache (in cvs) for more details.
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  6. #6
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    If I were starting a new project, I'd use Spring's new org.springframework.cache.ehcache package. Acegi Security will be depreciating its implementations in favour for this package once it's in a Spring core release.

  7. #7

    Default

    Quote Originally Posted by Ben Alex
    If I were starting a new project, I'd use Spring's new org.springframework.cache.ehcache package. Acegi Security will be depreciating its implementations in favour for this package once it's in a Spring core release.

    Thanks Ben. I took irboubo advise and got the package you metioned from CVS. I also updated my AGEGI provider to use it. Work fine so far.

    Code:
    <!-- ##################################################### -->
    	<!-- ################## Ehcache setup #################### -->
    	<!-- ##################################################### -->
    	
    	<bean name="mwEhcacheMgr" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
    		<property name="configLocation">
    			<value>/WEB-INF/ehcache.xml</value>
    		</property>
    	</bean>
    	
    	<bean name="WBSCacheFB" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
    		<property name="cacheManager">
    			<ref bean="mwEhcacheMgr" />
    		</property>
    		<property name="cacheName">
    				<value>WBSCache</value>
    		</property>
    	</bean>
    	
    	<bean name="UserCacheFB" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
    		<property name="cacheManager">
    			<ref bean="mwEhcacheMgr" />
    		</property>
    		<property name="cacheName">
    				<value>UserCache</value>
    		</property>
    	</bean>
    	
    	<bean id="userCache" class="com.method.util.EhCacheBasedUserCache">
    		<property name="cache">
    			<ref bean="UserCacheFB" />
    		</property>
    	</bean>
    	
    	<bean id="wbsCache" class="com.method.util.WBSCache">
    		<property name="cache">
    			<ref bean="WBSCacheFB" />
    		</property>
    	</bean>

    Code:
    <bean id="mwAuthenticationProvider" class="com.method.security.MWAuthenticationProvider">
    		<property name="userCache">
    			<ref bean="userCache" />
    		</property>
    		<property name="authenticationDao">
    			<ref bean="methodDao" />
    		</property>
    	</bean>
    Code:
    <bean id="showWBSController" class="com.method.web.browse.xslt.ShowWBSController">
    		<property name="methodNameResolver">
    			<ref local="showWBSControllerResolver" />
    		</property>
    		<property name="methodDBFacade">
    			<ref bean="methodDBFacade" />
    		</property>
    		<property name="pathMapping">
    			<ref local="pathMapping" />
    		</property>	
    		<property name="wbsCache">
    			<ref bean="wbsCache" />
    		</property>		
    	</bean>
    ehcache.xml

    Code:
    <cache name="WBSCache"
            maxElementsInMemory="10000"
            eternal="false"
            timeToIdleSeconds="124416000"
            timeToLiveSeconds="124416000"
            overflowToDisk="false"
            diskPersistent="false"
            diskExpiryThreadIntervalSeconds="120"
            />
    		
    		
    		<cache name="UserCache"
            maxElementsInMemory="10000"
            eternal="false"
            timeToIdleSeconds="300"
            timeToLiveSeconds="300"
            overflowToDisk="false"
            diskPersistent="false"
            diskExpiryThreadIntervalSeconds="120"
            />

  8. #8

    Default

    A newbie question. Is com.method.util.EhCacheBasedUserCache a class of your own? How does it look like?
    Julian Garcia.

  9. #9
    Join Date
    Feb 2006
    Posts
    7

    Default Jcs

    I'm working a basic comparison of EHCache and JCS. The JCS disk store is much more sophisticated and the JCS LRU Memory cache appears to be twice as fast as EHCache.

    http://jakarta.apache.org/jcs/JCSvsEHCache.html

  10. #10
    Join Date
    Aug 2004
    Location
    Sydney
    Posts
    503

    Default

    I think JBoss Cache is better
    +1

    If you're building a system that can run on one box, by all means use the other caches, but if you have 2 or more servers then your only practical choice is JBoss TreeCache.

Similar Threads

  1. Acegi + EhCache in cluster environment
    By newreaders in forum Security
    Replies: 10
    Last Post: Nov 9th, 2007, 07:20 PM
  2. EhCache initialization problems
    By viniciuscarvalho in forum Container
    Replies: 2
    Last Post: Jun 28th, 2005, 03:44 AM
  3. Spring - Hibernate - EHCache - Web App
    By macalla in forum Data
    Replies: 3
    Last Post: Jun 15th, 2005, 04:46 AM
  4. EhCache Error
    By monkeyMojo in forum Security
    Replies: 3
    Last Post: Dec 31st, 2004, 04:24 PM
  5. Problem with userCache using ehCache.
    By nicholsl in forum Security
    Replies: 1
    Last Post: Oct 14th, 2004, 04:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •