how can i develop a java web application with out any performance issues

I want to develop  java web application with out any performance issues.
What are the steps keep in mind while developing code.

Even if some has done code review on whatever i developed. i don't want to see any performance kind of issues in my code.
Please provide some suggestions.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I think you should concentrate on making the system satisfy the requirements, making the code extensible, easy to follow, reusable e.t.c
Trying to prematurely optimise something will lead to a different code base. The great Donald Knuth once quoted
premature optimization is the root of all evil

Perhaps write the code first and then think about making it more performant once you have some statistics to work with.

Of course you can take trivial things into consideration like, don't put too much stuff into the session, careful with queries that result in N+1 selects. Also most customer facing web applications these days have some kind of caching strategy in place so that presentation tier (JSP/Servlets) is cached.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The vast majority of web applications, when you think about what they're really doing, take a request, lookup some data in a database, build a response from that and send it back to the client.

For example - think about  This is exactly what it's doing.  The data in this case are the questions and comments.  The web app retrieves those, formats them to display and returns the pages.

The reason to point this structure out is that in practice 95% of all performance issues in web apps are around how well you work with the database.  E.g. If your algorithm for experts-exchange was:

To load question 123:
   a) Load all questions from database
   b) Scan for question 123
   c) Return that

Then as the site grows in size, step (a) grows linearly and your site gets slower and slower.

The correct approach here is
  a) Load just question 123 from the database - make sure there is an index on the question ids.
   b) Return that

Furthermore, it's usually very easy to add more web servers to a web app - so that the web application piece can scale up.  E.g. is running on thousands of web servers.  But it's much harder to do the same with a database - you can't just "add another server" for the database because you need a way to divide up the data among different servers and that is either complicated or expensive.

So focus on the way you work with the database - learn SQL and read about database optimization if you don't already know it - and your app will likely have no performance problems.

Tomas Helgi JohannssonCommented:

70 to 80 % of performance problems of any application (web or not) using a database is lies in the SQL query the rest in the table and index structure as well as application code logic.
What is your web application requirements ?
What is your goal for a web framework and appearance (user interface/interaction) ?
You will need to ask yourself those questions and design your web-prototype after answering those questions ?
After that you can take each part of the application and optimize it using known optimized code/methods that suites your code and logic.

    Tomas Helgi
srikoteshAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.