Architecture and Performance

The selection of the architecture makes a large impact on the performance of the system. In this post we look at how the four different types of high level architectures impact performance of the system.

The four high level architectures are as follows:

Monolith: A single application catering to all the functionality. This typically means that the system is a big ball of mud and means spaghetti code.

Modular Monolith: A single application catering to all functionality. This is an improvement over the simple Monolith. This monolith is modularized enough such that it is possible to see the individual modules in the system.

Service Oriented Architecture: A set of applications catering to varying functionality and all of them interconnected through an intelligent messaging system which routes the request/data between the applications.

Microservices: A set of small services which constitute the application. Each Service runs in its own set of processes and each application knows how to connect and talk to the others to which it needs to talk.

Performance Aspects

Architecture/Aspect Scalability Cost of Scalability Latency Throughput Availability
Monolith Moderate High Low Moderate Moderate
Modular Monolith Moderate High Low Moderate Moderate
SOA Moderate Very High Moderate* Low Moderate
Microservices High Low High* High Very High

* The latency can be high or moderate in a naive system which has not been designed well. The latency can be made acceptable by having a good design.

Other Aspects

Architecture/Aspect Maintainability Monitorability Consistency Testability
Monolith Very Difficult Easy Very Good Very Difficult
Modular Monolith Difficult Easy Good Difficult
SOA Moderate Moderate Moderate to Eventual Consistency Moderate
Microservices Easy Very Difficult Very Difficult only Eventual Consistency Very Good