THE ZEPINT NETWORK

programmer assist

Ruby Ruby XML Feeds

Ruby Questions Ruby Solutions Ruby Articles

Ruby is a reflective, dynamic, object-oriented programming language. It combines syntax inspired by Perl with Smalltalk-like object-oriented features, and also shares some features with Python, Lisp, Dylan, and CLU. Ruby is a single-pass interpreted language. Its official implementation is free software written in C.

Multiple Databases v/s Single Modified Database

DiggBlinkRedditDeliciousTechnorati

question by mamadlin | Moderate

I read the article by Srirangan about multiple dbs (thanks for the to-the-point article, btw), but I have a general question, if you have a rails app, that for instance serves one system (company, soccer team, or whatever) and it has its own db, and works just fine.

Now, if you wanna server multiple companies, or better, you want the service for the next company to be created on the fly, what is the best way to take.

Is this problem, again, decision between Multiple db vs. one db (with extra field(s)), or there is another way that I am not able to see.

appreciate any comments/hints/tips,

ML.

Post reply Subscriptions

Re: Multiple Databases v/s Single Modified Database

reply by Srirangan

I would personally use multiple databases to keep them seperate, however, depending on your situation/environment to use a single database with different prefixes for different companies would also be an option.

It is of course totally up to you, as in which set-up you (and your development team) are most comfortable with.

- Srirangan

Post reply Subscriptions

Re: Multiple Databases v/s Single Modified Database

reply by spike

We used multiple databases and hijacked them for our CMS application. It worked well but there are caveats when working with sessions. If you store your sessions in the database, all the session data will be lost as soon as somone hits a site that switches the database. It seems that the sessions recording etc... is done before application.rb boots up. We switched to memcache (memcached) and it works fantastically. It even makes our app more flexible in the future when we span multiple machines.

Also watch out for interactions with DRB servers that use a database connection. I've currently got a question going about how this all works. (ActsAsFerret in particular seems to have a problem with it).

Post reply Subscriptions

Got a Ruby Question?

Just Sign Up and ask the top Ruby experts!

Search via Google

User Login

Email Address

Password

Ruby Experts

Rank Expert Points
#1 Srirangan 1500
This a list of the Top Ruby experts, how many points do you have?

Leading Experts

Rank Expert Points
#1 frankzzsword 4650
#2 Bejaan 2950
#3 csfreak 1100
#4 Anurag 700
#5 keyvez 700
#6 nnarasimha 600
#7 Nakata 600
#8 martinig 600
#9 mastercomputers 550
#10 Abhishek Chatterjee 250
#11 Abels 250
#12 Huntress 150
#13 Adkron 150
#14 Yogesh 100
#15 lexxwern 100
This is a list of overall best performing experts, how many points do you have?