Question

I am starting work on a new project soon and was wondering whether to create multiple apps (pretty much copies of each other) or one single app (or utilize single sign on of some sort). Each 'app' will have its own domain.

The apps are pretty simple, people can sign up to the site and create a profile for their cat or dog. However, as some people have a cat and a dog, it would be nice to not have them sign up twice. Also, I think many users will want to extend to other pets too, such as rabbits, rats, ferrets, etc

It will be a Rails app, and so I wondered what my options are.

  • A single app would be easiest to maintain
  • Multiple apps could mean it is easier to 'split' the network i.e sell some of it (tho I doubt I'd do that)

But which would be most efficient? Would there be any problems with caching? Which makes most sense?

If you have any links or info on how to go about your preferred method, that would be appreciated too! But at this stage, I am mainly asking about which is the most logical way to go about it.

Was it helpful?

Solution

Less is always more, especially early on in a project.

I've learned to never split code bases until it's absolutely apparent that it must be done.

Making 2 apps means twice as much work in so many ways. Two bundle exec rails server to run, two bundle exec rspec to run, cd .., cd web_app1, cd web_app2 over and over.

You also have to deploy two apps.

So, make one app. Split it up later, if and when you need to.

If they are on the same subdomain, you can share cookies, and easily achieve SSO.

And there is no reason you can't use something like nginx to put them behind their entirely separate domains, as a deployment consideration.

OTHER TIPS

If you were planning to have multiple domains with a separate application on each domain, you could have a "central" domain (or server) that can hold all shared resources (images, css, javascript, data etc) and provides the ability to load-balance and increase performance. It can be a lot of work connecting everything and keeping it all running so it depends on your situation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top