3

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:

  • Have one rails app serve up the subdomains (basecamp style), sharing all models, etc, but putting an account attribute on everything

  • Set each account up with its own rails app instance

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

Mike Vormwald
  • 2,280
  • 22
  • 29

2 Answers2

1

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.

Jeff Paquette
  • 7,089
  • 2
  • 31
  • 40
  • My concern was that running 20+ websites via subdomains might be less efficient than breaking them into smaller instances. Just thinking ahead to any scalability issues. – Mike Vormwald Jul 09 '11 at 14:55
  • 1
    Having each app run independently might help with scaling as it'd be easy to identify the most resource intensive sites and offload them to their own servers, but the trade off of that would be it would be a heck of a lot harder to maintain and push updates. – Dave A-R Jul 09 '11 at 20:04
0

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.

Candide
  • 30,469
  • 8
  • 53
  • 60