Very good question - we have a similar problem here. We use server side Java (non EJB) and have the additional reuirement that we want to load balance accross a number of VMs (and potentially machines). What I am experimenting with is the following setup: WebServer - Set of VMs to run JSP which are session aware load balanced. These JSP VMs maintain all user sessions and are responsible for creating HTML on the fly. Currently these VMs also query the database(s) using an O/R mapper and all synchronization is done via the database. What I would like to do, is to make these VMs talk to (an number) of EJB servers to be able to invoke business methods under transactions. This setup means, I cannot use the embedded servlet engine configuration, as this prevents the loadbalancing. Comments anyone? Cheers, Robert. > -----Original Message----- > From: Chris Todd [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 30 November 2000 15:56 > To: jBoss > Subject: [jBoss-User] a little OT: RMI serialization vs. direct DB > connection over network > > > The recent thread on jBoss performance, and Marc's explanation of the > relative cost of serialization got me thinking about the > efficiency of the > architecture of an application I'm working on. Let me > preface this with I > am still relatively new to Java, and enterprise java in > particular (we are > porting a web app written in Perl and PHP to java). > > The current architecture consists of an app server machine > that also has > MySQL running on it, and the "client" of this app is itself a virtual > hosting web server machine. I can easily move MySQL off the > app server box > later to create a classic three-tier setup if necessary. Under this > architecture, a user would login via a servlet or JSP, which would > authenticate via an RMI call to the app server, which would > query the DB. > Upon authentication, the app server then pulls the user's > attributes out of > the DB, wraps it in a UserSession object, and sends it back > to the webserver > box via RMI. The UserSession object then lives on the > webserver side for > the duration of the session. > > Given Marc's statments about the cost of RMI, I am wondering > if it might > make more sense to push the app server (in this hypothetical > situation, > jBoss) on to the webserver box. This would do two things: 1) > we could use > the optimized inVM Tomcat/jBoss or Jetty/jBoss, and that > alone should lead > to some performance gains, and 2) our "network" costs now > consist only of > the direct socket connection to MySQL, which I would assume > will be pretty > quick. A couple of disadvantages to this are that the > webserver box is less > secure than the appserver, thus softening the security for > the DB, and we > lose some of the scalability afforded by running the > appserver on a separate > box. > > Given my relative lack of experience with these issues, I was > wondering if > any of you with more experience would care to comment on > these scenarios. > Are there alternatives I have not presented here which could > afford us the > advantages of running the appserver on a separate box without > the cost of > RMI serialization? Is the cost of RMI serialization high > enough to justify > pushing jBoss onto the webserver box, essentially collapsing a 3 tier > architecture into a two-tier one? > > Sincerest regards, > Chris Todd > > > > -- > -------------------------------------------------------------- > To subscribe: [EMAIL PROTECTED] > To unsubscribe: [EMAIL PROTECTED] > Problems?: [EMAIL PROTECTED] > -- -------------------------------------------------------------- To subscribe: [EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
