By Rogerio Robetti, founder of Open J Proxy (OJP)
(Open source project — Apache 2.0 licensed)
🚀 Rethinking the Way Java Talks to Databases
Every Java developer has fought the same battle at some point — an app scaling beautifully on the application side, only to hit a wall when the database can’t keep up. Connection storms, resource starvation, slow queries hogging pools, unresponsive services.
We’ve all been there.
Open J Proxy (OJP) was born to solve exactly that.
OJP is an open-source database proxy and JDBC driver replacement that decouples your applications from direct database connections — adding intelligence, safety, and freedom to how your apps talk to relational databases.
With just a small configuration change, OJP steps in between your app and your database, bringing smart connection orchestration, built-in backpressure, circuit breaking, and slow query segregation — all without changing your code.
🌍 Freedom as a Core Design Principle
One of OJP’s founding ideas is freedom — freedom from being tied to a specific database, cloud, or even programming language.
It’s database-agnostic, tested with PostgreSQL, MySQL, MariaDB, Oracle, SQL Server, DB2, H2, and CockroachDB, and designed to support any JDBC-compatible driver.
It’s cloud-agnostic — OJP doesn’t rely on any proprietary cloud service, so it runs the same on AWS, Azure, GCP, or bare metal.
And while OJP was built by Java engineers for Java engineers — it exposes a gRPC + Protocol Buffers API, meaning it can be used from any language that speaks gRPC.
So yes — your Python, Go, or Rust microservice can use OJP too.
🧩 What’s New in 0.2.0 Beta
The v0.2.0-beta release is a huge milestone for the project — the biggest update yet, featuring distributed transaction (XA) support, smarter pooling, and deeper observability.
Let’s break it down.
⚖️ Distributed Transactions, Simplified
With this release, OJP now supports XA-compatible distributed transactions — the kind you’d typically associate with heavyweight transaction managers like Atomikos or Narayana.
OJP’s StatementService was expanded to carry transaction identifiers through the proxy, so two-phase commit workflows work seamlessly — even across multiple databases.
It also brings:
- Lazy connection allocation for XA resources — allocate only when needed.
- Named datasource routing, so multi-tenant or multi-database environments stay isolated.
- Configurable concurrency limits, integrated with OJP’s slow-query management.
It’s the kind of transactional reliability you’d expect from enterprise systems — but implemented with OJP’s lightweight, modern philosophy.
🧠 Smarter Slow Query Segregation
The OJP Slow Query Segregation Strategy got a major brain upgrade.
It now tracks per-datasource baselines and adjusts dynamically to pool size and performance history.
Queries that start dragging behind are quietly moved aside, preventing them from blocking normal workloads.
Think of it as real-time traffic control for your queries — fast operations stay fast, and slow ones don’t take everyone down with them.
⚙️ Smarter Connection Management (and No More Leaks)
A full refactor of the ConnectionAcquisitionManager ensures that even under heavy load, every connection and semaphore is properly released.
No more hidden leaks or resource starvation during stress tests.
Combined with per-datasource configuration, it gives you precision control over your connection pools — one config file, total visibility.
💾 LOB Stability & Predictability
Large Object (LOB) handling was re-engineered to avoid race conditions and hanging streams.
OJP now uses a standardized LOB approach that works consistently across all major databases — PostgreSQL, MySQL, Oracle, DB2, and more.
This makes test runs predictable and deployments stable.
🧱 Datasource Names and Multi-Pool Freedom
Another major evolution: named datasource support.
You can now define multiple logical datasources (e.g., mainApp, reporting, batchJob) in the same proxy, each with its own pool settings, timeout rules, and transaction behavior — even pointing to the same database with different optimizations.
All configured simply via ojp.properties using the new ojp.connection.pool.* property namespace.
📈 Broader Database Coverage
With this release, OJP adds full support for CockroachDB — the cloud-native, distributed SQL database used by companies like Netflix, known for pushing the boundaries of scalable, resilient microservices architecture.
The OJP integration includes 96 new CockroachDB-specific tests, expanding the test suite to 500+ real integration tests across all supported databases — all running automatically in CI.
That’s not just broad coverage — it’s industrial-grade confidence.
🧭 Monitoring, Metrics, and Health Checks
Prometheus integration has been improved and standardized (default port 9159), and OJP now exposes health checks and OpenTelemetry metrics by default.
Deploy, monitor, and visualize without extra setup — everything’s wired in.
☕ For Java Developers, It’s Plug and Play
If you’re using Spring Boot, Quarkus, or Micronaut, OJP just drops in.
Replace your JDBC driver with ojp-jdbc-driver, point to your proxy server, and you’re good to go — no application code changes needed.
You immediately get:
✅ Predictable connection behaviour
✅ Reduced DB load
✅ Built-in safety mechanisms
✅ Multi-database flexibility
🧩 The Bigger Picture: Freedom, Stability, Simplicity
OJP isn’t trying to reinvent the database — it’s giving developers control and freedom back.
It removes the invisible chains that tie applications to a specific database vendor or cloud service.
It keeps performance predictable even when traffic spikes.
And it’s open-source — for everyone to use, study, and improve.
📢 Join the Journey
OJP is still in beta, and the community is growing fast.
If you’re a Java developer who loves open source, distributed systems, or performance tuning, you can contribute right now — test it, break it, build with it.
👉 GitHub: https://github.com/Open-J-Proxy/ojp
👉 LinkedIn: https://www.linkedin.com/company/open-j-proxy