I have a question that is puzzling me for a while ...
I have a simple Struts app that is not very complex, only 8 forms. I used for the view layer several JSP's with displaytag(not very "strutish" I know ), normal Struts tags and all sorts of necessary input handling struts tag facilities.
I used Struts for the control layer and Hibernate as the ORM technology.
All relatively simple.
My app main purpose is to optimize wharehouse logistics and I apply a number of different algorithms to do so depending on the customer request and needs.
Apart from this I also have a small part of the code (2 actions) ready to interface a legacy system in order to access the customer old database and ERP software.
My question is this one:
Now my application will grow and one of the requirement is that I _must_ have multiple servers running the same application and accessing my current server DB and his local MySQL DB from many locations in the world.
That is, one central DB server and multiple server with the same app on several location in the world.
My question is this: what are the problems anyone has experienced running on the same database multiple instances of the same application with Hibernate ?
The database access and configuration is simple, I could use a ssh tunnel for example and all hibernate configs on the distributed servers would work as if it was a local database(on 127.0.0.1).
My concern however if over the integrity of the application since it runs with multiple independent hibernate instances.
Can I use my app with no modifications, that is direct hibernate sessions on different servers.
Or should I make a different DB access for example through RMI making use on Only one Hibernate app running on the same server.
In my view has the pertinent tables all are transaction enabled there is no problem from the standpoint of the data integrity in the DB.
The problem can be multiple independent sessions of Hibernate running on different servers.
I am wrong on this one?
The issue is really either make zero modifications, a small rmi call mechanism and minor changes or use an EJB component to make the thing work "proper" .
Someone with experience on this could let me know what I am facing ...
The presence of Hibernate doesn't change the basic behaviour of a database application being accessed by multiple clients. Writing some sort of proxy server for your database is overkill. Assuming you are being cautious with caching and using optimistic locking everything should be OK.
Yup, my opinion too ... I foresee no problem with the optimistic locking and transactions on the DB ... this particular application is not very intensive in terms of data access, although the algorithms and calculations are very complex, data access is I would say fairly slow. Also I did not even measure DB access time during the application stress tests ... (do not really know how to do that also, had to figure it out) ... because simply once a user loads all pertinent data for each operation the app takes a Long time to make all calculations ... and I mean a long time (up to 3 minutes sometimes) ... The resulting data from the calculations is then stored in the DB and files but at that stage there is not problem whatsoever.
The issue really is about caching ... I quite frankly am thinking about some radical move like not using caching at all.
Paul Sturrock wrote:The presence of Hibernate doesn't change the basic behaviour of a database application being accessed by multiple clients. Writing some sort of proxy server for your database is overkill. Assuming you are being cautious with caching and using optimistic locking everything should be OK.
Caching is the problem, I can not guarantee what happens on the several servers, if users access the same data for example. On this app the idea of having multiple servers is to distribute the calculation load but the data model must be unique in order to optimize logistics. That's the all point about the new development.
Also the risk increases as com links go down all the time so I have no guarantee of actual DB access all the time ...
The more I think about it the more I feel I have to reduce caching to zero if possible!
I am being too paranoid on this ?