-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Considerations on scaling hibernate application
PostPosted: Mon May 16, 2011 4:49 am 
Newbie

Joined: Wed Feb 21, 2007 1:48 pm
Posts: 8
Hello fellows,

I write to you in search of an advice. I have a decision to make and would appreciate some considerations.
We have a product developed as a web application. The performance of the software is good, and it is able to handle many users. We don't have problems neither with memory and neither with database performance (At least so far).

The problem I am facing is with connection bandwich and latency. Our biggest client has offices in a lot of countries. Currently, some of the stations have really slow connections. Our interface is pure javascript (somewhat similar to gwt) and a lot of javascript is needed to download. Even with caching, it is slow to access, due to the very slow connection. What I would like to do, is to clusterize our application, to provide, in the slow nodes of the client, a server which would provide a fast, nearly local connection.

The architecture of our application is rather "simple".
Our application consists of DWR + Google Guice 2 + Hibernate 3.2 + Hibernate Search. We distribute it together with jetty 6, rather than installing it on client's web container.

Almost all of our services have a public interface, which is visible for dwr to call, a private interface, which is used to connect different services, and a implementation class which implements both interfaces. Guice handles the dependency injection on these services.

We have, in some points, objects which are held in the memory. These are information which almost never change, and when a writing operation is needed, we write both in the entity and on the memory. These consists of country information, organizational structure information and permission profiles. We have a really complex permission algorithm, thats why we keep them in memory.

My question to you is: How can I clusterize this scenario? Which approach would you take?
Please consider in your answer that my biggest concern is time + human resources (=money).

If you need more information, please do ask.

Thanks for your time,
Guilherme


Top
 Profile  
 
 Post subject: Re: Considerations on scaling hibernate application
PostPosted: Mon May 16, 2011 7:01 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
you could try keeping as less as possible in memory and have an additional server "close" to the clients but still using the same database.
This would mean that accessing the database would be quite slow, as the more close you are to the clients with slow connections, the farther you are from the database, but at least you could have a connection pool to the database with ready-to-use connections. I'd recommend a good connection pool as you will need to monitor these connection's health as well.
You could then use a clustered second level cache like Infinispan to aggressively cache most state from the database, and reuse infinispan to keep the complex security state you mentioned as well, so that it gets properly invalidated to each server when you change some permission.
It's a trade-off however, as if your code will trigger many network messages and your network is slow, this might get quite slow.

Using Hibernate Search cleverly for most frequently run queries will definitely help performance, as the searches are performed locally and won't need to run a query on the database; with projections ans second-level cache loading (Hibernate Search 3.4.0) you can retrieve full results even without a database connection.

it's not easy, but can be done. not sure how cheap you can make it, that really depends on your skills. switching to JBoss AS from jetty might help to manage and monitor the connections health and timings, and clustered caching.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.