Ask HN: Choice of framework for development of a large scale web application?

8 points by clockwork_189 ↗ HN
Ruby on Rails, Django or Symfony2 Please state your reasons as why you would pick said choice. From prior research I found out that RoR and Django are more expensive to scale than any php framework, however I am confused why a lot of Silicon Valley Companies use RoR as their primary framework.<p>Thanks, Clockwork189

9 comments

[ 2.9 ms ] story [ 31.2 ms ] thread
PHP is very, very hard to scale. Facebook goes through a lot of crap to make it work.

Django would be easier, and RoR is a bit harder.

All this fades away if you go with something like Microsoft Azure which just automagically handles everything for you.

I like python, so, I would go with Django.

You are unlikely to get comments from people who have actually built large scale web applications with all three of those frameworks, so you'll get a lot of opinion and little fact.

As a second point, all three of those frameworks are solid choices to build a web application with. Selecting one purely for scalability reasons smells like premature optimization.

Unless you know you are going to be hitting truly massive scale, all three frameworks can be plugged into a share-nothing-architecture and made to scale horizontally.

I'm more curious what research you found that says that Django/RoR is more expensive to scale than a PHP framework.

The only thing I could guess is that the apps are memory bound, and Django/RoR take more memory than the PHP alternative.

For large scale web applications most of these frameworks will not work because they don't scale. I know Twitter is an exceptional case but why do you think they are converting their Ruby code to Scala?

I personally like Grails which uses Groovy for the programming language. To enhance performance and obtain near Java like speed there is a statically typed extension called Groovy++. Because it operates heavily off of type inference it is extremely non-intrusive when being introduced to existing code.

My two cents: to have a scalable distributed application you're ultimately going to have to build a kind of SOA with the Django/Symfony/RoR frontend talking to your backend services via API calls. So the framework just handles fetching data and laying it out nicely while the real work happens on the backend.

Once you have this, you can optimize your application to handle all kinds of workloads without getting bogged down by whatever framework you're using. Heck, write your CPU-intensive code in C++ if you're so kooky about performance, use SQL or OODBs, whatever. Distribute you application across the globe. Your application is ultimately just responding to HTTP requests.

Use Django for the frontend. Use whatever you want for your backend. Using Python for both would be nice. If you're really worried about performance, use a JVM language like Scala. Ultimately, this choice will be driven by what kind of computation you're doing on your backend. E.g, if I was doing scientific computation I'd use Python because it has NumPy and SciPy. Let the backend decision be driven by what language has the libraries you need. You absolutely _do not_ want to write code when you can avoid it.

That said, I must bring your attention to a few points:

(1) Premature optimization is bad. If you don't know whether you'll need it, then you won't need it.

(2) Just-in-time scaling, i.e, scaling right when you start facing performance problems is going to be hard. If you know you will totally definitely 100% need it, plan for it now.

(3) 99% of web applications don't need to worry about scaling. Throwing more hardware at the problem, intelligent caching, and some basic Algorithms 101 techniques go a long way towards making things fast.

(4) I'm not in the Valley, and I've never built a large scale web application ;)

Agreed. In my projects that have scaled, we've built a Sinatra API for internal use, and had a front-end (Rails, now moving to Backbone.js) query that API.
"RoR and Django are more expensive to scale than any php framework"

I don't agree. I haven't seen one feature of PHP frameworks that would make them scale better than RoR or Django frameworks.

They'll have similar scaling issues which will revolve around scaling the database.

You have to take into consideration developer time, because often you are paying more for your staff than for your servers. Python and Ruby applications are known (unsourced) to have faster, more rapid development cycles than PHP applications. The ecosystems there tend to be friendlier for people looking to plug and extend existing libraries to put together a minimum viable product quickly.