[Rails] question about host web based application using rails
Carl Youngblood
carlwork at ycs.biz
Wed Jan 5 00:14:53 GMT 2005
Joe Van Dyk wrote:
>Why do you think you need multiple databases?
>
I know this is somewhat late, but I have some experience with a massive
multiple database system where each user's information had the potential
of residing on a separate database. Our load was so intense that it was
ridiculously expensive to "scale up" to a larger big-iron database
server. Instead we devised a "scale-out" load-balancing scheme that
used a user's username to determine which database their data was on and
connected to that for each request. user-db mappings were stored in
memory in a dynamic trie structure that could be accessed with custom
PHP functions. Tables holding infrequently-updated common data were
duplicated on each host and synchronized when necessary. Transferring
user data to a different server when load got too high had too be
accomplished programmatically, since we had inter-server transactions in
MySQL. In short, it was complicated, but it did work and it saved us a
lot of money. This was for a web analytics product where our servers
got a hit every time someone accessed our clients' web sites, one of
which was eBay, for example. That may give you some notion of the
magnitude of the problem. So for some specialized cases, a multiple
database strategy can be very useful.
Carl
More information about the Rails
mailing list