TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Building a large webapp today - what language for the backend, and why?

31 pointsby swixalmost 13 years ago
As the title reads, what platform/language would you pick for the backend, and why? Taking into consideration development time, costs and maintainability. Given you/your team were/are equally experienced with all languages/platforms. Thanks!

29 comments

hendzenalmost 13 years ago
For a 'large' webapp I would honestly go with Java. A good stack is Jetty for the http server, and Jersey/JAX-RS for the web framework. The JVM is unbeatable, and you will have an easy time onboarding people since everyone knows Java.<p>It's not as 'hip' as Rails/Django but you will be very productive and you will have the benefit of the plethora of Java libraries out there that are performant and reliable. Not to mention the great profiling tools.
评论 #4342268 未加载
评论 #4342324 未加载
latchkeyalmost 13 years ago
I started my business exactly a year ago this month. My co-founder and I went with Java on the backend for a few reasons:<p>1. This is what we were most experienced in. It is important to use what you know in a lot of circumstances because otherwise you'll have a harder time getting off the ground with your projects. Sure, Java isn't hip/cool in a lot of circles, but it gets the job done and there is a ton of support for it. Libraries like Joda DateTime/Money and Jackson are lifesavers that you can't find anywhere else. Do you want to build a business or spend time working on your tooling?<p>2. When your is new, you pivot your code a lot as you figure out the best way to do things. I can't tell you how many times we've said: "Wow, so glad we used a language that is easily refactored". Being able to safely make huge sweeping changes across your entire codebase without worrying about whether or not you are going to have runtime errors is golden.<p>3. We are hosted on top of Google AppEngine using Objectify to talk to the datastore as our database. This is another <i>huge</i> win for us. We get unlimited scalability with all the benefits of never having to carry a pager, manage servers or databases. Deploying code takes 2-3 minutes and is super simple. This means more time for adding features, which is very important when you are just starting off. Python is another good choice here, but lacks #2.<p>I'm definitely not a huge fanboy of Java any longer. I do feel that it hasn't grown with the times and I think Java has too much stuff to type out (even with Eclipse doing most of it for me). That said, I do see Sunacle actively working on it and 3-5 years from now, I bet there will be a shift either back to Java (as Java8 starts to get more widely used and brings the language more current) or to another language like Ceylon, which unfortunately just isn't quite ready yet.
评论 #4342481 未加载
3pt14159almost 13 years ago
Python (Tornado or Twisted) + Riak.<p>Why? You can scale <i>very</i> easily, write code in a higher level language that has lots and lots of libraries, have map reduce out of the box, but you don't need to really worry about your DB dying on you.<p>Here is what you do need to worry about in this set up: Eventual consistency. But I would argue that <i>any</i> web app at scale needs to worry about it. So if you are coming from a company that already has lots of users and you are writing a new app that will be in the hands of lots of people very quickly, go with Riak + Tornado/Twisted. You'll probably want to set R = 1 or 2 and pay special attention to conflict resolution.
tborgalmost 13 years ago
lein new noir myBigWebApp<p><a href="http://webnoir.org/" rel="nofollow">http://webnoir.org/</a><p>I think Clojure makes a lot of sense for the web, emphasis on immutability etc. I also am a sucker for lisps, and I think the Hiccup templating system is nice. Noir seems to do middleware well. Plus, real nerds get on that ClojureScript.<p>Then again, I kind of also believe that the back-end really shouldn't do much more than process CRUD commands, and that most of your serious application logic should happen on the client. So it doesn't really matter. Pick something with a DB adapter you're comfortable with and get to javascripting.
评论 #4342760 未加载
评论 #4343070 未加载
Bjoernalmost 13 years ago
Pick what ever gives you and the people you are working with the greatest productivity. Chances are it will get rewritten later on to address the problems you encountered.
programminggeekalmost 13 years ago
I like Ruby and Sinatra, but PHP with a decent Sinatra equivalent framework like Slim would be just as nice, or Python+flask/bottle, or Java/Scala and the Play framework. Honestly, it doesn't matter.<p>Use what you know and like and just build the app. Scaling is a nice problem to have, but don't solve it until you have it.
评论 #4342379 未加载
olalondealmost 13 years ago
Ruby/Rails and Python/Django seem to be the most common choices among YC startups. They are pretty much interchangeable on the development time, costs and maintainability fronts.
apeacealmost 13 years ago
First I would point out I'm not seeing testing frameworks being mentioned as part of these platforms ;)<p>I like Node.js + Mocha<p>* Development in Node is super fast<p>* Mocha makes TDD or its variants really fun<p>* Node feels natural for webapps (the Hello World example is an HTTP server)<p>* JavaScript is a really flexible and elegant language if you get past its minor quirks<p>* The community is fantastic<p>* The built-in package manager is fantastic<p>* The open-source libraries are fantastic (pick the right DB for the job, there are good drivers for all of them)<p>There's lots to say about Node. No language is perfect for every task.<p>EDIT: fixed spacing
spdyalmost 13 years ago
Python/Django or Ruby on Rails. If you have to move fast and change ideas quick and timely. Pick on of them.<p>Given my current project where i am the sole developer i dont want to know how much more time i would have spent coding in e.g. PHP.
netgineeralmost 13 years ago
I'd choose Ruby in a service oriented architecture. Use HTTP/JSON for internal APIs between distinct systems. If performance becomes a business-limiting factor, you can investigate replacing a single part of the system with a lower-level language (Java, Haskell, Go, Erlang, etc).<p>Rails (and in particular the RailsApi gem) makes prototyping and putting together a SOA like this easy and fast. Except for the API client, which I don't yet have a good solution (ie, what ActiveResource was supposed to solve).
spoboalmost 13 years ago
Use a higher level programming language and use a standard interface to communicate with the frontend. If you build a REST API for the backend it doesn't even matter what language it is written in. You can always swap parts out for faster performing versions later on. You can even split up parts in different programming languages.<p>If you want to decrease development cost go with an ecosystem that most of your developers have mastered. Python, PHP, Ruby, Java, .NET, whatever. Pretty much all these languages have great frameworks these days to allow for faster development.<p>I personally go with Ruby because they were pretty much first on the scene with their gem ecosystem (which is massive), they have a lot of cool and smart developers in the community and it's overal a great experience. Easy to pick up too with all the resources that are out there.<p>But whatever you do don't force a language along with it's ecosystem that your developers don't like. Listen to the dev team and know that every language has great potential. I'd come back and ask what frameworks should I use to build a high performance site as quickly &#38; efficiently as possible given I work with language X. Maybe the dev team is unaware of recent awesome frameworks in the language they know &#38; love.
评论 #4342450 未加载
benblodgettalmost 13 years ago
'Building a large webapp today'<p>Do you mean starting to build a large webapp today?<p>I would recommend Ruby on Rails or Python/Django - they allow for fast prototyping and easy collaboration.
mtrnalmost 13 years ago
I'd maybe go for small components with small APIs so team members could build upon and combine on top in whatever language they want.
pkaalmost 13 years ago
I gotta go in a sec, but I'll link you to previous comments of why I recommend Haskell [1] and/or Erlang [2] for a more massive backend architecture.<p>[1] <a href="http://news.ycombinator.com/item?id=4181223" rel="nofollow">http://news.ycombinator.com/item?id=4181223</a><p>[2] <a href="http://news.ycombinator.com/item?id=4341322" rel="nofollow">http://news.ycombinator.com/item?id=4341322</a>
jebbluealmost 13 years ago
I recommend Java the language and base platform running on Apache Tomcat frontended _not_ with mod_jk but with mod_proxy.<p>See my post here for specifics: <a href="http://forum.linode.com/viewtopic.php?t=9230&#38;p=53085#p53085" rel="nofollow">http://forum.linode.com/viewtopic.php?t=9230&#38;p=53085#p53...</a><p>For the Web UI I recommend GWT by using Eclipse and the GWT Designer GUI web designer they bought from the excellent folks at Instantiations back in 2010.<p><a href="https://developers.google.com/web-toolkit/tools/gwtdesigner/" rel="nofollow">https://developers.google.com/web-toolkit/tools/gwtdesigner/</a> <a href="https://developers.google.com/web-toolkit/tools/gwtdesigner/wizards/gwt/uibinder_composite" rel="nofollow">https://developers.google.com/web-toolkit/tools/gwtdesigner/...</a><p>If you have customers that demand a platform GUI application which accesses your web backend, Google donated WindowBuilder to Eclipse.<p><a href="http://www.eclipse.org/windowbuilder/" rel="nofollow">http://www.eclipse.org/windowbuilder/</a>
interwhoalmost 13 years ago
Personally, I'd go with PHP.<p>Why?<p>- It's easy to get things done fast.<p>- There are plenty of classes available online that'll make things even easier.<p>- It's easier to maintain (IMHO) than some other languages.<p>- It'll run on almost all web hosting services cheaply.<p>- It's scaleable.<p>If and when you need something more powerful, a seamless transition can be made over to another language.
评论 #4344947 未加载
评论 #4342581 未加载
评论 #4342436 未加载
daniellockardalmost 13 years ago
Rails is nice, but it's really really slow. At my job we use Jetty as the server with Play or Lift as the framework -- I think most of the devs like Play better, though. Really easy to run as an unprivileged user and do backends through nginx as well.
chucknibblestonalmost 13 years ago
Just to put this out there -- since nobody has really mentioned it -- ruby (as a language) doesn't have the greatest performance. You can do some tricks with GC to speed it up (Ruby EE might be a faster option), but you're still looking at 50x slower than C (python is 40x, Java 7 is around 2x, Javascript on V8 -- Node-- is 4x). So if you're planning on doing a lot on the backend, you might want to consider breaking off your logic/processing into java or lisp or something and using a rpc/mq system to send it tasks from your RoR/Django app....but then again...you might not want to start with too many moving parts :)
评论 #4342170 未加载
评论 #4342197 未加载
caseyfalmost 13 years ago
Something that runs on the JVM. Personally, I'd pick Ruby on JRuby.
js4allalmost 13 years ago
It is not a matter of the language so much. Use what your team is comfortable with. I find it super important how to structure the app. First design an API. Then implement it on the server with corresponding tests. Then build the frontend. Here is more to decide: server driven (server faces or server pages) or single paged (client side MVCs)
thirstehalmost 13 years ago
Go, for the same reasons as Java, but because Go is nicer than Java (to me.) The stdlib net/http library is also insanely fast, handling ~40,000 (dynamic, but not DB-backed) req/s without a sweat, and without requiring any kind of callback spaghetti.
Axsuulalmost 13 years ago
I agree with the use what you know mantra unless you don't know anything. Then I would recommend Rails for the backed and Backbone.js for the front end. Choosing popular technologies is important because it will save you and your team a lot time.
prpatelalmost 13 years ago
You have a number of great choices. Much depends on the team building the app - if you want to be adventurous try: Clojure &#38; Noir. Other options (in particular order):<p>* Groovy &#38; Grails * Ruby &#38; Rails * Python &#38; Django
p_shermanalmost 13 years ago
I don't know about everyone else, but I was always taught that analysis and design come before the implementation. It's not something you do in 10 minutes before you start making software.
WiseWeaselalmost 13 years ago
What kind of site is it? Is there a lot of content to manage? Drupal/PHP might even be a good tool for the job, depending on what you're trying to accomplish. More info would be helpful.
john_wang_wjqalmost 13 years ago
Pick the the language your team most familiar with. If there are no one such language, pick Python/Django, Clojure/Noir or Ruby/Rail, and keep yourself far from PHP.
nuttendorferalmost 13 years ago
You are going to rewrite it anyway if it's successful so you might start with something easy and quick like Django or Rails.
ergo14almost 13 years ago
Depends on the requirements, but I suggest Python+Pyramid Web Framework - it's so flexible that you cant go wrong with it.
njxalmost 13 years ago
I use a mix of PHP and Java.