A Study of Database Connection Pool in Microservice Architecture - Nur Ayuni Nor Sobri; Mohamad Aqib Haqmi Abas; Ihsan Mohd Yassin; Megat Syahirul Amin Megat Ali; Nooritawati Md Tahir; Azlee Zabidi; Zairi Ismael Rizman (JOIV : International Journal on Informatics Visualization, 2022)
The growing number of Internet presents a higher requirement to backend application systems nowadays to be designed to handle thousands of users traffic concurrently. Microservice architecture is also in a rising trend which they allow for each service to scale horizontally by their throughput and load helps to scale the system efficiently without waste of resources like in the traditional monolithic application system. Among the many strategies to optimize delivery, database connection pool helps backend systems to access databases efficiently by reusing database connections, thus eliminating the computationally expensive need to open and close connections with new requests. Additionally, database connection pools can also help improve the connection reliability for applications. This paper aims to determine the most suitable maximum amount of database connections in a microservice setting, where multiple instances of the service are used for scalability and high availability purposes of the system. To tackle the issue of scalability and to achieve high availability of our services, we propose running multiple instances of each of our services in production, especially for services that we anticipate will be hit the most during runtime. This is to allow load balancing of request load between multiple instances and having backup instances to serve HTTP requests when one of the instances is down. The result obtained in this experiment shows that 5 database connections give the best result in microservice settings as described in our methodology.