Best practices with connection pools
Connection pool implementation is relatively straightforward and, like most programming tasks, you will quickly have your own code base that you can refactor for follow-up programming projects. This is often a critical component to your system’s success as it provides the mechanism for your application to access data. Some factors should be considered as part of your connection pool strategy. Let’s look at the primary factors.
Connection pool sizing
Ensuring your connection pool is properly sized is the first factor you should consider. We should strive to find the ideal balance between performance and resource usage. If our pool is too small, the access wait times can increase, which will negatively impact performance. Oversized connection pools can result in wasted resources such as idle connections requiring system resources.
The challenge is knowing what the ideal connection pool size is. This can take some trial and error...