Hi fellow monks,
I'm converting an existing web application to a cloud environment.
I need to do failover / load balancing for the MySQL database connection.
One option I'm looking at is doing that from within Perl. (I'm aware that there are other options such as HAProxy etc - they have their pros and cons).
So, Perl module options for load balancing with failover for non-responsive connections seem to be:
Q1: Does anyone know of any other options?
I'm aware that each of these modules is designed for a slightly different scenario, but in fact any of them would fit the bill for my scenario, which is:
-
One connection for writing to the database (failover on this connection is managed by Amazon RDS, so we don't need to worry about that).
-
A set of connections for reading from replicas of the database. These connections need to be load-balanced, and if one of them fails then we need to take it out of the pool.
The existing code gets the database handle from a single library, so it's easy to modify the part where the connection is set up (i.e. my $dbh = whatever()). The part of the app which deals with both reads and writes is separate from the part of the app which just deals in reads (but in a higher volume), so it would be pretty easy to serve them up different database handles, if needed.
I have no experience using any of the above modules; I've been using DBI in general for about 10 years.
The app is running on Apache2, mod_perl2, Apache::DBI.
So, Q2: Does anyone have any experience with any of the above modules which they'd be willing to share?
Thoughts or recommendations?
I see that Tim Bunce is involved with DBD::Multiplex, behind the scenes, and that that module is now on v2. Those things make me think happy thoughts about it. I don't know anything much at all about the maintenance of the other two modules (not to say that it's not great, it may be fantastic, just that I'm ill-informed on this).
Thank you, and Happy Wednesday.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.