Topic: Enterprise Applications with Rails?

Hello,

Recently we've been considering the possibility of developing an Enterprise-ish application with Rails. We are a start-up, so the team is small and we all have some experience with Rails (meaning that the learning curve, and availability of developers are not big issues).

What we are worried about is scalability. We've read a lot of articles claiming that Rails is not ready for the enterprise. We've also read the answers to those articles in which rails fans argue that it is. Honestly, we are not sure who to believe.

What kind of enterprise applications have been developed with Rails? Are there any statistics in terms of hits/hour? What kind of setups are recommended for big applications?

Regards,
az

Re: Enterprise Applications with Rails?

There's some very busy sites out there using Rails (basecamp, 43things, twitter, etc.). Recently twitter has complained about the scalability of Rails, but they are dealing with a crazy amount of traffic. I wish I knew the numbers but I'm not sure how to find them.

What kind of numbers are you talking about? If you don't need to serve thousands of requests per second then I don't think you have much to worry about. You will likely need to add some optimization (caching, query indexing, etc.) but this is manageable.

Railscasts - Free Ruby on Rails Screencasts

Re: Enterprise Applications with Rails?

Well, we've done some market estimates for the product. Worst case (actually best, from a business perspective) scenario, we'd be receiving about 300,000-400,000 hits/hour. I guess with a decent set of mongrel clusters (3 or 4) we could handle it hitwise. The thing is, we'd be working with some pretty hefty data structures and the calculations performed on the data involve a fair amount of complex transformations and permutations.

Re: Enterprise Applications with Rails?

azazel wrote:

The thing is, we'd be working with some pretty hefty data structures and the calculations performed on the data involve a fair amount of complex transformations and permutations.

In that case you may find the biggest bottleneck being the database, assuming you can move most of the calculations there. If you still need to do expensive calculations in Ruby and are finding it too slow, there's the option of rewriting that portion of the app in C. I know 37signals did this in a few areas for their apps and it worked well.

Railscasts - Free Ruby on Rails Screencasts

Re: Enterprise Applications with Rails?

ryanb, thanks for the reply. I tried a couple of searches on google, but couldn't find anything related to C & Rails integration.

Could you point me in the direction of some tutorials/guides about using C code inside a Rails app?

Regards,
az

Re: Enterprise Applications with Rails?

azazel wrote:

Well, we've done some market estimates for the product. Worst case (actually best, from a business perspective) scenario, we'd be receiving about 300,000-400,000 hits/hour. I guess with a decent set of mongrel clusters (3 or 4) we could handle it hitwise. The thing is, we'd be working with some pretty hefty data structures and the calculations performed on the data involve a fair amount of complex transformations and permutations.

That's 5000 requests/minute, or under 100 requests/second. A couple of web servers and a separate database server/cluster setup (and some good caching) would handle a basic site with that kind of traffic without many issues.

vinnie - rails forum admin

Re: Enterprise Applications with Rails?

yeah, rails can be pretty easily scaled how much you want it to.  Just keep adding Mongrel boxen and MySQL boxen to your cluster.  Ruby does tend to be slower (though that is usually obfuscated to the end user due to other factors), in other words, Ruby is slower on the back end but the time it takes to display the web page is not going to be affected much compared to other languages.  Of course if your servers are running at capacity, then this could become a problem, which is when you would add more boxen.

If you can wait, or will not be done developing yet, till December of this year (2007), things should be a lot better.  That is when Ruby 1.9/2.0* is supposed to come out which will include bytecode compiling, which will yeild some drastic speed increases.  If you are not open sourcing your application, bytecode compiling should also allow you to distribute your application but still hide the source code.  *From what I've heard, whether it will be called version 1.9 or 2.0 is still up in the air.

As for using C/C++, I don't think you use it directly with Rails.  I think what you do is write a C/C++ library for Ruby that contains the methods you want to use in your Ruby code.  Then you just require that library and when you use those methods you get all the speed and goodness of C/C++.  So probably what you want to search for is using C with Ruby, not C with Rails.

Last edited by jdinkel (2007-05-21 09:52:22)

Re: Enterprise Applications with Rails?

jdinkel,

Very informative. You were right, ruby and c did bring a lot of relevant hits.

Does anyone have any intel on whether PostgreSQL is better for high-volume websites than MySQL is?

Thanks again,
az

Re: Enterprise Applications with Rails?

ryanb wrote:

I wish I knew the numbers but I'm not sure how to find them.

According to their developers, about a month ago it was at 600 requests/second...

This is an interesting article about it all: http://www.infoq.com/news/2007/04/twitter-controversy

This is also a good read, from a Threadless.com engineer:
http://nata2.org/2007/04/15/rails-woes- … tter-down/

Josh Catone helps run this place
Rails Forum - Rails Jobs

Re: Enterprise Applications with Rails?

azazel wrote:

jdinkel,

Very informative. You were right, ruby and c did bring a lot of relevant hits.

Does anyone have any intel on whether PostgreSQL is better for high-volume websites than MySQL is?

Thanks again,
az

MySQL is considerably faster than Postgresql.  Google for "compare postgresql mysql" and you'll get a lot of articles.  I had found a good one a while back that gave a good unbiased view of the advantages and disadvantages of both.  I've always come back to the conclusion that MySQL is best for me and we run a high-volume government election site that does just fine on it.

It basically came down to MySQL is faster, Postgresql has more features.  The features that Postgresql has over MySQL though are things that some programmers will tell you should be coded in your application, not in your database (transactions are an exception to this rule, but MySQL 5 now has transactions).  And anyway if you do all your database manipulation with rake and configure everything in rails, you should be able to use either database the same.

Re: Enterprise Applications with Rails?

Hello

If you are looking for enterprise issue with rails, check out
Enterprise Integration with Ruby @ http://www.pragprog.com/titles/fr_eir

the book will list example like LDAP, locale issues etc

smile

Re: Enterprise Applications with Rails?

jdinkel wrote:

yeah, rails can be pretty easily scaled how much you want it to.  Just keep adding Mongrel boxen and MySQL boxen to your cluster.

Hi, what's a boxen? I am currently looking into virtualization for scaling rails apps.

Re: Enterprise Applications with Rails?

boxen is the plural of box (in some folks world).