One rails application, many schemas


#1

hello all!
i am about to deploy an app that needs to connect to different
schemas… uhm. let me explain.
the app is located on a server (of course), and on the same server is a
database with many schemas called new_york, cicago, barcelona, hongkong,
singapore and so on. people from this citys need to use the app, and the
app should connect to the correct schema depending from where they
connect from.
so i tought i could set up many times the same application in different
folders, with different database.yml and make them accessible though a
different url. for example the guys from hongkong will connect to
http://www.example.com/hongkong/myapp.
but i don’t really like this approach, because if i do it this way i
need to copy the same application in many folders (deploy hell) and set
up lighttpd for all this apps. can someone suggest a better way to do
this? i can’t think of one…
thanks.


#2

On Tuesday 29 Nov 2005 17:38, Simon S. wrote:

but i don’t really like this approach, because if i do it this way i
need to copy the same application in many folders (deploy hell) and set
up lighttpd for all this apps. can someone suggest a better way to do
this? i can’t think of one…

I’m almost certain you can do this using symbolic links, and just create
the
different config directory (or anything else that changes - you could
symlink
individual files within config too if they are largely the same) for
each
version.

Haven’t tried myself, but I’m sure I’ve seen others mention it.

~Dave

Dave S.
Rent-A-Monkey Website Development
Web: http://www.rentamonkey.com/


#3

Dave S. wrote:

I’m almost certain you can do this using symbolic links, and just create the
different config directory (or anything else that changes - you could symlink
individual files within config too if they are largely the same) for each
version.

how exactly would you go about that? i tought i am going to use lighttpd

  • fastcgi, and if i do it the way you suggest, i would need to start 100
    (just an example) fastcgi procs for hongkong, 100 for singapore and so
    on, and then configure all this in lighttpd. right? did i understand
    your suggestion? if so it looks like i have a lot to configure to keep
    all this stuff going, and when i have to add a new city it would require
    a lighttpd restart. am i right?