DEV.co
Open-Source Observability · vladmihalcea

flexy-pool

FlexyPool is a Java library that wraps existing database connection pools (HikariCP, DBCP, C3P0, Tomcat, etc.) to add dynamic resizing, metrics collection, and failover strategies. It allows connection pools to automatically scale based on demand rather than using fixed configurations.

Source: GitHub — github.com/vladmihalcea/flexy-pool
1.2k
GitHub stars
125
Forks
Java
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryvladmihalcea/flexy-pool
Ownervladmihalcea
Primary languageJava
LicenseApache-2.0 — OSI-approved
Stars1.2k
Forks125
Open issues6
Latest releaseUnknown
Last updated2026-02-25
Sourcehttps://github.com/vladmihalcea/flexy-pool

What flexy-pool is

FlexyPool provides a decorator/proxy layer over JDBC connection pools, exposing detailed histograms (concurrent connections, acquisition time, lease time, pool growth) and implementing adaptive strategies to resize pools on demand. It integrates with metrics libraries (Dropwizard Metrics) and supports standalone, Spring, Guice, and Java EE environments.

Quickstart

Get the flexy-pool source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/vladmihalcea/flexy-pool.gitcd flexy-pool# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Variable traffic load handling

Applications with unpredictable traffic spikes benefit from FlexyPool's dynamic pool resizing. Rather than over-provisioning a fixed pool size, FlexyPool grows the pool during peaks and shrinks it during low-traffic periods.

Production monitoring and observability

Teams needing detailed connection pool metrics for alerting and capacity planning can use FlexyPool's histogram data (connection acquisition time, concurrent requests, overgrowth) to identify bottlenecks and tune pool configuration.

Multi-pool failover scenarios

FlexyPool's failover strategies allow applications to degrade gracefully when one database becomes unavailable, automatically routing traffic to secondary connections or pools without application code changes.

Implementation considerations

  • FlexyPool requires explicit wrapping of an existing pool (HikariCP, DBCP2, C3P0, Tomcat, Vibur, Druid, Atomikos). Verify your chosen pool is in the supported list before adoption.
  • Dynamic resizing strategies must be configured: choose between exponential backoff, linear growth, or custom policies. Incorrect thresholds can cause oscillation or resource exhaustion.
  • Histogram metrics must be externally exported (JMX, Dropwizard Metrics) and monitored. Without downstream collection and alerting, the metrics data is unused.
  • The library adds a proxy/decorator layer between application code and the underlying pool, introducing minor latency per operation. Load test to verify acceptability.
  • Backward compatibility with existing JDBC code is maintained; FlexyPool sits transparently. However, pool lifecycle management (init/shutdown) must be updated to use FlexyPool's API.

When to avoid it — and what to weigh

  • Modernizing to async/reactive stacks — FlexyPool is built for blocking, synchronous JDBC. Projects migrating to R2DBC, reactive drivers, or async query engines will find FlexyPool incompatible and unnecessary.
  • Fixed, well-tuned pool sizes — If your workload is stable, predictable, and your connection pool is already well-sized, FlexyPool adds complexity without clear benefit. The overhead of monitoring and dynamic resizing may not justify the gains.
  • Minimal Java EE or standalone footprint required — FlexyPool introduces an additional layer and dependency. Lightweight services or embedded scenarios where every dependency matters may find the cost too high.
  • Real-time, ultra-low-latency requirements — The proxy/decorator pattern and histogram collection impose latency overhead. Applications with sub-millisecond connection acquisition demands should benchmark carefully or avoid the library.

License & commercial use

Licensed under Apache License 2.0 (Apache-2.0), a permissive OSI-approved license allowing commercial use, modification, and redistribution with attribution and explicit notice of changes.

Apache-2.0 is a permissive license that explicitly permits commercial use without royalties or restrictions. However, consult your legal team if you fork, modify, or integrate this library into closed-source products to ensure compliance with attribution and change notification requirements.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

FlexyPool operates as a JDBC proxy and does not handle authentication, encryption, or data access control. Security posture depends entirely on the underlying pool and database driver. No security vulnerabilities or CVEs disclosed in provided data. Review the underlying pool's security updates; FlexyPool's proxy pattern does not bypass or enhance them.

Alternatives to consider

HikariCP native configuration

HikariCP (a supported pool in FlexyPool) offers configuration options for dynamic adjustment without a wrapper layer. If HikariCP alone is sufficient, avoid the extra abstraction.

Tomcat Connection Pool (native features)

Tomcat's built-in JDBC pool has some dynamic features; evaluate if native tuning meets your scaling needs before adding FlexyPool.

R2DBC / Reactive drivers

For new projects or async migrations, R2DBC and reactive connection pooling (e.g., r2dbc-pool) are purpose-built and avoid the JDBC/blocking bottleneck altogether.

Software development agency

Build on flexy-pool with DEV.co software developers

FlexyPool can help you handle variable traffic and reduce over-provisioning. Evaluate it in a dev environment with your specific pool and load profile. Review the wiki guides and blog posts to understand sizing strategies.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

flexy-pool FAQ

Does FlexyPool support my database pool?
FlexyPool officially supports Apache DBCP, DBCP2, C3P0, HikariCP, Tomcat CP, Vibur DBCP, Druid, and Atomikos TransactionsEssentials. Check the supported list in the README before adopting.
Will FlexyPool add significant latency to my application?
FlexyPool introduces a proxy/decorator layer and histogram collection overhead per connection request. The impact is typically minor (<1ms), but load testing is essential for latency-sensitive applications.
How do I export and monitor FlexyPool metrics?
FlexyPool integrates with Dropwizard Metrics (formerly Codahale Metrics). Configure a Metrics registry and exporter (JMX, Prometheus, Graphite, etc.) to consume the histograms. Without external collection, metrics are not actionable.
Is FlexyPool maintained and production-ready?
The project is actively maintained (last commit Feb 2026), has been in production since 2014, and is used by companies like Etuovi and Scentbird. No release version visible in provided data; verify latest version stability before deployment.

Software developers & web developers for hire

Need help beyond evaluating flexy-pool? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source observability integrations — and maintain them long-term.

Ready to optimize your database connection pool?

FlexyPool can help you handle variable traffic and reduce over-provisioning. Evaluate it in a dev environment with your specific pool and load profile. Review the wiki guides and blog posts to understand sizing strategies.