title: Proper way to optimize a multi-DB web application
body: <p>I am currently building a web application that will be using two databases at the same time. The user first creates a general account and afterwards uses it to create multiple characters on multiple 'servers'. (think of it as creating an account on Facebook and then using it to sign up on other websites).</p>
  
  <p>My current database setup is the following:</p>
  
  <ul>
  <li><code>main_english</code></li>
  <li><code>main_russian</code></li>
  <li><code>server1</code></li>
  <li><code>server2</code></li>
  <li><code>server3</code></li>
  </ul>
  
  <p>The <code>main_english</code> and <code>main_russian</code> databases contain the <strong>session and general account data</strong> for users who've registered at the appropriate languages.</p>
  
  <p>The <code>server1</code> and <code>server2</code> databases handle the created character data of the English users, while <code>server3</code> handles the Russian ones.</p>
  
  <p>Users will be updating tables every 5-10 seconds or so. My question is, how could I efficiently handle having several DBs used?</p>
  
  <p><strong>So far I've come to several options:</strong></p>
  
  <ol>
  <li>Open two DB connections: one for <code>main_</code> and another for <code>server</code>,
  but I've read that opening them is fairly expensive.</li>
  <li>Modifying all
  my queries to explicitly state which DB to update/select data from
  (the project is still young and thus it wouldn't be <strong>that</strong>
  painful)</li>
  <li>Modifying my $db class to have <code>select_db()</code> statements
  with each query, which, in my opinion, is both messy and
  inefficient.</li>
  </ol>
  
  <p>What could <em>you</em> suggest? Perhaps I am overreacting about opening a second connection for the <code>server</code> queries?</p>