Low Performance: Why and How to Solve the Problem

| Vasyl Soloshchuk

performance improvement

Here, I will focus on possible reasons of performance problems and appropriate ways to deal with each one.

If the software system used by your business can’t cope with constantly increasing loads, slows down, doesn’t perform all the required operations or even stops serving, it may require reengineering. Before changing anything, you should define the problem by identifying the critical issues (so called bottlenecks) of your system. This step determines the required updates, avoiding needless efforts and expenses.

My practice shows that performance problems may arise as a result of the following reasons:

  • wrong system architecture and data flow configuration;
  • inefficient components deployment;
  • suboptimal business processes;
  • inefficient business logic implementation;
  • obsolete technologies;
  • used database is not suitable for solving the problem;
  • inefficient data scheme for persistence layer;
  • poor hardware power.

I want to write a few words about every reason and possible actions to improve the situation.

Wrong system architecture and data flow configuration – A service-oriented architecture (SOA) proved itself to be the best approach for a large software system design. SOA helps organize optimal interconnection between system components and enables easy horizontal scaling, clustering and other methods of system optimization in the future.

Inefficient components deployment – In some cases, high loads may reveal the most and least active information flows between system components. The components exchanging the largest amount of information should be placed on the same server. Having placed the components correctly, you can increase system performance under high loads. In this case, you may need to update the software, but it’s usually not critical.

Suboptimal business processes – Business processes optimization may cause the order of operations to change, some operations can be replaced with others, and some can even be removed. After analyzing and reorganizing all of your business processes, they should be represented in your software system. This may require serious software reengineering. If business processes cannot be changed, other solutions should be found.

Inefficient business logic implementation – Not only business processes, but the business logic in general can appear to be implemented inefficiently. System profiling often helps to reveal the problematic components. Also, code review and rewriting parts of the code can help in this case. Additionally, system profiling can point to architecture problems.

Obsolete technologies – Substituting obsolete technologies for modern ones may include upgrading a programming language version or translating source code to another language or even using completely different frameworks, methodology, protocols and architecture.

Used database is not suitable for the solving problem – When developing an application, choosing a database (relational or non-relational) depends on the application’s tasks and expected loads. When a database appears to be a bottleneck in the working application, it can be replaced with another one which has better performance (i.e. MySQL as less efficient can be replaced with Oracle RDBMS). When working with large datasets and handling a huge number of queries, it may be better to replace a relational database with a NoSQL one to provide horizontal scalability and high performance. Depending on the data model used in the application, different types of NoSQL databases can be used: graph-oriented databases (based on graph structures), document stores, key-value databases or column-oriented stores.

Inefficient data scheme for persistence layer – System reengineering with the purpose of increasing performance is almost always linked with information storage mechanism (databases) optimization. Besides optimizing SQL queries (finding the most efficient query execution plan to minimize the time of processing the query), there are other steps used in this case:

  • Indexing databases using core fields speeds up data retrieval operations.
  • Vertical and horizontal partitioning increases performance by building separate smaller databases (horizontal partitioning) or creating tables with fewer columns and using additional tables to store the remaining columns (vertical partitioning).
  • In some cases, database denormalization becomes a means of performance increase as there is no need to read and merge data from a number of tables.
  • Moving some system logic to the database layer that is using stored procedures instead of querying helps process data faster.

Poor hardware power – You can add or replace hardware resources (CPU, memory, disk space). This is called vertical scaling and it doesn’t require changes in code. This is a rather expensive way of increasing performance which doesn’t have a long-term effect.

If the bottlenecks of your system are accurately identified, then you can reproduce the needed steps of optimization before you initiate optimization itself. This allows you to define the correlation between expenses and possible results so you can choose the desired balance. In some cases, you can compromise some usability or functionality in favor of high performance if it is critically important. Nevertheless, don’t forget that your customers may not be happy if your system loses some features.