Optimization is a process of increasing the performance of web site rendering or displaying and associated output efficiency throughout the period a user spends on a web app.
When a web site is developed and finally deployed to production, few issues rarely occur. However, soon afterward the web app begins to deteriorate and spike progressively as it’s been used. Due to wear and tear (which is not only common to hardware, but also to software as well), the once efficient web app shows unbearable bugs.
At such a point, the web app needs optimization.
I would draw your attention to a couple of incidents that could warrant the optimization approach to a web application.
I manage a web application that generates reports periodically. Initially, when it was in use, there was effectiveness in generating reports, withing a few seconds. After a while, the database records grew tremendously. This impacted the time it takes to generate such reports. Now, it takes more than 20minutes to generate such reports.
This is unacceptable. So, my boss tasked me to optimize the app.
Another incident was the case of a solution that was supposed to display reports on the web app like a grid or excel format and allow paginations. Now, for a large record that spans hundredth of a page that must be displayed in real-time, such must be spread using a process called pagination. (Pagination is the process of separating print or digital content into discrete pages.) So, this freezes the web app when there is gigantic records spool from the database to be paginated, on the web app frontend.
Two Best Optimization Strategies.
- Understand the cause of the inefficiency: The first thing that generates the issue must be identified. Thereafter work out the solution around it. In my case, I found out that there are two databases sharing data between themselves. The first database, SQL Server, generates the parameter e.g. PAN number needed and passes that to the second database, Oracle in order to fetch the second parameter e.g. Phone number. So, the two returned parameters are displayed on the web report. You see, when there are huge records in database 1 and database 2, this massively degrades the performance of the web app. So, what I did was to write a background service that runs periodically and generates all this record into a single database e.g. SQL Server. Now, it is from this SQL Server that user fetches when the need be rather two databases simultaneously.
Filtering Figure 1
Filtering is the process of selecting a record based on specified criteria. The above figure 1 shows a drop-down having 10. The 10 is the filtering criteria to query database table thereby generating only the first 10 records.
Filtering Figure 2
The above image could be prefiltered to select based on the predefined criteria from the source code, thereby enhancing the performance of the pagination from freezing.