POE::Component::MDBA

POE::Component::MDBA is a multi-satabase aggregation with POE.
Download

POE::Component::MDBA Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Daisuke Maki
  • Publisher web site:
  • http://search.cpan.org/~dmaki/

POE::Component::MDBA Tags


POE::Component::MDBA Description

POE::Component::MDBA is a multi-satabase aggregation with POE. POE::Component::MDBA is a multi-database aggregation with POE.SYNOPSIS use POE qw(Component::MDBA); POE::Component::MDBA->spawn( alias => $alias, backend => 'DBI', # optional backend_args => ); # else where in your code... POE::Kernel->post($alias, 'execute', { args => });WARNING: Alpha grade software! API still subject to change.MDBA Stands for Multi-Database Aggregation. This module is a helper module that allows you to send multiple (possibly all different) queries to multiple databases.One application that this might be useful is when you access a vertically-partitioned database cluster. A vertically-partitioned database cluster is a set of databases whose table definitions are same across each database instance, but the each database instance is responsible for a different set of data.This type of application typically requires that you send slightly differing SQL queries to each database instance, then aggregate the results into a single result. With normal DBI operation, it would look something like: my @connect_info; my @sql; my @args; my @results; for my $x (0..$n) { # connect to a database my $dbh = DBI->connect( @{ $connect_info } ); # get the applicable sql and arguments for this database my $sql = $sql; my $args = $args; my $sth = $dbh->prepare( $sql ); $sth->execute(@$args); while (my $row = $sth->fetchrow_hashref) { push @results, $row; } } return @results;But of course, this will make the client wait while it queries $n database instances - it would be nice if we just parallelized all of these, and be able to merge the results.POE::Component::MDBA acomplishes this by pre-spawning multiple databases, and sending asynchronous queries to those database instances. As soon as each query is done, an aggregator function is called so you can merge the results to your liking.However, the main complexity lies in the fact that usually each application likes to run these queries in their own way, hence making (1) query partitioning (2) sql handling, and (3) results merging completely different from application to application.POE::Component::MDBA attempts to solve this by separating each of these steps from the module logic and thus making each step configurable.But no worries if you just want to run a simple query. The POE::Component::MDBA::Backend modules that come with this module will handle most of the simple cases for you. Requirements: · Perl


POE::Component::MDBA Related Software