Mike Vormwald
Mike Vormwald

Reputation: 2310

Hosting multiple sites via rails - Should I use one rails instance, or many?

I am building a rails app that will host multiple archery league websites. Lets call it myarchery.com, and say I have 2 sites: billsleague.myarchery.com and jimsleague.myarchery.com.

Now when I build this I can either:

I prefer running them all in one instance - (B/C I can set their sites up immediately when they sign up, have a single login, etc). However, I wanted to see if there legit reason to run them independently.

I plan to run this on a Linode using apache/passenger, if that influences your answer

Upvotes: 4

Views: 592

Answers (2)

Jeff Paquette
Jeff Paquette

Reputation: 7127

Using rails3, you get subdomain routing 'for free'. See http://railscasts.com/episodes/221-subdomains-in-rails-3.

I don't see why you'd need an account attribute on everything; your normal associations should allow you to determine ownership of subobjects.

Running multiple instances per subdomain might seem simpler, but you will pay a heavy price in maintenance. It just does not scale well.

Upvotes: 1

Roland Mai
Roland Mai

Reputation: 31077

I would think that if they are the same site, running one instance is fine, but if you need to brand them differently, you could benefit from splitting the bits that differ and use, say, svn externals to load in the bits that differ, such as assets and layouts.

Either way works fine, having them all in one instance makes it easier to maintain your code.

Upvotes: 0

Related Questions