Are BMP Entity Beans appropriate for good performance?

Discussions

Performance and scalability: Are BMP Entity Beans appropriate for good performance?

  1. Hi,

    I'm working on a web site of a large french company based on J2EE 1.2.1 technology (WebLogic 5.1). Performance issues are very important, in fact the web site is supposed to accept 4500 users simultaneously.

    Unfortunatelly, I am unable to convince my project manager to use BMP Entity beans. He's scared about their bad performance reputation.

    To sum up, we have three options :

    1. Use Weblogic like Tomcat i.e. make DB call in servlets (needless to say I don't like this option, even if I can't say exactly why, I think it stinks)

    2. Use the design pattern Stateful Session EJB + Data Object (I have used this before and it was satisfying on the performance level)

    3. Use BMP Entity EJB with a stateful Session EJB. The entity beans may be mapped on one or more DB table and the session bean will be the glue between JSP/Servlets and entity Beans.(I don't mention CMP Entity Beans because of the real bad reputation they have on performance)

    I will appreciate any help or comment on these options, no matter if you're a J2EE guru or rookie.

    Thanks.

    Gregory Chazalon
  2. Hi,

    I have experienced that your second option works really well if you have a system that does a lot of read-only access to the data. It is a nice, clear cut pattern and it will give you 10-20 times faster results than using entity beans. I have no experience with your first option but I agree with you that it seems not to be the most optimal solution. Using stateless session beans can increase your speed even more if you have data that doesn't change often and is not bound to any user state. Of course I don't know what you want to accomplish with your system but I definitely go for using a mix of stateful and stateless (if possible) session beans that do direct database access using the Data Object/Factory pattern. Reason why I would stick to using ejb's also involves the clustering capabilities which you are bound to need with 4500 simultanious users..

    Good luck in convincing your project manager and implementing the system.

    Joost.

    --
    Joost van de Wijgerd
    Senior Software Engineer
    SmartHaven B.V.
    Amsterdam The Netherlands
    joost@smarthaven.com
  3. If you look at option 1, then yes I can agreen with your project manager, I believe this is the best option for performance reasons. But ... You tell me and you can tell him, how fast he will be if you have a heavy load, at the end this is a very bad design, very difficult in maintenance and so on.

    Sorry don't have experience with option 2.

    regarding option 3, yes this is slower but with a load of 4500 users simultaneous it will be faster then option 1. The EJB container can handle the clustering for you, so you don't need to worry about that, and you got all the advantages of deploying inside an EJB contaner like security and transactions. This horse doesn't go so fast to start with but the horse will keep the same speed when he needs to work.

    If you think that option2 is faster then 3 with the same advantages go for this one, I would like to know the benifits over option 3.

    Take care

    Thomas De Vos,
    It Enterprise Ltd, Uk
    www.it-enterprise.co.uk
  4. I agreed with Thomas on Option 1. It may be the faster option but it is more difficult to maintain. Also, WebLogic 5.1 is not very fast on Servlets. I have read a document from Bea that they made a big improvement on the web container in version 6.x

    Don't have experience with option 2 either.

    I basically have the same requirement as you, to handle a large number of users. What I did is to use stateless session bean as a manager to control the work-flow. To use Data object(JDBC) to retreive a read-only data(view) and to use coarse-grained BMP entity bean to update data.

    for example, if a user requests a resultset, I simply use a
    data object to retrieve it and then send it to JSP. If a user wants to update data, I capture the data and send the data to a BMP entity bean.

    It works well for me. I also changed the remote interface of the entity beans to local interface.

    Hope it helps.
    Tony


  5. You can combine option 1 and 2 using the fast-lane reader object. In a late stage of the project you can decide to call the dataobject methods directly or through a session bean (note: your app server has to support the connection object as a remote object).

    See:
    http://java.sun.com/j2ee/blueprints/design_patterns/fast_lane_reader/index.html
  6. If you want to use weblogic like tomcat why use weblogic?