AAU Student Projects - visit Aalborg University's student projects portal
A master's thesis from Aalborg University
Book cover


Energy Consumption of Software Architectures - A comparison between microservice- and monolithic architectures in C# and Java

Authors

;

Term

4. term

Education

Publication year

2022

Submitted on

Pages

64

Abstract

The choice of software architecture can affect energy use. We compare two common approaches: microservices (the application is split into many small services) and a monolith (built as one unit). We implemented the same sample application, Pet Store, in C# and Java using both architectures and ran controlled tests. We generated load with JMeter, deployed with Docker, and measured energy via a wrapper around Intel's Running Average Power Limit (RAPL). For microservices, we used Docker Compose and NGINX to support scaling; all tests were automated with shell scripts and ran on a minimal operating system installation under a fixed test protocol to keep conditions consistent. In a non-scaling setup, microservices consumed more energy per transaction than monoliths: for C# between 38.80% and 43.79% (depending on whether services used individual databases) and for Java between 0.86% and 40.30%.

Valget af softwarearkitektur kan påvirke energiforbruget. Vi sammenligner to udbredte tilgange: mikroservices (applikationen opdeles i mange små tjenester) og en monolit (applikationen bygges som én enhed). Vi implementerede den samme eksempelapplikation, Pet Store, i C# og Java i begge arkitekturer og kørte kontrollerede tests. Vi genererede load med JMeter, kørte miljøerne i Docker og målte energiforbrug via en wrapper til Intels Running Average Power Limit (RAPL). For mikroservices brugte vi Docker Compose og NGINX til skalering; alle tests blev automatiseret med shell-scripts og kørt på en minimal installation af operativsystemet efter en fast testprotokol for at sikre ensartede betingelser. I et ikke-skalerende miljø brugte mikroservices mere energi pr. transaktion end monolitter: for C# mellem 38,80% og 43,79% (afhængigt af om hver service havde sin egen database) og for Java mellem 0,86% og 40,30%.

[This apstract has been rewritten with the help of AI based on the project's original abstract]