I'm working at a site similar to Foursquare and Yelp, with approximately 100000 unique requests each week that generates content, growing steadily. We are currently using:

  • Seam as Java web framework.
  • MySQL as DB
  • Hibernate as ORM
  • Hibernate Search as Index
  • EhCache for Caching.

Since our site is slowly growing out of the current setup and has a lot of legacy code, it is time for us to start thinking about a major refactoring/changing setup.

  1. Web framework

    We are not ready to change the language but we are leaning towards Spring Web Framework, since:

    • Seam is no more.
    • Almost all of us have worked with Spring and liked it.
  2. DB and ORM

    We have done a little research and we are thinking about MongoDB.

  3. Index

    Do we need to have a separate Index if we use MongoDB?

  4. Cache


So my question is basically:

If you take Spring Web Framework and MongoDB into consideration, how would a good setup be for a web application that is growing and handles a lot of logged in users generating input and performing searches?

EDIT I would like to thank all of you for taking the time to answer me, but the answer I'm looking for should be more specific:

"We choose Spring as our web framework and Freemarker as our template language since freemarker is fast.... If you use MongoDB you will not need a separate index for doing geo searches since MongoDB supports location-based queries out-of-the-box... I very good cache solution to this setup is.... In my previous project we chose to use Apache Solr as our search platform because this solved the issue with fast updates..."

Thank you // Jakob

closed as too broad by user40980, GlenH7, mattnz, Dan Pichelman, DougM Jul 24 '14 at 19:19

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Have you considered how you will spread over multiple boxes? – user1249 Nov 13 '11 at 18:49
  • 1
    Also why do you say Seam is no more? – user1249 Nov 13 '11 at 18:51
  • Great strides have been made in JSF lately with multiple open source component libraries and Spring integration. Not trying to sell this to you but it is worth looking into if you like Spring and are looking for a more modern and widely accepted solution for your presentation layer. – maple_shaft Nov 14 '11 at 3:54
  • @Thorbjorn: in.relation.to/Bloggers/SoWhatsHappeningWithSeam – jakob Nov 14 '11 at 7:31
  • 1
    I believe that if Java EE 6 is essentially Seam formalized, this might be the path of least resistance for at least parts of your current application. Do not underestimate the effort needed to mature new code to production quality status. – user1249 Nov 14 '11 at 11:38

You'll want to do some serious research.


It doesn't sounds like you have a clear idea of the performance profile of your application/tech stack. Where are the pain points? Why does it need replacing?

Take measurements first so that you've got something to measure improvements against going forward.

This will help you avoid adding in unecessary technologies/layers that may help less than you think and in some cases even hinder!

Web Framework Replacement

  1. Have a look at Matt Raible's comparison presentation on JVM Web Frameworks and then drop the 20 criteria he uses into a spreadsheet and apply weightings to them according to your functional and non-functional requirements.

  2. Pick 2-3 that seem to fit your requirements best and prototype some pages/UI/Ux/workflow with those. Probably spend 2-3 days on each as a minimum (1 week if you can get away with it)

Data Store

  1. What are they chracteristics you need from this data store? Fast read, slow write? Something else? Distributed? Transactional?

  2. Does it need to be Object based? Relational?

Once you've asked and answered some of these questions then you need to pick 2-3 datastores and prototype with them, much like you would with the web framework choice. Some of the popular NoSQL DBs at the moment are MongoDB (although it might still have that global lock problem, not sure), Cassandra and CouchDB. But don't take anyone's else's word for it. Measure it yourself.

Cloud provisioning

As an aside, have you looked into the financial use case for this? With your rate of expansion, some private/public cloud options could really help you out.

Hope That Helps (HTH) a little :-)


Matt Raible's comparison presentation is pretty weak and a bit biased (the latter I read on the net). As it often happens the answers we get plainly follow from criteria we choose. However different audience quite naturally has different criteria. Examples. Student will prefer something that is described in a textbook he can take in the library. Big company CEO will probably (it happens often) prefer something sold by a brand name company (like IBM). Small company will have a chance to choose a technology that most of the engineers know or prefer. Scientist will have his own approach.

In fact there are very very few honest publications comparing several Java Web Frameworks. Matt's work put all criteria he knows in a big heap and missed some other. I do not recall him even mentioning such criteria as "component-oriented" which is crucial (if not a synonym) for code reuse.

Spring may be good but not in the presentation layer. AFAIK it usually uses Struts which is way obsolete. As minimum because it is bound to JSP which is definitely (by definition from Oracle included in Java EE 6) obsolete. In fact it got obsolete way before that.

Consider using HybridJava for presentation layer with FANTASTIC performance.

@maple_shaft "HybridJava ... is interesting but it looks very green" - In some way yes - not widely used yet. Tools like plugins still in early development stage. On the other hand in its scientific base it does not change already for 2 years. Specifically - the language does not change (and hence code of compiler does not change). And even no change is expected here. If you can add some idea here - try, the team will be happy to implement! Ironically the tutorial will not get any bigger - right because one of the major aims was to make all describable in just few pages and exactly in that HybridJava excelled.

Use it and it'll become yellow.

  • because it is bound to JSP On the contrary, Spring is far from obsolete as Spring 3 provides a Faces EL resolver that allows for the JSF 2 EL resolver to treat Spring beans as managed properties. Further I was able to integrate Spring 3 security fairly easily as well with JSF 2. There are a number of tutorials online that explain how to easily do this. The next Spring major release will include full JSF 2 integration. Oracle agrees that JSP is obsolete and that JSF 2 is their official recommendation for web development. As far as HybridJava goes it is interesting but it looks very green. – maple_shaft Nov 14 '11 at 3:50
  • Matt's comparison needs to be taken with a grain of salt - what's missing is his context. He strongly recommends that you put th ecriterai into a weighted spreadsheet for your own comparison. – Martijn Verburg Nov 14 '11 at 8:43
  • @Martijn Verburg The problem is: Myself as an example. As a scientist I developed (part of) HybridJava. As an workforce I am moving from Spring to JSF (IBM) because CEO (whom I never met) trusts IBM. So first I have to decide who I am. – Dima Nov 15 '11 at 1:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.