DBIx::C...::Random(3)
π NAME π
okay so bestie, welcome to the DBIx::C...::Random(3) page from the User Contributed Perl Documentation. The actual module is DBIx::Class::Storage::DBI::Replicated::Balancer::Random β a 'random' Balancer π
β¨
β¨ SYNOPSIS β¨
So this class is used internally by DBIx::Class::Storage::DBI::Replicated. You shouldn't need to create instances of this class β like, not your job, bestie π«Ά
πΈ DESCRIPTION πΈ
Given a pool (DBIx::Class::Storage::DBI::Replicated::Pool) of replicated database's (DBIx::Class::Storage::DBI::Replicated::Replicant), this defines a method by which query load can be spread out across each replicant in the pool. It's giving load-balancing fairy vibes π§β¨
π 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%". Literally math with main character energy π
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. Slay, 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. No cap, that's just how random works here πβ¨
π¬ FURTHER QUESTIONS? π¬
Check the list of additional DBIC resources β go treat yourself to the extra DBIC lore, bestie π«Ά
π COPYRIGHT AND LICENSE π
This module is free software copyright by the DBIx::Class (DBIC) authors. You can redistribute it and/or modify it under the same terms as the DBIx::Class library.
mwah π β perl v5.42.0, dated 2025-01-22, User Contributed Perl Documentation. that's the footer, bestie π«Άβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-DBIx-Class 0.082844-bp160.1.10 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms