Re: Apache::DBI Wisdom Sought
* Mark D Wolinski ([EMAIL PROTECTED]) [000831 11:24]: > Hi all, > > You'll pardon me a little, I hope for this message does tend to lap over out > of ModPerl, but if it'll make you feel at ease, I shall only expect wisdom > on the modperl side. > > I run a service of free message boards where users can create their own > message boards. Currently and in the past, I have used BerkeleyDB to store > everything. > > I have decided to move towards mySQL and run under ModPerl. > > My current plan is to have one DB which stores everyones settings, etc in > tables. > > Then I was going to create a database for each message board. > > Under ModPerl, I was going to utilize Apache::DBI to create a persistent > connection to the main DB. However, how will this affect the connections > being made to individual DBs? I have a nagging feeling that they'll connect > until mySQL reaches it's concurrent connection limit then stop being able to > connect to service since it would be filled with persistent connections of > the first 150 (or so) forums accessed. > > Am I correct in my feelings on that? You could always connect to the 'mysql' database in your connection string, and then 'use' the database you'd like once you get the connection back: my $dbh = DBI->connect( 'DBI:mysql:database=mysql', 'user', 'pass', { RaiseError => 1 } ) || die $DBI::errstr; $dbh->do( "use $the_proper_database" ); ... continue ... I use this all the time, no problems. Chris -- Chris Winters Senior Internet Developerintes.net [EMAIL PROTECTED] http://www.intes.net/ Integrated hardware/software solutions to make the Internet work for you.
Apache::DBI Wisdom Sought
Hi all, You'll pardon me a little, I hope for this message does tend to lap over out of ModPerl, but if it'll make you feel at ease, I shall only expect wisdom on the modperl side. I run a service of free message boards where users can create their own message boards. Currently and in the past, I have used BerkeleyDB to store everything. I have decided to move towards mySQL and run under ModPerl. My current plan is to have one DB which stores everyones settings, etc in tables. Then I was going to create a database for each message board. Under ModPerl, I was going to utilize Apache::DBI to create a persistent connection to the main DB. However, how will this affect the connections being made to individual DBs? I have a nagging feeling that they'll connect until mySQL reaches it's concurrent connection limit then stop being able to connect to service since it would be filled with persistent connections of the first 150 (or so) forums accessed. Am I correct in my feelings on that? Secondly, you may be asking why I don't just store the messages in a single table in the master database. My thoughts on that are that when a message is posted, I create a list of the thread and write those numbers to the messages to allow quicker retrieval when the message list looked at. When I do this, I write lock the DB to prevent concurrent posts from messing up the threading of another post. On that point, I may well be over zealously protective and while this paragraph is so far off topic I would love your thoughts on that issue, but would understand if shall pass it up to respond only to the modperl portion of this message. And I can seek council via the mysql lists as well on this issue. Much thanks... Mark W