Forum: Ruby on Rails Large Mysql Database (Multiple Databases?)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D0b55f385fc038fc7fc588a9c59c3618?d=identicon&s=25 internetchris (Guest)
on 2009-04-18 17:18
(Received via mailing list)
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.

Thanks!

Chris
2a39aed820c125e6db9826fa8180043f?d=identicon&s=25 Denis Haskin (dwhsix)
on 2009-04-18 18:25
(Received via mailing list)
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.

dwh


[1] http://dev.mysql.com/doc/refman/5.1/en/replication...
[2] http://blog.fiveruns.com/2008/7/9/introducing-data_fabric
[3] http://github.com/technoweenie/masochism/tree/master [technoweenie
always chooses the best project names...]
[4] http://dev.mysql.com/doc/mysql-ha-scalability/en/index.html
Dd2d775dea75b381edb1bbf0600a0907?d=identicon&s=25 Marnen Laibow-Koser (marnen)
on 2009-04-18 20:52
internetchris wrote:
[...]
> In essence I don't want my
> rails application to be limited by database capability or size.

I would think that it would be better to have the DB take care of the
multi-DB splitting, and have it appear to the Rails app as one DB.

> 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.

The right decision would almost certainly *not* be to use mySQL.
PostgreSQL is generally more capable and faster.  It's also more
extensible.

>
> Thanks!
>
> Chris

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
D0b55f385fc038fc7fc588a9c59c3618?d=identicon&s=25 internetchris (Guest)
on 2009-04-19 05:57
(Received via mailing list)
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.

Thanks!

Chris

On Apr 18, 12:52 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas-
This topic is locked and can not be replied to.