

How We Moved From Microsoft ASP.NET to Rails and NoSQL - robconery
http://www.infoq.com/articles/architecting-tekpub
Tekpub.com was originally written using ASP.NET MVC, Microsoft's newest framework - which the founders new really well. However they recently moved to Rails and NoSQL.
======
SamAtt
As an MS developer this really is devastating.

Rob Conery is one of the names that any fan of ASP.NET MVC knew. He was
involved in the project when he worked there (I'd call him the most high
profile MS employee aside from Scott Guthrie). To have him come out and say he
couldn't make a startup work with Microsoft technology really tells you all
you need to know about that.

I still need to use .Net at work but I think this combines with a bunch of
other factors to push me away from Microsoft on anything else I do.

~~~
robconery
It has nothing to do with the technology - it's good stuff and we could have
made it work fine. The issue is we want to stay small and not take on the
associated cost.

I can see how it might come off like I'm damning the platform - that was
hardly my intention. Rails has had 3+ years of Open Source contribution to
build out the platform and make it do amazing things - ASP.NET MVC will
(hopefully) grow in some of the same ways - but there's a somewhat stunted
element to the .NET OSS ecosystem. Hopefully that will change.

~~~
SamAtt
My point really was only part technical though. To give an example you had to
switch from Silverlight for a completely nontechnical reason. It wasn't even
expense related.

But you still had to switch and it still cost you time and money you wouldn't
need to spend had you just gone with Flash in the first place. So the point to
me is still "don't use Microsoft technology because you'll end up needing to
switch"

~~~
robconery
Can't argue with that. Outside the corporate walls money is king - it's a hard
truth and one I was not about to pay for personally :).

------
aymeric
I have learned Ruby on Rails and I am amazed that after three weeks with RoR I
am more productive than after 10 years with .net

I reported my own experience moving from Asp.net to Ruby on Rails in my blog a
few days ago:

"How an experienced developer multiplied his productivity tenfold"
[http://aymeric.gaurat.net/index.php/2010/how-an-
experienced-...](http://aymeric.gaurat.net/index.php/2010/how-an-experienced-
aspnet-developer-multiplied-his-productivity-ten-fold/)

~~~
misterbwong
Did you happen to try out other frameworks before deciding on RoR? I'm
thinking about testing the waters outside of MS land and I'd like to know why
you chose RoR versus, say, Django or even Struts.

~~~
Artemidoros
I find it hard to imagine that there is any web framework still around that
could be more screwed up than Struts. After having had some major exposure to
the various members of the Struts family and Rails, I would say that the
experience of using Struts 2 is slightly worse than using Rails while being
flogged by an expert torturer. :-)

If you want to test the world beyond MS I would recommend (apart from Rails or
Django) looking into the Scala/Lift (my preferred toolset), Clojure/Compojure
or JavaScript/Node.js combos (depending upon you language preferences).

I would be careful with Rails, when you plan to do some heavy data processing
and/or if you need your application processes to run for a long time without
being restarted.

For small, straightforward applications or prototyping the
Ruby/Sinatra/MongoDB combo is also really really nice.

~~~
dasil003
_I would be careful with Rails, when you plan to do some heavy data processing
and/or if you need your application processes to run for a long time without
being restarted._

Heavy data processing yes, but the long running process is bogus. The major
memory leaks in Rails were patched up _years_ ago. The tooling is a lot better
today on the off chance that you _do_ need to debug a memory leak, and the new
breed of ruby runtimes such as Rubinius will keep memory in even tighter
control.

~~~
Artemidoros
Being somewhat problematic for long running process is not only a function of
memory leaks.

Even with the better runtimes now available, suggesting that they come close
to the stability (and performance and long term memory consumption and
profiling + debugging capabilities) you'll find on the big JVMs is not really
helpful (JRuby being the obvious exception but even here I am sceptic).

------
mhartl
If you're an ASP.NET MVC programmer looking to learn Ruby on Rails, check out
my book _Ruby on Rails Tutorial_ at

<http://www.railstutorial.org/>

I don't know ASP.NET MVC at all, so I haven't tailored the presentation to
Microsoft developers, and I'd be curious to hear if you find my approach
accessible. You can leave me feedback at
<http://www.railstutorial.org/feedback>.

N.B. Although NoSQL is outside the scope of an introductory tutorial, I'm
hoping to do some follow-on articles on such specialized topics once the core
tutorial is finished. (I'm currently writing the final chapter.)

------
MikeW
I've got a small webapp targeting ASP.NET MVC 2.0 (built with Visual Studio
2010) running on Linux with Mono 2.6 and served with nginx (using the fastcgi
interface to mono) so if you put the time in, it's possible to deploy on an
open source stack.

I saw a commenter talk about Linq-to-SQL and yes this is possible too. I use a
PostgreSQL server and use Linq-to-SQL with it. It works but as expected, the
documentation is poor.

This is free to use, but from my experience some of the costs can be very
frustrating time spent trying to figure out why things are not working as they
should, or barrier to entry with poor documentation.

As one commenter pointed out, mono behaves strangely when changing part of
your codebase while it's running. Modifying a file can cause 500s or timeouts
to be thrown. Killing and restarting the fastcgi process is needed.

A major positive is the developers who work on these parts of mono are very
responsive to issues and code is improving all the time.

------
archon
My first question after reading the title was "Why?"

From the article:

"JA: All the problems we had (licensing, testing, deployments) could have been
overcome. We could have used workarounds, written our own deployment
framework, etc. What is comes down to is that we both really enjoy working
with Rails and we enjoy the Rails community and the tools and libraries
available. One of the best parts about running the show is that we get to do
what makes us happy."

~~~
awa
Nope. FTA: RB: If the platform was holding up fine, what prompted the change
of architecture?

RC: Money.

~~~
javery
Rob (RC) and I (JA) tend to disagree on things all the time. For me it wasn't
as much about the money as the pleasure of using Rails, and I know Rob also
loves using Rails. The money was basically what made the decision easy, here
were our choices:

1) Continue to use a platform that costs more and isn't as much fun.

or

2) Use a platform we both love using and works out to be cheaper.

Pretty simple decision really.

------
wuputah
Actually, from Rails, to ASP.NET MVC, to ASP.NET MVC again ("because it was
getting too complicated"), then to Rails.

I'd also be very hesitant to use MongoDB as a main datastore as it has no
durability model - the 'D' in ACID. I hope they've at least changed the
setting, or don't mind losing their last 60 seconds of writes when their EC2
instance goes down.

[http://www.mongodb.org/display/DOCS/Durability+and+Repair#Du...](http://www.mongodb.org/display/DOCS/Durability+and+Repair#DurabilityandRepair-
ThoughtsonDurability)

Note that Mongo compares itself to MyISAM, but that is infrequently used now
because of its lack of durability amongst other things - no transaction
support, etc (most apps use InnoDB).

~~~
javery
We actually use MySQL as a transaction log for things like orders/views to
balance that out, MongoDB stores everything else though.

~~~
wuputah
Gotcha, that works, and was mentioned in passing. Mongo still makes me
nervous, but otherwise looks very promising.

~~~
robconery
Our writes to Mongo are few and far between - otherwise I'd be nervous too :)

------
riprock
I'm not an expert with the Microsoft stack, but aren't there ways to mitigate
the costs? I've heard Mono supports (most of?) ASP.NET and you don't have to
use SQL server either. What other costs are there specific to the Microsoft
stack?

~~~
pbz
I would've loved to see a rough breakdown of how they got the the "5 figures"
cost...

~~~
robconery
SQL Server license: $7171 per processor - we have a single quad machine...
which we'll likely need to split into two machines, incurring extra licensing
fees. Our servers _were_ hosted at MaximumASP and they gave us a bandwidth
quote with additional servers that was 4 figures (remember, this is 3 years
out).

Visual Studio is $1200 a pop - this is for two people.

I'm already at 5 figures and I didn't include Expression/Media Encoder and so
on.

<http://www.microsoft.com/sqlserver/2008/en/us/pricing.aspx>
<http://www.microsoftstore.com/s/visualstudio>

~~~
pbz
So then why not just replace the database and keep the rest? Were you using
Linq to SQL and hence tied to SQL Server? As far as VS I'm sure it would not
have been a problem for you to get free versions. However, I suppose if you
were to change the database portion, probably a sizable chunk of the
application, you may as well replace the whole thing...

~~~
robconery
But _why_? My cost right now (aside from hardware, which is net even) is 0 -
without the hoops. Also - the testing story is much better.

~~~
pbz
Was the cost of rewriting that small? In my view it would only make sense if
the cost of rewriting the app is insignificant. If you can do it in a week or
two, sure... any more than that and I would start to question if it's worth
it. I mean, you gotta make sure it brings in money first, right? :-)

~~~
robconery
Overall about 2 weeks total. I took my time and wrote it first in Sinatra,
then scrapped and went to Rails - 2 weeks :)

~~~
troygoode
I'd like to hear more about why you switched from Sinatra to Rails. I'm
primarily an Asp.net MVC dev who plays with Python/Ruby on the side, but
Sinatra really interests me.

------
mark_l_watson
Nice article! I really enjoy hearing about other people's experiences.

I have nothing per se against Microsoft's hosting except for the expense. I
believe that it is much more expensive than AppEngine or AWS. Question: the
lock-in factor is likely not that big of an issue since apps could be run on
Mono and a leased server, right?

Really, software, writing and deploying web apps is a business and there are
two large costs involved: labor costs for writing and maintaining software,
and hardware+admin costs for deployment. The question is what is least
expensive and fastest to deployment. For me, that is Ruby on Rails for the
front end, and as needed, back end processing in Java, or Clojure, or Common
Lisp - whatever makes sense for a project.

