EJB design: Dividing db records between instances
I'm new to EJB and I'm looking for a way to divide records in a db table between some bean instances. I'm monitoring some data feeds (say 500 - each with a db record) and I'd like 5 instances to each service 1/5 of the load. I'd also be interested if I should just have 500 instances - this approach seems troubling when numbers grow into the 1000's. New record created in the table need to be sent to one of the instances. I'd appreciate anyones experience in such a model. Thanks!
- Posted by: David Terry
- Posted on: July 19 2006 14:53 EDT
One way of doing this have load balancer session bean do the splitting and post messages to a MDB configured for a queue..and the mdb with a pool size has the logic of updating the database. loadbalancer bean needs to have the intelligence of dividing based on number of instances 500 or 1000 etc., caveats....challenging things if they exist are data integrity - data stomping, constraints, duplicates....etc., if each feed is totally independent from other,..like mathematically -)) no relationship with other... you are all set for a using queue to manage the jobs.... Bhagvan K http://www.jroller.com/page/bhagvank