in reply to mysql cluster

Similar to gmax's solution, I have a wrapper (that I've written myself) that provides, among other things, a very simple do_select() and do_write(). (It also builds the SQL and does a lot of other book-keeping for me.) So, when you create this wrapper, you'd specify a set of read_dbs and a write_db. do_select() would pick the correct read_db and do_write() would go against the write_db.

Now, it sounds like you're building some sort of distributed app, like a web application. It's not going to be simple to do this round-robin'ing for the read_db's from within an Apache child process. And, frankly, I don't think you need to until you start hitting the 100 request/second mark. That is, not with a good schema and well-tuned server parameters. And, the master/slave relationship may actually SLOW you down when you're trying to speed up.

Frankly, I'd build a basic DB server in some 2/3-tier layout and see if that's good enough. If it is, you're good. If it's not, then you have a reason to spend more money. Often, it's cheaper to build a 4-CPU Xeon w/8G of RAM than it is to develop some sort of round-robin'ing DBI wrapper. YMMV


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?