Large Mysql Database (Multiple Databases?)

Hey Everyone,

I'm looking for some advice. I am developing an application that will have several million transaction records. I've heard of people scaling Rails to connect to multiple databases. I have never done this, and I'm wondering if rails can look at multiple databases and treat them as one, or if I design some sort of overload feature that makes it trickle from one database to the next. In essence I don't want my rails application to be limited by database capability or size. As I said before I have never designed an app like this, and I want to get it right before I get too far into the application. I have just started the coding, and would like to be proactive on making the right decision.



You’ll probably want to look at replication [1] and/or sharding. There are several gems out there that will help you do one, the other, or both within Rails. I haven’t used any of them, but some quick googling seem to indicate that data_fabric [2] or masochism [3] might be good places to start.

While googling I also ran across MySQL’s HA/Scalability Guide which looks useful if this is something new to you.


[1] [2] [3] [technoweenie always chooses the best project names…] [4]

internetchris wrote:

I appreciate your replys, I will look into PostgreSQL a little futher. A post from yesterday indicated alot of success with PostgreSQL, so I will probably go with it. One other thing..

I'm pretty new to rails, and this question may seem ridiculous, but I must ask. If I keep my fields the same in my migration, and simply change my database.yml file will my views and controllers still work fine? I haven't done alot of development on this app yet, but anytime I can avoid rewriting code it's nice.