Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6694475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:06:22+00:00 2026-05-26T06:06:22+00:00

Currently we are building web services applications with Spring, Hibernate, MySQL and tomcat. We

  • 0

Currently we are building web services applications with Spring, Hibernate, MySQL and tomcat. We are not using real application server- SoA architecture. Regarding the persistence layer – today we are using Hibernate with MySQL but after one year we may end up with MongoDB and Morphia.

The idea here is to create architecture of the system regardless concrete database engine or persistence layer and get maximum benefits.

Let me explain – https://s3.amazonaws.com/creately-published/gtp2dsmt1. We have two cases here:

Scenario one:
We have one database that is replicated (in the beginning no) and different applications. Each application represents on war that has it’s one controllers, application context, servlet xml. Domain and persistence layer is imported as maven lib – there is one version for it that is included in each application.

Pros:

  • Small applications that are easy to maintain
  • Distributed solution – each application can be moved to it’s own tomcat instance or different machine for example

Cons:

  • Possible problems when using hibernate session and sync of it between different applications. I don’t know that is possible at all with that implementation.

Scenario two – one application that has internal logic to split and organize different services – News and User.

Pros:

  • One persistence layer – full featured of hibernate
  • More j2ee look with options to extend to next level- integrate EJB and move to application server

Cons:

  • One huge war application more efforts to maintain
  • Not distribute as in the first scenario

I like more the first scenario but I’m worried about Hibernate behavior in that case and all benefits that I can get from it.

I’ll be very thankful for your opinion on that case.

Cheers

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:06:22+00:00Added an answer on May 26, 2026 at 6:06 am
    • Possible problems when using hibernate session and sync of it between different applications. I don’t know that is possible at all with that implementation.

    There are a couple of solutions that solve this exact problem:

    Terracotta

    Take a look at Hibernate Distributed Cache Tutorial

    Also there is a bit older slide share Scaling Hibernate with Terracotta that delivers the point in pictures

    Infinispan

    Take a look at Using Infinispan as JPA-Hibernate Second Level Cache Provider


    Going with the first solution (distributed) may be the right way to go.

    It all depends on what the business problem is

    Of course distributed is cool and fault tolerant and, and,.. but RAM and disks are getting cheaper and cheaper, so "scaling up" (and having a couple hot hot replicas) is actually NOT all that bad => these are props to the the "second" approach you described.

    But let’s say you go with the approach #1. If you do that, you would benefit from switching to NoSQL in the future, since you now have replica sets / sharding, etc.. and actually several nodes to support the concept.

    But.. is 100% consistency something that a must have? ( e.g. does the product has to do with money ). How big are you planning to become => are you ready to maintain hundreds of servers? Do you have complex aggregate queries that need to run faster than xteen hours?

    These are the questions that, in addition to your understanding of the business, should help you land on #1 or #2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a web application with RESTful web services using Spring MVC 3.
I am building a web application that is currently PHP with MySQL. There is
I'm building a MVC web application (using the Spring MVC framework), and I'm a
I'm currently building a SmartGWT-based web application (using the Portlet Layout). So I have
I'm currently building a .net web application that uses WCF web services to allow
I am currently building a web site and I just implemented SqlCacheDependency using LinqToSQL
I'm currently building a web form using APEX that is losely modelled after a
I am currently building an internal web application used in a factory/warehouse type location.
I'm currently building a small web application that includes a fair amount of JavaScript.
I'm currently building a Jython web app but am concerned about Jython application performance.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.