March 22, 2009

Application Performance

*Assuming that the application is server based application.
Regarding performance you need to first identify the target audience for the same. What is the number of concurrent users that you are targeting?
Concurrent Users means the number of concurrent users hitting the server at the same moment of time or in the same second.

So if you have suppose 5000 users logged into the system at the same time then the concurrent users may be just 100 or 150 or at the max 200 not more then that cause not more then 5% of the people will be hitting the server at the same time.

There are three aspects to be taken care of :
1) Database Performance
2) Application performance
3) Network performance

1) Database performance
It is always good to move the business logic to the application layer i.e server and not on database. If you have huge data in particular table then it is advisable to keep it in normal form so as to improve performance during access. In MSSQL try to avoid using TEXT field as after using row level locks for few records it will acquire table level rock during updates. MS SQL 2005 has some improvements in that but am not sure on it. Try to create db design so as to store data in rows as compared to columns so that updates can become more precise and fast but identify the right solution as per requirement as in some case it may be advisable to store data in columns

2) Application performance
Use limited entry points to the server. i.e filter all requests through a servlet, or interseptor so that you can control the access to the application and monitor it as in case of application tuning its always important to monitor and control requests else thing may screw. for eg. if you start giving the application large number requests the application may be able to accept but the database on which the application hits may not be able to scale up or the other way round. It also helps you to implement security checks easily. Don't give extensive features to customers at the cost of performance as going ahead once they start using the feature they will demand for high performance which may be a limitation with the design or technology. Avoid using more of mapping objects and Objects. Design in a way that you will be using primitive objects as regular objects like String or HashMaps use large amount memory and create huge garbage with may create overhead for the application server.

3)Network Performance
Keep the application light weight from flow of data point of view. Try to use more of xml-http or ajax so as to save network data flow and reloading of pages. Make the CSS light weight so that it doesnot hold huge memory on clients web browser. Pass the data in one request to the server in a way it will save the network traffic for headers and other supporting objects of the browser.