Class TeeDriver

All Implemented Interfaces:
Driver

@DriverCapability(prefix="tee", description="Replicates operations across multiple database connections", capabilities="replication") @DriverSideEffects(stateful=true) public class TeeDriver extends AbstractProxyDriver
Replicates write operations across multiple database connections.

TeeDriver sends all operations to two database connections simultaneously, useful for scenarios like:

  • Write replication to a secondary database
  • Dual-write during migration periods
  • Keeping audit databases in sync

Warning: TeeDriver does not provide transactional guarantees across the two connections. If one write succeeds and the other fails, the databases will be inconsistent.

URL format: jdbc:tee:jdbc:target1:...;jdbc:target2:...

Example:

 jdbc:tee:jdbc:postgresql://primary/db;jdbc:postgresql://replica/db