Member-only story
Why do we need a Database Connection Pool? -every programmer must know
Hello everyone. In this article, we are going to look at Database connections and their life cycle. Then we will look at the Connection Pool, its internals, and why we need to use it. Then we will look at the design patterns on where to place the connection pool. We will then look at the performance issues that can arise from the Database connection pool and conclude the article by looking at the common connection pool frameworks used in Java. Let's get started.
What is a Database Connection?
Any software application needs to store the data in a database and for the application to interact with a database server, we need a Database Connection. The Database connection is nothing but a way for the application software to interact with the database server software and we use the connection to send commands (SQL) to the database and obtain the response from the database in the form of a Result Set.
The database application usually runs in a dedicated server called a database server which is different from the application servers. The database application runs in a specific port in the…