We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Developing a new web application

M_SYED
M_SYED asked
on
Medium Priority
254 Views
Last Modified: 2013-11-24
Hi,

I have got to develop a new web application in 10 working days.
Basically there are 5-6 screens. There is a requirement to send e-mails from two screens.
The only problem is that the expected no. of users is around 1 million.

So I wanted to get expert opinion on the architecture/design to be used to successfully serve all the users.
Due to the short time line I am planing to have JSP/Servlet based interface with a message driven bean for the Email requirement.
The addition of other beans will depend on the database schema.... I guess.

Looking forward to expert responses.

Best Regards.
Comment
Watch Question

Top Expert 2006
Commented:
one million per hour / day / week ?
not only it depends on your design but also the web server shoud be able to serve such a greate amount of visitors.
have a look at this page
http://www.webperformanceinc.com/library/reports/ServletReport/index.html
there you'll find benchmarking results of comparing different J2EE web servers

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Top Expert 2006

Commented:
another thing you should consider is the performance of your code. I have read a book "java performance tuning" by orreily it suggests good comments to optimize your servlet and guides you on how to achieve and maintain good performance. although it covers 90% J2SE optimization and it helpd me a lot to make my java app run faster.
worths a read

Author

Commented:
Hoomany, thanks a lot for your comments.

Looking forward to further expert opinions.
Commented:
Use javamail APIs to send mails rather than Message Driven beans.
They will be easier to code and manage and support large number of USers.

Just a thought : The sendMail part, start a new thread for it. Do not make it a synchronous call. Just to save time given the users that you have.

Commented:
Do not use Entity Beans for such  a large number of Users.
Either use Hibernate or use direct SQL queries.

Commented:
Also to manage the load, you should go for an clustered environment.
Mayank SPrincipal Technologist
CERTIFIED EXPERT
Commented:
Yes there is no need to use MDBs for only sending e-mails - there is no need to introduce heavy components if not required.... use the Java mail API. You can write a simple E-mail utility and reuse it.

Follow general best-practices like using StringBuilder (Java 5) instead of directly concatenating/ modifying strings or StringBuffer (<= Java 1.4).

What server are you going to use? Make sure you use clustering. For example:

http://tomcat.apache.org/tomcat-5.0-doc/cluster-howto.html

http://www.onjava.com/pub/a/onjava/2004/04/14/clustering.html 

Author

Commented:
The environment is going to be;

1. Weblogic Server 8.1
2. Oracle 9.2 is the Database.
3. J2SDK 1.4 is the java version.

Am not to sure about the usage of clustering at this moment.

Best Regards
Mayank SPrincipal Technologist
CERTIFIED EXPERT

Commented:
That sounds fine. Use connection-pooling at the data-base driver.
Mayank SPrincipal Technologist
CERTIFIED EXPERT

Commented:

Commented:
Weblogic supports clustering.. go through the links posted above

Cache static/definition data from the Database into Java classes during server start up to minimise db queries.

Commented:
The primary keys of the database tables should be numbers.
Faster to query on numbers than on String values.

Author

Commented:
Hi,

mrigank: You wrote about using JavaMail API,  I am not familiar with it so I have a couple of basic questions;
1. Is it possible to setup JAVA Mail API to send an e-mail when a button is clicked on a JSP/Servlet based front-end.
2. IF 1. then is it possible that we can send graphical content ex: an XSLT containing images as the body of the e-mail.
3. Finally is there any link to a tutorial or any website where I can gain more information about seting up and using JavaMail API.

Thanks for all your comments, please keep them coming.

Best Regards

Commented:
>> 1. Is it possible to setup JAVA Mail API to send an e-mail when a button is clicked on a JSP/Servlet based front-end.

Yes. Just call the JavaMail APIs with the mail content and details(to,cc,bcc, subject etc).
You can progmatically call the APIs when you want to do so.
On the onclick of the button, pass the flow to the servlet with the event set as send well.
If required submit the entire form as well.

>> 2. IF 1. then is it possible that we can send graphical content ex: an XSLT containing images as the body of the e-mail.

You can send attachments as well with the Mail. You can add images as attachment.

Commented:
>> an XSLT containing images as the body of the e-mail.

Not sure what you meant here.

Author

Commented:
Hi,

Thanks for the prompt responses mrigank, appreciate them.
In one of our existing applications we send e-mails where the body of the e-mail is set as a xslt file.
This xslt is transformed by a XSLTransformer(a java program) and after transformation it generates the required e-mail message body.
This xslt can have images. The xslt part is not that important as that logic is already in place.

I will go through the links that you have provided and learn about JavaMail.

Best Regards

Commented:
You can dry run on a given xsl and try sending the mail out from a stand alone email application.
Mayank SPrincipal Technologist
CERTIFIED EXPERT

Commented:
>> generates the required e-mail message body

That's fine. Once you have the email body, you can send it using this:

http://www.javaalmanac.com/egs/javax.mail/SendApp.html
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.