Web Enabling of Complex Algorithms


EJB design: Web Enabling of Complex Algorithms

  1. Web Enabling of Complex Algorithms (2 messages)

    Dear Group, I need some inputs in terms of designing a web based system using Java. I want to use EJB 3.0 but it seems there are certain issues related to my requirements which I think will not let me use EJB. I need your inputs in verifying this. Also if you can give any other tips in terms of improving over all design, it would be great. We have set of computational inetnsive algorithms related to power system engineering. These alogrithms (available as C++ library on Linux) takes in network details (lot of data in the form of schematic and device attributes) and carry out processing and give the result back. Depending on the size of the data, the computational time may range from few seconds to minutes. We have to develop a web based system that allows user to - 1)Create network schematic/data sets 2)Run these algorithm over network data. The GUI/User interface requirements suggests us to go for a "thick" client. For this, I am thinking of : 1) Having a set of Web Services that expose the server functionalities (Like Login and Authentication, Data populations, Scheduling or runnign algorithms, Getting the results back etc) and my client application comunicates with server using SOAP/HTTP and hence no firewall issues. 2) Behind the web service, ideally, I would have liked to - Develop stateless session EJBs for each algorithm and (may be) stateful EJBs to assist with data creation. 3) Also have Scheduler Service (internal server side service and hence need not be "web service" which schedules running of algorithms. When user wants to run a algorithm, this service will actually instantiate the EJB and execute the algorithm on behalf of the user. ). The front ending web service communicates with this service through RMI. (Here I can have this implemented as 'Web Service', but I think SOAP/HTTP call (vs RMI) call would be way too expensive for this purpose. 4) I am planning to use Hibernate for data persistance/OR. But have following issues with this architecture: 1) EJB will not allow JNI (my algorithms are in C++). Also, since while executing these algorithms, I need a functionality where user can get the progress of the computation. This might involve multi threaded access to the stateless EJB. As of my understanding, I believe, EJB will not allow either. (Please confirm my understanding). Option here is to wrap these algoriths as RMI or Web service (as it is possible that to manage the load, we may have to run the computations on a dedicated server other than web/app server). But then I dont have transaction mgmt. (these algorithms need to read data and update the results in the database) 2) I am expecting, at maximum, 150 to 200 user base (simultaneously there can be 30 to 40 users at a time). For this loading, is EJB justified? 3) Will my scheduler service become a bottleneck. If so, how to better design this? 4) I have to figure out a good way to do session management between thick client and a web service. Any ideas/pointers will be helpful. Thanks in advance, Best Regards, Mehul
  2. I don't see any justification to use EJB's in your case. Why do you need stateless session beans? Rather what will be the value add with stateless session beans? And since you are using Hibernate, with all the distributed cache's etc.. with a little bit of extra effort, you can achieve the features EJB. I guess it will make life simple. Hope it helps. Regards, Rakesh.
  3. I will stay away from Java for the kind of requirement you have. This requirement fits well for CGI(c++/perl/apache mod) based solution over Apache & Linux. Biswaranjan Das