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

Thread: Clustering with Spring - best practices?

  1. #1

    Default Clustering with Spring - best practices?

    What's the best way to implement a distributed, clustered Java application using Spring? (Without using EJBs...)

    Does anyone have a good success story to share?


    Thanks

  2. #2
    Join Date
    Dec 2006
    Location
    Jakarta
    Posts
    45

    Default

    Can try terracotta for Spring.
    http://www.terracotta.org/
    Isyak Melton
    Senior IT Consultant

  3. #3

    Default

    From searching the web and these forums, there looks to be a few ways to do clustering:

    1. Tangosol Coherence
    2. Terracotta
    3. Cluster4Spring
    4. Homebrew lookup service using a distributed cache


    Coherence is commercial, and probably requires a large time (and $$$) commitment to properly evaluate.

    Terracotta has a lot of buzz, but I'd like to hear from people who've actually used it successfully in production.

    Cluster4Spring I've only seen recently... not sure how viable it is.

    And the homebrew option, while feasible, is hack-y... (why doesn't Spring support something like this out of the box?)

    Thanks,

  4. #4
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    56

    Default

    First of all, why do you want to distribute and cluster your application?
    I know that "clustering" sounds cool, but what exactly do you plan to cluster?

    E.g. if you want to cluster your Web load, you will be happy with Tomcat/Resin, they both support session clustering.

  5. #5

    Default

    I'm not talking about clustering HttpSessions.

    For example, I'd like to have an 3-tier architecture, with separate (Java-based) web-tier and services-tier. Both tiers should be clustered for failover and load balancing. In the web-tier, you're right, I can use HttpSession clustering. But what is the Spring way of clustering the services tier?

  6. #6

    Default

    What is a clustering in your mind?
    ..:: non compos mentis ::..

  7. #7
    Join Date
    Aug 2004
    Posts
    1,905

    Default

    What exactly are you trying to cluster in the middle (services) tier?

    Typically all Spring beans are stateless singletons, or at least thread safe singletons, so there is very little value clustering them.

    Maybe a concrete use case would be useful....
    Colin Yates
    SpringSource - http://www.springsource.com - Spring Training, Consulting, and Support - "From the Source"
    Please read http://www.springframework.org/documentation
    Co-Author of Expert Spring MVC + Web Flow.

  8. #8

    Default

    Sorry, should have been clearer. I meant cluster in the same sense that you would cluster Stateless EJBs. There is no bean state to replicate, but you have load balancing and client-failover across multiple nodes.

  9. #9

    Default

    Quote Originally Posted by Patrick Angeles View Post
    Sorry, should have been clearer. I meant cluster in the same sense that you would cluster Stateless EJBs. There is no bean state to replicate, but you have load balancing and client-failover across multiple nodes.
    If you use only a web-container the web server (tomcat, resin, etc) cares about load balancing. If you use EJB container it cares about load balancing. Where are you using spring?
    ..:: non compos mentis ::..

  10. #10
    Join Date
    Aug 2006
    Posts
    382

    Default Here is an excellent example of clustering a Spring app

    Checkout: http://www.javaworld.com/javaworld/j...31-spring.html

    Spring makes this solution so easy and non-invasive. It is easy to replace the author's JBoss cache with ehCache or Terracotta, without changing your service pojos.
    Greg L. Turnquist (@gregturn), SpringSource/VMware
    Project Lead: Spring Python and author of Spring Python 1.1 and Python Testing Cookbook.
    Listen to Pond Jumpers, the international podcast for open source developers.
    These comments are my own personal opinions, and do not reflect those of my company.

Posting Permissions

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