Stephen Bartholomew
2006-Apr-22 17:34 UTC
[Rails] Multiple sites sharing a single application
Quick question: Say i have a few shopping sites that i want to run on the same application code but have seperate databases and layout/design, what would be the neatest ''Rails'' way of doing this? Cheers, Steve
Stephen Bartholomew wrote:> Quick question: > > Say i have a few shopping sites that i want to run on the same > application code but have seperate databases and layout/design, what > would be the neatest ''Rails'' way of doing this? >The *Rails* way would be to not have different databases... but access specific data within scope. The reason behind this is that its much easier to maintain one database schema than multiple ones and trying to keep those in sync with each other... especially if one instance of the application is doing all the heavy lifting. -Robby
Bryan Duxbury
2006-Apr-23 01:25 UTC
[Rails] Re: Multiple sites sharing a single application
Stephen Bartholomew wrote:> Quick question: > > Say i have a few shopping sites that i want to run on the same > application code but have seperate databases and layout/design, what > would be the neatest ''Rails'' way of doing this? > > Cheers, > > SteveSounds a little like a job for SVN branches. You could keep your models in the trunk and branch the controllers and views, or at least just the views. This would be a quick and dirty way to implement a quick "themes" system for your application. As far as running entirely separate instances of the application, I would suggest using several databases. If they''re not truly the "same" application, then keeping all that data together and adding some sort of scope is just going to complicate things. Other than their base software, these different sites are really separate, so make it easy on yourself and deploy it that way. -- Posted via http://www.ruby-forum.com/.
Stephen Bartholomew
2006-Apr-23 10:12 UTC
[Rails] Re: Multiple sites sharing a single application
I think that makes more sense. This would allow for the sites to ''split'' from the common application if one site needed to add additional bespoke componants. The main reason for maintaining the core codebase was for code management - i just wouldn''t want to have to bug fix across 3 different places. Cheers, Steve Bryan Duxbury wrote:> Stephen Bartholomew wrote: > >>Quick question: >> >>Say i have a few shopping sites that i want to run on the same >>application code but have seperate databases and layout/design, what >>would be the neatest ''Rails'' way of doing this? >> >>Cheers, >> >>Steve > > > Sounds a little like a job for SVN branches. You could keep your models > in the trunk and branch the controllers and views, or at least just the > views. This would be a quick and dirty way to implement a quick "themes" > system for your application. > > As far as running entirely separate instances of the application, I > would suggest using several databases. If they''re not truly the "same" > application, then keeping all that data together and adding some sort of > scope is just going to complicate things. Other than their base > software, these different sites are really separate, so make it easy on > yourself and deploy it that way. >
Bryan Duxbury wrote:> Stephen Bartholomew wrote: >> Quick question: >> >> Say i have a few shopping sites that i want to run on the same >> application code but have seperate databases and layout/design, what >> would be the neatest ''Rails'' way of doing this? >> >> Cheers, >> >> Steve > > Sounds a little like a job for SVN branches. You could keep your models > in the trunk and branch the controllers and views, or at least just the > views. This would be a quick and dirty way to implement a quick "themes" > system for your application. >There is also the svn:externals (http://svnbook.red-bean.com/en/1.0/ch07s03.html) solution : A. create an application framework without the modified parts (probably CSS, config and views) B. checkout this app for each site C. set an svn:external on each of these directories to point to the code for each specific site. Example: # svn propset svn:externals ''app/views'' "svn://example.com/site1/views" "views" D. svn up will update code in both app and site specific code. svn status will tell you to do svn ci into ''views'' if needed. -- Posted via http://www.ruby-forum.com/.
Apparently Analagous Threads
- [LLVMdev] How to print a list of used LLVM APIs in a given open source project?
- Instantiating middleman and worker from inside a model?
- [LLVMdev] LLVM code emittion and C++ compiler compatibily
- OT: Good virtual server host with debian?
- [RFC] virtio: orphan skbs if we're relying on timer to free them