Posts [ 3 ]

Topic: Rails vs. ASP.NET MVC 4

Hello Community,

I am coming from a .NET world where I've developed applications for years. Right now I am in the middle of starting a new web-based venture and I am trying to find the right technology for the job. Of course, my first and obvious choice was ASP.NET 4 with MVC. However, I had also heard about Rails and I decided to play around with it. I can see how powerful and easy-to-use rails is, but right now I can't imagine developing a data-heavy app with complex business logic using it. Since this is a Rails forum I would like you guys to convince me to use Rails over ASP.NET.

Right now, the only advantages of using Rails for me are:- Cheaper hosting- Not in any way related to Microsoft ;)- I can use my Mac for development instead of a slow Windows Virtual Machine.

Right now, my main problem in Rails is the business logic. In .NET I would structure my app as follows:ASP.NET MVC -> Service Layer -> Business Layer -> Data Layer. Thus, the Model in MVC already works with business object (which, for the Model is the pure data). The Data Layer is completely decoupled from the rest of the application, and I can add Web Services on top of the Business Layer later on. This is necessary because my Data and Business Logic are very complex and will be extended constantly. It's a very scalable design allowing for a lot of flexibiity.

However, it seems like Rails forces me the work within the MVC triangle. The Model NEEDS to be connected to the database in order for Rails to make sense of my application. I don't see how I could structure complex business logic with a design like this. And even if I could, if I scale my application I would need to mess around in database and models, which will be ugly. Any thoughts on this?

For me, another disadvantage of Rails is that I need to search for gems in order to implement simple features. User authentication, authorization, caching, security, etc, etc. I might be lucky to find a gem that has it, but it's very unlikely that it will fit my business needs completely. ASP.NET and the .NET framework has everything you could every wish for integrated and ready to use.

The third big point is performance. We all know about the performance difference in compiled and interpreted languages. Sure, data design and caching will be more critical to perfomance than the actual lange. But since I'm operating on large amounts of data, it might actually make a difference once my app grows.

Any thoughts on these points or on Rails vs. ASP.NET in general? What are the big advantages of using Rails?

Re: Rails vs. ASP.NET MVC 4

I go between .NET and Rails on a daily basis. The main difference between the two platforms is the philosophy. Rails is all about maximizing the developer's productivity from what I can see. It makes a lot of boiler-plate type plumbing decisions for you, so that you won't have to waste time architecting the infrastructure every time. In .NET it is entirely up to you to create your service layer, data/ORM layer, logger, and etc. If you truly enjoy architecting the infrastructure stuff, you should stick with .NET for sure. However, from my experience, if you are developing a simple customer facing website that doesn't depend on existing enterprise database systems, you would be better off with Rails.

Having said all that, you can customize Rails to inject your own service layer code or a different ORM, but you will be foregoing many of the productivity benefits that Rails gives you, if you are "fighting" the rails way. As I said earlier, the philosophical approaches are different. I personally feel that for most website projects, Rails will do the job and get you to a release a lot quicker. For most of my projects, the clients couldn't care less about the architectural beautify of the code that clearly separates the service, data, model, and UI layers. They just want to see their ideas working as quickly as possible.