Consequences
The Resource Pool pattern has the following benefits:
Benefits
Reduced resource initialization overhead—
Initializing new database resources is one of the slowest of all database operations. A resource pool recycles resources with the goal of minimizing the overall quantity that an application initializes. Resource pools significantly improve response time for server applications since each individual session or request no longer requires a brand new resource.
Minimal client code change—
If you define a resource pool to model the same semantics that the physical resource manager or programming interface dictates, then client code will require only simple changes to take advantage of the pool.
Resource semantics that match application logic—
Repeatedly requesting a resource from a pool does not cause noticeable performance problems. With a resource pool, clients are free to request and discard resources as dictated by application logic, and can avoid extensive passing or sharing of resources. Less sharing leads to cleaner application code and fewer concurrent access problems.
Centralized resource management—
A resource pool centralizes the management of all resources that a single application or suite of applications uses. This makes it inherently easier to optimize, incorporates new administrative and monitoring features, and controls resource utilization.
|