• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt in ePratice Exam Question

 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ranchers,

I came across the following question on ePractice exam [Form 1] and it stumped me..

Your organization is interested in building an application that will allow users to query and read volumes of statistical data for analysis. They anticipate high volumes of traffic and want the most scalable solution. This application will be distributed in a cluster and deployed as an enterprise archive. Components should be designed so that they can be accessed remotely by other Java applications.

What Java EE component type and remote access technology is correct for this architecture?

  • Servlet accessed using HTTP.
  • Message-driven bean accessed using JMS.
  • Stateless session bean accessed using RMI.
  • Stored procedures and DAO's.(Correct Answer as mentioned in the exam)


  • I fail to understand how can a DAO and stored procedure be used remotely by other java applications (as mentioned in the question)...is the answer incorrect? insights please...
     
    author and cow tipper
    Posts: 5009
    1
    Hibernate Spring Tomcat Server
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I agree. That's a bad answer.

    -Cameron McKenzie
     
    Ranch Hand
    Posts: 393
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    The correct answer is (c)
     
    Rahul Mishra
    Ranch Hand
    Posts: 211
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    That's what i marked..
     
    Ranch Hand
    Posts: 317
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    because it is primarily read.
    I would expect a rest based servlet webservice using a DAO to talk to the DB would out perform a SLSB to one or more enties.

    Scaling handled by adding another tomcat server.
     
    Ranch Hand
    Posts: 240
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Stored procedure might have better performance, but it is part of solution in C, and it is bad on scalability and remote access.

    I prefer C
     
    peter cooke
    Ranch Hand
    Posts: 317
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Bigwood Liu wrote:Stored procedure might have better performance, but it is part of solution in C, and it is bad on scalability and remote access.

    I prefer C



    cool preferece your preference of c

    I just got my cup of coffee and want to debate. so let's debate merrits and problems with solution. I don't mean any offense.

    Performance: (transactions/second)
    Can we both agree that a tomcat webcontainer will out perform a full blown comercial EE containter (weblogics, websphere, oracle app server)? It has been a long time since I used tomcat, but tomcat was only a web container, but may have added on. I also have not used weblogics since 8 but the commericial servers above always started both servlet and ejb container. It is my understanding that when EE6 rolls out that the server can decide what not to launch. So if we use option C- there is no need for the web container. Then why spend the cpu cycles to spin up and maintain the web container when those cycles can be used to handle requests.


    Vertical Scaling:
    remains the same in either case. throw faster cpu's, more memory, faster disk, a seperate ethernet for the servers to communicate to the DB on.

    Horizontal scaling:
    1) adding multiple instances: once again add another tomcat or weblogics container. In my opinion the same thing.

    2) It has been a long time since I read the spec. but containers must appear to be running 1 instance of SLSB's or servlets. They can choose to run multiple copies of SLSB's to handle requests. Ok you may have me on servlets. Servlets there is only 1 instance, SLSB's can spin up multiple instances if the container vendor has implemented that feature, problem it is an optional feature


    Remote Access:
    A http request to a servlet is a remote request by it's nature. I have rarely seen any firewall that blocks port 80. So A servlet webservice provides remote access.

    So the remote issues we are trying to decide is, " which is faster to serialize an object graph. Use a servlet with JSON or XML, OR a SLSB serializing with XML or standard java serialization." If both are serializing with XML it should be equal. If the SLSB is serializing useing "RMI-IIOP" still probably equal to convert to corba format. I would think that serializtion would be faster if serialization was "RMI" only.

    I until you get to 100+ requests a second serializing large graphs. I doubt serialization time would play much of a factor in your decision, and then at that point you should be writing custom serialization objects



    Well I am looking forward to response. Perhapse there is some aspect I have not considered. sleep time
     
    Greenhorn
    Posts: 10
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    as far as i am concerned, i'd prefer C.
     
    Ranch Hand
    Posts: 413
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    I prefer to C. B and A are also bit closer.

    Anyway I can't agree on D

    Thanks
     
    Greenhorn
    Posts: 8
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I prefer c too. Nowhere in the question it is mentioned that the client is a web based client and mentioned "enterprise archive" does this mean to use ear?
    Coming to servlets and RMI. My experience says RMI's binary objects will be faster over network than huge HTML text.
    We can make many assumptions about using combination of technologies to solve. But with a bare eye c looks correct .


    D is not the answer for sure. as it says "What Java EE component type and remote access technology is correct for this architecture? "
    Neither Stored procedures nor DAO are enterprise components . DAO is a pattern.

    Please correct me if I am wrong

    Gopi
     
    Consider Paul's rocket mass heater.
    reply
      Bookmark Topic Watch Topic
    • New Topic