To EJB or not to EJB

J

Jeremy Haile

I have worked on a variety of web-based software projects and typically
employ a combination of JSP, Servlets, Struts, Postgresql, etc. However, I
am about to start on a project that needs to potentially scale to the size
of a large e-commerce site. In the past, I have always written database
interface classes that use straight SQL (via JDBC) to extract objects from a
database. However, due to the scalability issues involved in a large
e-commerce site, I am considering using EJBs.

Does anyone have any comments or suggestions on the use of EJBs, especially
in regards to large e-commerce sites? Can anyone point me to a good
resource for designing an e-commerce-like site using J2EE?

Thanks,
Jeremy Haile
(e-mail address removed)
 
K

Kevin Hooke

The book "Mastering Enterprise JavaBeans 2nd ed" published by Wiley has a
couple of good chapters on EJB best practices and issues to consider when
starting an EJB based project.

You could also read around on the www.theserverside.com site for good
practices, and read through some of the J2EE design patterns and usage
discussions they have there.

Theres also a few other books that may be worth taking a look at that cover
J2EE Design Patterns - "Core J2EE Patterns" published by Prentice Hall is a
good one, and there are others.

Hope that gives you some info to start with,
 
J

Joe

I have worked on a variety of web-based software projects and typically
employ a combination of JSP, Servlets, Struts, Postgresql, etc. However, I
am about to start on a project that needs to potentially scale to the size
of a large e-commerce site. In the past, I have always written database
interface classes that use straight SQL (via JDBC) to extract objects from a
database. However, due to the scalability issues involved in a large
e-commerce site, I am considering using EJBs.

Does anyone have any comments or suggestions on the use of EJBs, especially
in regards to large e-commerce sites? Can anyone point me to a good
resource for designing an e-commerce-like site using J2EE?


There is an O'Reilly book, "Building Java Enterprise Applications" that I
feel is outstanding.
 
R

Roedy Green

There is an O'Reilly book, "Building Java Enterprise Applications" that I
feel is outstanding.

Here are several books with similar titles:

J2EE(tm) Technology in Practice: Building Business Applications with
the Java(tm) 2 Platform, Enterprise Edition
by R. G. G. Cattell, et al (Paperback)

Building Java Enterprise Applications, Vol. 1: Architecture (O'Reilly
Java)
by Brett McLaughlin (Paperback - March 2002)

Building Java Enterprise Applications Vol. II: Web Applications
by Brett McLaughlin, Robert Eckstein (Paperback)

Enterprise Java 2 Security: Building Secure and Robust J2EE
Applications
by Marco Pistoia, et al (Paperback)

Which is the one you recommend?
 
C

Christopher Blunck

I have worked on a variety of web-based software projects and typically
employ a combination of JSP, Servlets, Struts, Postgresql, etc. However, I
am about to start on a project that needs to potentially scale to the size
of a large e-commerce site. In the past, I have always written database
interface classes that use straight SQL (via JDBC) to extract objects from a
database. However, due to the scalability issues involved in a large
e-commerce site, I am considering using EJBs.

Does anyone have any comments or suggestions on the use of EJBs, especially
in regards to large e-commerce sites? Can anyone point me to a good
resource for designing an e-commerce-like site using J2EE?

Hi Jeremy-

J2EE (specifically EJB) is a good enterprise level component architecture
well suited for high volume e-commerce sites. It offers many benefits
that make development easier (not simple, but easier) as well as very nice
cache management (well, certain vendors do). For example ...

Let's say that you plan on hosting a site that sells goods. There is a
very hot item that many people are interested in. If you don't use EJB,
and you don't write some cache management code in your database tier,
you're going to overwhelm your database with read calls and you'll quickly
burn up cycles unnecessarily. Writing cache management software is not
difficult, but it's not trivial. There are several products out there
that fit into EJB (TopLink comes to mind) that allow you to retrieve the
hot item once, keep it in memory, and concurrently update it from multiple
threads (requests). Commits are sent back to the database at appropriate
times (as decided by the EJB container). The net result is that you have
a faster overall site (reading from memory is several orders of magnitude
faster than reading from a disk over the network), and you don't have to
do much work.

EJB is also a distributed component architecture, meaning that if
necessary you could separate your JSP and servlet (presentation tier) onto
a set of hardware load balanced via a http balancer (F5 and Cisco make
them). Your front end presentation tier all peers over the network into
your central core located on a set of clustered J2EE application servers.
This puts you into a position where you can more intelligent scale your
application depending upon user load. If you find that your entity
cluster is struggling with managing connections, throw another server into
the mix and let J2EE spread the load to another server. Alternatively, if
you find your presentation tier to be sluggish, you can throw in another
server tuned for http performance.

Bottom line - J2EE provides for a lot, and makes it pretty easy to
accomplish most tasks. If you're going to deploy a high volume site,
seriously look into it.


-c


-c
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top