DBD::Multiplex
DBD::Multiplex
- Connects to multiple databases (DBI DSN's) at once and returns a single $dbh
- By default, executes any method call on that $dbh on each underlying $dbh in turn
Can be configured to
- modify (insert, update, …) only master db, select from one replica at random
- modify all databases but select from one ("poor man's replication")
- fallback to alternate database if primary is unavailable
- pick database for select at random to distribute load
- concatenate select results from multiple databases (effectively a 'union' select)
- return row counts/errors from non-select statements as select results
- one row for each underlying database
- May also acquire fancy caching, retry, and other smart logic in the future
-
- developed by Thomas Kishel and Tim Bunce
- currently undergoing a significant redevelopment