Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming The Internet IT Technology

Choice of Language for Large-Scale Web Apps? 801

anyon wonders: "PHP is the most popular language for the web. eBay uses ISAPI (C), Google uses C/C++ (search), Java (gmail), and Python. Microsoft uses ASP (what else?). For small web site, it really doesn't matter. What's your take on language choice for large-scale web applications? Maybe language choice is irrelevant, only good people (developers) matter? If you can get the same good quality people, then what language you would chose? Considering the following factors: performance, scalability, extendibility, cost of development (man-month), availability of libraries, cost of libraries, development tools? Has there been a comprehensive comparison done?"
This discussion has been archived. No new comments can be posted.

Choice of Language for Large-Scale Web Apps?

Comments Filter:
  • Re:Polyglot (Score:2, Informative)

    by l33t.g33k ( 903780 ) on Saturday July 30, 2005 @02:17PM (#13202974)
    Google uses Java (gmail) Not really. They use JavaScript for that, which is quite different.
  • Java Java Java! (Score:4, Informative)

    by FortKnox ( 169099 ) * on Saturday July 30, 2005 @02:18PM (#13202988) Homepage Journal
    No question about it!

    performance, scalability, extendibility, cost of development (man-month), availability of libraries, cost of libraries, development tools

    Performance? Assembly will give you the best performance followed by C and C++. All three of do not have that great of support for web apps..
    However, Java is almost exclusively being used for large enterprise websites. Its powerful enough to handle the big jobs, and using the appropriate app server will give you great performance.
    Cost of development is heavy in initial development, but pays for itself in maintenance. Most libraries and APIs are free in java (struts, spring, hibernate, tapestry, etc etc etc...). I'd say they are second to perl in terms of freely available and powerful libraries and APIs.
    Development tools? Just check out the (free!) eclipse platform.

    In my mind there is no question that Java (more specifically J2EE) is the best option for general large scale enterprise applications.
  • Seconded! (Score:3, Informative)

    by XanC ( 644172 ) on Saturday July 30, 2005 @02:22PM (#13203011)
    It does it all, and it values the most expensive component of software (for all but the biggest Web apps): programmer time.
  • Python (Score:4, Informative)

    by g-to-the-o-to-the-g ( 705721 ) on Saturday July 30, 2005 @02:27PM (#13203039) Homepage Journal
    Python is the way go to [zope.org]. For anyone who's built custom sites based on Zope, I think they would agree with me. Python is really easy to use for building big apps for use in web stuff, and Zope provides an easy-to-code-for application server.
  • ASP.NET (Score:1, Informative)

    by Anonymous Coward on Saturday July 30, 2005 @02:29PM (#13203056)
    Microsoft ASP.NET is also an alternative. It's fairly new but the new MSDN [microsoft.com] is written in asp.net 2.0. It's a mixed application between parsed stuff (like traditional asp and perl) and compiled stuff like Java, C++. Couple benchmark proved that this was faster that Java. Not platform independant for now, but it's a mather of time with mono [mono-project.com].
  • Microsoft (Score:2, Informative)

    by minus_273 ( 174041 ) <aaaaaNO@SPAMSPAM.yahoo.com> on Saturday July 30, 2005 @02:31PM (#13203081) Journal
    Microsoft uses ASP (what else?).

    err, no. MS does not use asp, they use ASP.net. There is a BIG difference between the two. The former is VB and the latter is C#,VB.net,J#,managed c++ etc etc. basically any language that runs in .net
  • Ruby on Rails (Score:3, Informative)

    by threaded ( 89367 ) on Saturday July 30, 2005 @02:37PM (#13203108) Homepage
    Ruby on Rails, try it, you won't want to use anything else. Ruby on Rails is just so sweet, just like the original Java alpha was all those years ago.
  • by blueZhift ( 652272 ) on Saturday July 30, 2005 @02:42PM (#13203136) Homepage Journal
    I still use PHP for a lot of personal work and quick stuff, but I've been leaning more and more on Python [python.org], Zope [zope.org], and Plone [plone.org] for building stuff at my day job. If you need to quickly and easily implement role based security, Zope makes it drop dead easy because it's built in and through ZEO [zope.org], zope apps can be highly scalable. Of course as with most things, use whatever technologies get the job done. For example, my Zope apps live behind an Apache server that I use for SSL as well as access control.
  • Re:Polyglot (Score:5, Informative)

    by PotPieMan ( 54815 ) on Saturday July 30, 2005 @02:43PM (#13203144)
    Ajax, which stands for Asynchronous JavaScript and XML, does not necessarily imply Java on the backend. Many Web application frameworks, such as Ruby on Rails, include Ajax helpers. I'm sure many Java Web app frameworks have also added support for it.

    Adaptive Path has a nice article introducing Ajax called Ajax: A New Approach to Web Applications [adaptivepath.com].
  • Re:Perl? (Score:2, Informative)

    by rascal1182 ( 729393 ) on Saturday July 30, 2005 @02:44PM (#13203145) Journal
    Perl is a write-only language

    O, if only mod points hath I.

    AC is right. Perl is not the best choice as far as upkeep goes. This is especially true if you get those l33t p3rL haXX0rzzZ who feel the need to program in circles.

    What is a better language than perl? Why, Ruby! (and not just because of Rails) However, for large projects where performance may be a significant factor, the answer for many of the back-end logic stuff would be something more like C/C++.

    I agree with many other people posting. The language itself is not important. Good design and good people are what leads to good code. The language is only a tool.
  • Re:Polyglot (Score:3, Informative)

    by connsmythe96 ( 576445 ) <slashdot.adamkemp@com> on Saturday July 30, 2005 @02:48PM (#13203172) Homepage
    AJAX makes an HTTP request (using Javascript) which returns XML. The backend can be written in any language (Java, PHP, Perl, whatever).

    Example [phpbuilder.com]
  • by adolfojp ( 730818 ) on Saturday July 30, 2005 @02:54PM (#13203200)
    Large standard library
    Excellent MVC model
    Integrated caching capabilities
    You can compile your libraries before uploading
    Excellent Web Services model
    Free tools
    Works on Linux (through mono)
    Large third party support
    Very Fast
    Easier to use and deploy than J2EE :-P
  • by Space cowboy ( 13680 ) * on Saturday July 30, 2005 @03:30PM (#13203421) Journal
    People will say that it doesn't scale but they base this opinion on a preset prejudice or on the scalability of the underlying architecture.

    What people mean by 'it doesn't scale' is that it doesn't scale. Not that it doesn't run fast enough or have enough functionality for pretty much anything at the small-to-medium sized website...

    I have a set of 200 or so websites all running though a self-built PHP template-based content-management system (hey, this was 8 years ago, they were rare then! :-) that has stood the test of time admirably. It's only got a few million pages in it's CMS, but it's pretty cool:
    • Typical page-creation is ~0.01 secs for complex pages
    • Copes with (currently) several million users
    • Handles email list management (opt-in only, don't flame me :-)
    • Separates the content from the formatting. Formatting is by recursive template instantiation.
    • Can embed run-at-page-delivery-time PHP modules as CMS elements
    • Has an Ad-server (flash, DHTML or images) which guarantees ad-placement in slots at a pre-paid rate
    • Copes well with binary data (PDFs, images, movies, etc.)
    • Handles image galleries from both user/admin perspective
    • Has sections where extranet companies can "own" part of the sites
    • Complete messageboard system, any number of boards, skinnable.
    • Manages products, shopping basket etc. and integrates with online purchasing providers
    • Provides newsfeeds in a variety of formats (RSS, XML via FTP, etc.)
    • Provides a *fast* fulltext search that uses phrases, booleans, etc.
    • Layers facilities on top of search (eg: site-editor can embed results of a search into an email (s)he composes. Preview, then deliver to opt-in list.)


    And will all those features it's still not scaleable. I can't split the system over multiple webservers and begin a transaction on one webserver, have a hardware failure, and have it complete on a different webserver. ..

    I server about a million page-impressions a day (less at weekends) so I'm hardly "big iron", but at the moment it's all serving from a single machine(*) with a manual backup ready-to-go. We're (probably) about to triple our daily throughput (time to splash some cash :-), so scalability has become more important, and I'm looking into the best way of doing this.

    I can't have the above level of scalability but I can divide up the work over (say) 4 cloned webservers, and use round-robin DNS (low TTL) or transparent-proxy load-balancing to share the load. Then at least if one of the machines goes down (not the proxy ;-), I can have it automatically react and recover.

    We're probably going to have 2 database servers as well - one in slave mode, one in master mode (all writes to the master, because we use MySQL). The single point of failure then becomes the proxy gateway (because RR DNS is a bit of a pain), so we can have a spare standing by - the configuration of a load-balancing proxy is pretty trivial, and doesn't depend on anything else, so it can be sitting ready to run and swapping ethernet patch cables ought to be all that is necessary.

    And that's about as "scalable" as I can make it - not very. All I'm doing is duplicating hardware for speed and reliability. I can have robustness against a machine dying, but that's about as far as I can go. True scalability allows the operation the machine was doing when it died to complete successfully, and PHP ain't there (yet). I guess you could implement it in s/w using lots of state tables, and perhaps get 80% of the way there, but it's an add-on not a built-in, and not a complete solution. Better to go with something that works if you need it...

    Just MHO.

    Simon

    (*) It is a bit of a beast of a machine though :-)
  • by jtwJGuevara ( 749094 ) on Saturday July 30, 2005 @03:42PM (#13203496)
    Pardon my ignorance here, as I'm a very junior developer who's only written small time apps using .NET and has dabbled in Java, but what exactly is so hard about deploying a .NET app compared to one developed for J2EE.

    A vice-versa question could be asked of the grandparent as well, since neither of you provided any factual evidence either way.
  • Re:Perl. (Score:2, Informative)

    by Samhain138 ( 683125 ) on Saturday July 30, 2005 @03:54PM (#13203556)
    mod_perl is fast enough.
    It's also fast enough for Amazon (they use mod_perl with HTML::Mason AFAIK).
  • by Gta-Klue ( 643989 ) <dislexic_oneNO@SPAMyahoo.com> on Saturday July 30, 2005 @03:54PM (#13203562) Journal
    Actually, not it's not. I support a somewhat large scale site for a stock firm, and we average thousands of hits a day. It's built on ASP.NET, and SQL Server on the backend.

    To deploy any changes, is just a matter of dropping 1 or 2 dll's into the bin directory and viola, it's deployed. Tell me again how hard that was?
  • by psykocrime ( 61037 ) <mindcrime&cpphacker,co,uk> on Saturday July 30, 2005 @04:02PM (#13203608) Homepage Journal
    saying that E-Bay uses ISAPI / C may be oversimplifying things. I see that some of their url's still include isapi.dll, which does suggest using ISAPI. But they had gone on the public record a few years ago as saying they were migrating to Java / J2EE, specifically IBM WebSphere software.

    http://computerworld.com/softwaretopics/software/a ppdev/story/0,10801,63692,00.html [computerworld.com]

    I would guess that they're actually using a mix of technologies. Any insiders have any insight they can share? Even anonymously?
  • Re:Polyglot (Score:4, Informative)

    by FooAtWFU ( 699187 ) on Saturday July 30, 2005 @04:08PM (#13203647) Homepage
    Last I checked, a MOO was a MUD, Object Oriented. Most MOOs are probably based off the LambdaMOO server, which was initially developed at PARC; the original LambdaMOO is available via your favorite telnet or MOO client at lambda.moo.mud.org port 8888.

    However, I would find such a system to be extremely unsuitable as a general-purpose database.

  • Re:Microsoft (Score:2, Informative)

    by minus_273 ( 174041 ) <aaaaaNO@SPAMSPAM.yahoo.com> on Saturday July 30, 2005 @04:26PM (#13203747) Journal
    yeah, there is a huge difference between the two. With Visual Studio ASP.net has been by far the simplest web dev environment i have used. It seems the story submitter didn't bother doing any research becasue of the MS factor. That unfortunate becasue ASP.net is actually really fast and really good.
  • by Anonymous Coward on Saturday July 30, 2005 @04:28PM (#13203754)
    With confidence I can say that C++ is the best choice of a language for developing large-scale applications. As any experienced developer know there are numerous reasons: portability, scalability, performance, etc. etc.
  • by markv242 ( 622209 ) on Saturday July 30, 2005 @04:36PM (#13203803)
    The only reason people think they use ISAPI is because that's what they originally used, and an executive decision was made to not break any existing links at any time, ever. Check the Powered by Java [ebaystatic.com] image. The /ws/eBayISAPI.dll that you see in all of the requests just invokes a servlet.
  • Re:Lotus Domino (Score:3, Informative)

    by tigersha ( 151319 ) on Saturday July 30, 2005 @05:19PM (#13204019) Homepage
    Holy mother of Jesus. I have to program that heap of tripe for years now. And my boss decided to write a large system in Notes with a mathematics student and I had to take the project over. The last five years have been hell.

    Notes's web part is not too bad and its unbeatable for putting up a really quick form for people to use if the looks are not too important but the database is utterly atrocious.

    the other problem with Notes is the horrifying development environment. You cannot, for instance, search your code and while it throws out line numbers in errors you cannot see them! And it does crap like no functionn (despite being in different modules) mmay have the same name in a system. The linker does not work. It does not support CGI hheaders properly. And you have to predefine ANY search through the database, there is no dynamic query language like SQL. This is probably the worse part of the whhole piece of shit.

    Notes as a mail system is not too bad however. It really handles the case where mmails are not sent correctly quite well, because it remembers the mail it send in a database.

    The notes client itself is not too bad, there are things it does OK.

    Anyways, stay away. Far, far away. Don't be like me and be trapped in this cesspool of horror.
  • Re:Hmmm.... (Score:4, Informative)

    by sterno ( 16320 ) on Saturday July 30, 2005 @06:13PM (#13204274) Homepage
    But again, many of the worst issues are programmer rather than language issues.

    While that's true, each language has semantics that either encourage or discourage their worst behaviors.

    As far as Java in regards to your comments above. Java's scripted aspects are actually compiled into code and turned into byte code before run. So the first time a page runs, it will be slow because of conversion. Once run the first time it will be as fast as the compiled code.

    As far as the issues of compiled code, development evironments for java really make a lot of this process quite easy. If you make changes to your code that don't require changes to method signatures, just the chunk of code you modified can be re-compiled. In NetBeans, what I use, I just click a button, and my code is ready to test in less than second.

  • EJB != J2EE (Score:1, Informative)

    by Anonymous Coward on Saturday July 30, 2005 @06:23PM (#13204321)
    I hear people saying all the time that they are not using J2EE when in fact what they mean is that they are not using the very bloated and usually difficult to develop (and slow) Enterprise JavaBean platform - EJB. When you are using the stack you mentioned you are using a very large part of J2EE - JDBC, JSP, and JNDI most likely. There is a whole suite of technologies that fall within J2EE - most are just fine, EJB being the primary exception.
  • by MarkWatson ( 189759 ) on Saturday July 30, 2005 @06:33PM (#13204359) Homepage
    I think that Java is the gold standard for small and large web portals in terms or reliability, good performance, etc. I have done portals that simply use Tomcat with either Prevayler or Hibernate/JDBC for persistence that basically run forever, until we want to do a software upgrade.

    That said, for CRUD applications, RoR is good - the scaffolding gets you up and running quickly, and views, controllers, etc. are easily customized.

    I used to use Python and Common Lisp a fair amount, but not recently. The UnCommon Web Common Lisp package looks good; I would like to check it out in some detail when it is more mature. It uses continuations (like Seside for Squeak and VisualWorks Smalltalk) to manage state between web pages.

    Sure, there is some overhead for using multiple langauges and frameworks, but I have always believed that it is best to be a "generalist" who can drill down when required.
  • Re:Hmmm.... (Score:4, Informative)

    by FunkyMonkey ( 79263 ) on Saturday July 30, 2005 @06:40PM (#13204392)
    20k lines of code? That is miniscule. I've got a mid-sized enterprise system that's got 20k FILES containing millions of lines of code integrating a dozen desparate systems over a network of 50 or so servers. It handles thousands of concurrent users performing transactions - not just viewing content. That's just a mid-sized system. Some large scale systems use clusters of hundreds of servers. Not to bash what you're doing but I think you could use a little perspective on the size of your application.

    I don't care if you've got a freakin army of PHP programmers, you're never going to build a system that can scale like Java.


    1) Scripted languages in general: slow performance

    2) Compiled languages in general: Requires rebuild before changes take effect, so testing and retesting is slowed down.

    3) Java/.Net/Byte-code languages: Worst of #1 and #2 above.


    Don't believe the hype about Java's performance. Today's just-in-time compilers can optimize code as well as hand optimized code and they don't waste resources optimizing paths that don't get executed. There are many benchmarks out there that confirm that Java's performance is comparable to C++ and even better in some areas.

    http://www.javaworld.com/javaworld/jw-02-1998/jw-0 2-jperf_p.html [javaworld.com]
    http://www.tommti-systems.de/go.html?http://www.to mmti-systems.de/main-Dateien/reviews/languages/ben chmarks.html [tommti-systems.de]
    http://java.sys-con.com/read/45250.htm?CFID=29694& CFTOKEN=101A9EF8-9F8D-153A-37A5E0A40D3EE24A [sys-con.com]

    I agree with your point though, there are a huge number of crappy programmers out there. Good programmers write good code in whatever language they are using.

    So, what is good code?

    IMHO, good code performs well and is easy to understand and use.
  • by esconsult1 ( 203878 ) on Saturday July 30, 2005 @07:30PM (#13204636) Homepage Journal
    Wow!

    Then I guess you never heard about using database driven sessions. The way how you've designed that bad boy, it would'nt scale in any language.

    Here's what we do:

    • 8 Apache Webservers
    • 3 Million pageviews per day
    • Distributed PHP sessioning (Postgresql based)
    • PHP module
    • Postgresql (no worries with MySQL write locks)
    Scaling? We add new machines in the mix, tell our load balancer about the new machines, and we've scaled linearly. A machine goes down? The load balancer redirects to another machine and the session continues without a beat.

    Bottleneck? The database, but then you throw big iron at that.

    Look, the web is stateless, if applications are designed from the get-go realizing that fact, heck, you can get a shell script sitting in cgi-bin to scale with your server pool.

    There's absolutely nothing in PHP that inherently causes it not to scale. Sure, other languages have easier and sometines better features built in, but if you're already using PHP, implementing those features are usually worth the few programming hours of effort instead of switching to another language/platform.

  • Re:Polyglot (Score:2, Informative)

    by dickko ( 610386 ) on Saturday July 30, 2005 @07:50PM (#13204730)
    (Hmmmmm. What the hell is "Moo"?)

    I'm guessing he probably doesn't know either. More likely this is what he meant:

    "I'm going to mention a lot of obscure project names so you'll think that (a) my kung fu is stronger than yours and (b) my penis must be huge!"

    As to your question I found this:

    MOO stands for "MUD, Object Oriented." MUD, in turn, has been said to stand for many different things, but I tend to think of it as "Multi-User Dungeon" in the spirit of those ancient precursors to MUDs, Adventure and Zork.

    MOO, the programming language, is a relatively small and simple object-oriented language designed to be easy to learn for most non-programmers; most complex systems still require some significant programming ability to accomplish, however.

    For more info, http://mirrors.ccs.neu.edu/MOO/html/ProgrammersMan ual_9.html#SEC9 [neu.edu]

  • by SimHacker ( 180785 ) * on Saturday July 30, 2005 @08:11PM (#13204820) Homepage Journal
    Lisp code is extremely easy to read and maintain -- it's just the opposite of Perl, not "more so".

    Are you going to trot out the "parenthesis are hard to read" argument? Well take a look at XML: that has TWICE THE NUMBER OF PARENTHESIS, only they're pointy instead of curved. That old "I'm afraid of parenthesis" argument is bullshit.

    Now look at Perl code: instead of seeing the explicit, unambiguous parenthesis in the code, you have to remember and resolve all of the implicit and complex special syntax rules, punctuation, precidence order, left/right evaluation, contextual quirks and special cases, etc.

    If you think Lisp is harder to read than Perl, then you obviously don't know either language, and you're just basing your beliefs on rumors you heard ignorant people distort and repeat, without learning those languages for themselves.

    -Don

  • by Marc Rochkind ( 775756 ) on Saturday July 30, 2005 @08:38PM (#13204942) Homepage
    ... for serious web sites:
    1. HTML,
    2. Client-side scripting language, usually JavaScript,
    3. Server-side language,
    4. SQL for database access.

    #3 is where there's the most flexibility. Speaking very generally, there are two ways to go:

    a. Lightweight scripting systems that depend only on the web server (probably with a loaded module) for support. Typically PHP, Perl, Python, or JSP/ASP using Java or a Microsoft language.

    b. Heavyweight systems, of which the two most common are J2EE and .NET. J2EE uses Java as its language, and .NET usually uses C# or VB.

    The usability, performance, etc., of the heavyweight systems depend as much on the middleware as the language itself. .NET is .NET, but for J2EE there are several choices. In my own experience with heavyweight systems, I found Java to be wonderful, but our J2EE server (Oracle's) very difficult to work with operationaly, and way too complicated for what we needed. So, in my opinion, one has to have much education, experience, and patience if one is to use a heavyweight system.

    My conclusion, however, would be that a heavyweight system is the correct choice for a big web application. My bias is towards J2EE because it's more open (and even has open source choices available), but the complexity of J2EE servers is a big concern.

    From what I hear, .NET has superior development tools and better support. I don't know whether this is (a) true and (b) worth the disadvantages of using a proprietary system.

  • by the way ( 22503 ) on Saturday July 30, 2005 @10:07PM (#13205251)
    FYI, features 1, 5, 6, and 9 are all supported in VS.Net by using Resharper [jetbrains.com]. I couldn't imagine using VS.Net without it...
  • Re:Everything, huh? (Score:1, Informative)

    by Anonymous Coward on Sunday July 31, 2005 @01:56AM (#13206126)
    I just asked a female. She said pearls were definitely better than a C+.
  • by Anonymous Coward on Sunday July 31, 2005 @06:00AM (#13206710)
    The database interface pretty much encourages SQL-injection friendly logic, and the "Magic Quotes" hack that PHP came up with is just disgusting. Compare that to Java where programmers are encouraged to use safe Command and Parameter objects, or just abstract the SQL generation away with Hibernate etc.

    PHP's oracle API lets you compile statements and then bind variables to them, which makes SQL injection impossible.

    I've just checked the documentation and the mysqli API and postgresql API also offer variable binding.

    Variable binding is the surest way to avoid SQL injection problems, and it is exposed by the API's for the major databases in use. So, what, exactly, is the problem with PHP's API's again?

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...