views:

415

answers:

3

What would you suggest as the best server stack for a dedicated server which needs to host Rails SaaS application (not a lot of traffic but need to keep options open for future).

+3  A: 

As ever with a question that broad, it depends. Some things to think about:

  • What does the application do?
  • Does the application use any database vendor-specific SQL?
  • What are the availability requirements?
  • What are the performance requirements?
  • How much data will there be?
  • Which server stacks do you or the person who will be administering it have experience of?
  • What is your budget?

One thing I can say with complete certainty is that you don't want to be using Windows because Rails work best on a Linux/UNIX stack.

John Topley
+1  A: 

A lot of it depends on your needs. If the model isn't very complex and/or your traffic is fairly low, you can probably get away with apache, mongrel, and sqlite on some *nix.

If you start seeing performance issues, you can add some memcached into the mix, upgrade (relatively painlessly) to mysql, and use a different server (passenger/nginx).

There are also alternate ruby implementations that have some performance boosting changes. Rubninous and jRuby come to mind.

Joel Meador
+6  A: 

Regardless of your application, you're probably going to want certain standard components:

  • nginx/passenger will work for small apps or large apps. You should use it.
  • Unless you have a specific reason to use something else, you should use MySQL since the vast majority of the Rails community uses it and you will be able to get better support.
  • You should have memcached running right away, even if you don't use it for much yet. You're going to want to be able to seamlessly add caching as it's needed.
  • You're going to want to have a process for setting up a new server that is fully automated. That way, if you need to spin up a second server, it's trivial. If you ssh into a box to configure it, this means that if you need another server in a pinch (or the first server gets corrupted), you're going to need to remember all the things you did. Not a good place to be in an emergency.
  • You should be on the very latest version of Ruby on Rails, and upgrade frequently. Keep an eye on deprecations and changes and make the suggested changes as early as possible. When Rails 3 is released, use it.

Engine Yard, where I work, uses an open source tool called chef to manage our automated deployment solution. That's probably a good option.

Yehuda Katz