-->
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.  [ 3 posts ] 
Author Message
 Post subject: Using Hibernate with Amazon Auto Scaling Groups and JBoss
PostPosted: Wed Oct 16, 2013 9:00 am 
Newbie

Joined: Wed Oct 16, 2013 8:53 am
Posts: 3
Hi,

I have a JEE 6 backend application running on JBoss with a HTML/JS front end running on nginx. I have set up an Amazon VPC. Auto scaling for web instances works fine.

The JEE 6 back-end uses Hibernate to talk to MySQL DB. I had wanted to run each JBoss instance in standalone mode in an autoscaling group all talking to one Amazon RDS instance (I have been warned off running MySQL in clustered mode by many people and in addition my txs are r/w this would be very slow too writing to master and reading from slave in one tx).

I am not a Hibernate expert. Running as I had planned has/does/will cause untold problems with Hibernate caching, or so I am told -- I had thought this would not matter as each JBoss/EC2 instance would have no knowledge of each other but apparently Hibernate caching has other ideas.

How best can I achieve HA at application sever tier --e.g Auto scaling group while still using Hibernate as my persistence layer towards my MySql DB.


Thanks, Any suggestions welcome...

T


Top
 Profile  
 
 Post subject: Re: Using Hibernate with Amazon Auto Scaling Groups and JBoss
PostPosted: Thu Oct 17, 2013 6:46 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
what kind of caching are you worried about?

The so called "1st level cache" aka the Session itself is by definition consistent with the transactional context so there is no trouble there even in clustered configurations. Nothing to worry about for this one.

The second level cache needs to be activated explicitly - because as you say without being aware of how it works it could cause trouble either with stored procedures/triggers or other external changes, or even "external changes" as other JBoss instances running in different machines.

In no case there are "untold problems", I think the documentation and all literature are quite clear about the limitations and configuration levers to activate.

Specifically for JBoss instances, IF you need 2nd level caching you will want to setup JBoss clustering: that will also setup cache coherence protocols across nodes. Assuming you're running JBoss AS7 or EAP 6, the caching technology will be Infinispan, using JGroups as a communication transport.
Just to warn you where to look for docs: JGroups requires specific configuration for EC2 because of the limitations in multicast networking on that environment.

For sake of simplicity I would advise to see if you're all set without using 2nd level cache: nothing to setup and nothing to worry about.

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


Top
 Profile  
 
 Post subject: Re: Using Hibernate with Amazon Auto Scaling Groups and JBoss
PostPosted: Wed Apr 16, 2014 11:33 am 
Newbie

Joined: Wed Oct 16, 2013 8:53 am
Posts: 3
Hi ,

Apologies for re-opening an old thread but I didn't want to start a new one with a similar question.

1. To answer you;re previous question I am not using L2 caching

At the time I asked the question, we didn't have time to test the scenario mentioned in the question (my preferred option) so we went with a JBoss cluster (in domain mode) running in master-slave mode. We are back at the same crossroads again and I would like to utilise Amazon Auto Scaling. So to summarise:

1) I want to have 1 to many JBoss instances running in standalone mode on different VMs (started by AWS auto scaling on demand)
2) All instances will use Hibernate to talk to a single MySQL instance (Amazon RDS instance)
3) To confirm your previous answer there will be no issue with 'conflicting' L1 caches as each instance will not know about each other so this 'architecture' is supported in this context?
4) What is the procedure(suggested config) for two or more instances accessing the same piece of data at teh same time? How do I prevent the second instance reading until the first instance has updated? Is this DB or JPA config?
UPDATE: I am guessing that this is handled by JPA/Object version?
5) Am i missing any other gotchas?

Apologies if is sound nervous about this setup!

Thanks again in advance..
T


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.