Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

catalyst::traitfor::model::dbic::schema::replicated(3pm) [debian man page]

Catalyst::TraitFor::Model::DBIC::Schema::Replicated(3pm)User Contributed Perl DocumentatioCatalyst::TraitFor::Model::DBIC::Schema::Replicated(3pm)

NAME
Catalyst::TraitFor::Model::DBIC::Schema::Replicated - Replicated storage support for Catalyst::Model::DBIC::Schema SYNOPSiS __PACKAGE__->config({ traits => ['Replicated'] connect_info => ['dbi:mysql:master', 'user', 'pass'], replicants => [ ['dbi:mysql:slave1', 'user', 'pass'], ['dbi:mysql:slave2', 'user', 'pass'], ['dbi:mysql:slave3', 'user', 'pass'], ], balancer_args => { master_read_weight => 0.3 } }); DESCRIPTION
Sets your storage_type to DBIx::Class::Storage::DBI::Replicated and connects replicants provided in config. See that module for supported resultset attributes. The default "balancer_type" in DBIx::Class::Storage::DBI::Replicated is "::Random". Sets the "master_read_weight" in DBIx::Class::Storage::DBI::Replicated::Balancer::Random to 1 by default, meaning that you have the same chance of reading from master as you do from replicants. Set to 0 to turn off reads from master. CONFIG PARAMETERS
replicants Array of connect_info settings for every replicant. The following can be set via "connect_info" in Catalyst::Model::DBIC::Schema, or as their own parameters. If set via separate parameters, they will override the settings in "connect_info". pool_type See "pool_type" in DBIx::Class::Storage::DBI::Replicated. pool_args See "pool_args" in DBIx::Class::Storage::DBI::Replicated. balancer_type See "balancer_type" in DBIx::Class::Storage::DBI::Replicated. balancer_args See "balancer_args" in DBIx::Class::Storage::DBI::Replicated. SEE ALSO
Catalyst::Model::DBIC::Schema, DBIx::Class, DBIx::Class::Storage::DBI::Replicated, Catalyst::TraitFor::Model::DBIC::Schema::Caching AUTHOR
See "AUTHOR" in Catalyst::Model::DBIC::Schema and "CONTRIBUTORS" in Catalyst::Model::DBIC::Schema. COPYRIGHT
See "COPYRIGHT" in Catalyst::Model::DBIC::Schema. LICENSE
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-05-15 Catalyst::TraitFor::Model::DBIC::Schema::Replicated(3pm)

Check Out this Related Man Page

DBIx::Class::Storage::DBI::Replicated::Balancer::Random(User Contributed Perl DocumentatDBIx::Class::Storage::DBI::Replicated::Balancer::Random(3)

NAME
DBIx::Class::Storage::DBI::Replicated::Balancer::Random - A 'random' Balancer SYNOPSIS
This class is used internally by DBIx::Class::Storage::DBI::Replicated. You shouldn't need to create instances of this class. DESCRIPTION
Given a pool (DBIx::Class::Storage::DBI::Replicated::Pool) of replicated database's (DBIx::Class::Storage::DBI::Replicated::Replicant), defines a method by which query load can be spread out across each replicant in the pool. This Balancer uses List::Util keyword 'shuffle' to randomly pick an active replicant from the associated pool. This may or may not be random enough for you, patches welcome. ATTRIBUTES
This class defines the following attributes. master_read_weight A number greater than 0 that specifies what weight to give the master when choosing which backend to execute a read query on. A value of 0, which is the default, does no reads from master, while a value of 1 gives it the same priority as any single replicant. For example: if you have 2 replicants, and a "master_read_weight" of 0.5, the chance of reading from master will be "20%". You can set it to a value higher than 1, making master have higher weight than any single replicant, if for example you have a very powerful master. METHODS
This class defines the following methods. next_storage Returns an active replicant at random. Please note that due to the nature of the word 'random' this means it's possible for a particular active replicant to be requested several times in a row. AUTHOR
John Napiorkowski <john.napiorkowski@takkle.com> LICENSE
You may distribute this code under the same terms as Perl itself. perl v5.18.2 2013-07-12 DBIx::Class::Storage::DBI::Replicated::Balancer::Random(3)
Man Page