Hi everyone, I was wondering if opening multiple connections to different databases with MySQL and DBI will hinder the performance/efficiency. Would it be better to connect to one main database containing all your necessary tables (for your forums, comments, member info, blog posts etc.) vs. having to connect to 2-3 different databases that each had the info. For example, I have a Perl Script that verifies the member log-in info, allows them to post comments, and to view blog posts. As of this moment, each of the three functions (verify member, posting comments, and viewing the blog) require me to connect to three different databases. One database for member info, another for posting comments, and the third for blog data.

This will definitely be easier for me if I was just to combine all the tables from each individual database into one database name, that way my script doesn't have to keep making three connect statements to three db's. However, a there may be a downside (if it is considered one), which is having 60 tables inside one single database.

Thanks,
A passing visitor

In reply to Connecting to Multiple Databases vs A Single One by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.