title: Using node.js, how can I write to one MySQL DB and read from another?
body: <p>Specifically, I'm talking about <code>MySQL Master-Slave(s) Replication</code>. As I understand it, all of my reads should happen from a slave (or multiple slaves hid behind a load balancer) and all of my writes directly to the master.</p>
  
  <p>How can I do this with <code>node.js</code>? I'm using the <a href="https://github.com/martintajur/node-mysql-activerecord" rel="nofollow noreferrer">MySQL Active Record</a> package for my database queries and I don't think that supports it natively. I supposed I can hack away at the package and have a <code>if is write-query, then use db1</code> type of situation, but I wonder if there's an easier way.</p>