Database Connection Pool Adaptation via Notification Service
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing systems for connecting application servers to clustered databases face challenges in managing connections adaptively during state changes, such as unplanned outages or additions, leading to inefficiencies in resource utilization and management complexity.
Innovation Solution
A system that includes a notification service component in the clustered database to broadcast state change notifications, allowing a data source with a connection pool to manage connections adaptively, providing fast failover, load balancing, and graceful shutdown capabilities, while ensuring valid connections and efficient resource utilization.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If the application server uses static connection configuration to clustered database, then the configuration and management is simple, but the system cannot adapt to state changes (outages, additions) at runtime
Solution Approach 1:
The data source pre-registers with the notification service component before runtime state changes occur. This preliminary registration ensures that when outages or additions happen, the connection pool is already prepared to receive and respond to notifications, enabling adaptive behavior without complex runtime configuration changes.
Solution Approach 2:
The notification service component provides continuous feedback about database instance state changes (outages, additions) to the data source. This feedback mechanism allows the connection pool to dynamically adjust its connections based on real-time database status, resolving the contradiction between adaptability and management complexity.
2Reliability
If the connection pool continuously monitors all database instances, then the system can detect state changes quickly, but the resource consumption and system overhead increases
Solution Approach 1:
The notification service component acts as an intermediary between the database instances and the connection pool. Instead of the connection pool directly monitoring all database instances (which would consume excessive resources), the notification service receives state change information from the database and selectively notifies the connection pool, reducing monitoring overhead while maintaining connection validity.
3Reliability
If the system implements fast failover capabilities, then the reliability and continuity of database access is improved, but the complexity of connection management increases
Solution Approach 1:
The connection pool implements self-service failover by automatically receiving notifications about database instance outages and autonomously redirecting connections to available instances. This self-service mechanism provides fast failover capability without requiring complex external management systems or manual intervention, resolving the contradiction between reliability and management complexity.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
A system and method can support using a data source to connect an application server with a clustered database. The clustered database includes a plurality of database instances and is associated with a notification service. The notification service can be used by the clustered database to broadcast notifications that describe a state change in the plurality of database instances. The data source includes a connection pool, which manages a set of connections to the plurality of database instances in the clustered database. The data source operates to register with the notification service to receive notifications on the change of the clustered database, wherein the application server operates to configure and manage connection to the clustered database, adaptively according to the state change of the clustered database at run time.