Cost Analysis of Running Web Application in Cloud Monolith, Microservice and Serverless Architecture - Muhammad Uzair Nadeem; Syed Muhammad Khaliq-ur-Rahman Raazi; Bilal Mehboob; Syed Mubashir Ali; Saqlain Raza (JISR on Computing)
Cloud computing has become a popular choice for deploying web applications, but the selection of the appropriate architecture for different application types remains a challenge for businesses. In this study, we conducted performance and cost analyses of three architectures: Monolith, Microservice, and Serverless (specifically Lambda and Fargate) to provide businesses with valuable insights for decision-making. To ensure the relevance of our findings, we conducted tests on an application designed for static, database, and batch job services, deployed on AWS. Using JMeter, we simulated traffic with varying levels of high, medium, and low intensity, distributing 500 requests across six test scenarios. The results and subsequent analysis revealed that Lambda outperformed the other architectures significantly, while Fargate and Microservice architectures exhibited lower performance in comparison. However, cost played a crucial role in architecture selection. Fargate proved to be exceptionally expensive, with costs escalating further when batch jobs were involved. On the other hand, Lambda demonstrated lower overall costs compared to the other architectures, especially when batch jobs were running under low traffic conditions. However, the cost advantage diminished when running batch jobs in higher traffic scenarios, surpassing the expenses of Monolith and Microservice architectures. The findings highlight the superior performance of Lambda, but also emphasize the importance of considering costs and specific workload requirements when selecting an architecture. Lambda outperformed other architectures by reducing average response time by 25% and cost by 15% under low-traffic scenarios compared to Monolithic and Microservice architectures.