Slashdot Mirror


Yahoo Moving to PHP

Erek Dyskant writes "Yahoo has decided to switch from a proprietary system written in C/C++ to PHP for their backend scripting. Here's the notes from a presentation by a Yahoo engineer at PHP Con 2002."

35 of 733 comments (clear)

  1. Dangers by briggsb · · Score: 5, Funny

    I hope the developers at Yahoo! understand fully the dangers of using PHP.

  2. It makes sense ... by SuperDuG · · Score: 5, Insightful
    PHP has begun to prove itself as a very mission-critical, cross-platform, well versed, and stable scripting language. For what Yahoo does and for the optimizations that have come in newer versions of php this makes a whole lot of sense. If yahoo plans on using a mod_php with apache 2.0 then I can see them even getting more performance gains. There's no way to tell as I've never actually seen the system they use currently.

    Obviously open source DOES apply to the corperate world.

    --
    Ignore the "p2p is theft" trolls, they're just uninformed
    1. Re:It makes sense ... by rseuhs · · Score: 5, Insightful
      Where have you been in the last 5 years?

      If you say that open source has a place in corporate webservers, I'd say that's a massive understatement.

      Open Source (Apache and PHP) is the standard in the webserver space already and is gaining more marketshare every year.

      Right now, only NBM (nothing but Microsoft) users and legacy systems run IIS. It doesn't offer anything valuable, except customer lock-in. (which is very valuable, but only for Microsoft)

    2. Re:It makes sense ... by jonbrewer · · Score: 5, Informative

      Right now, only NBM (nothing but Microsoft) users and legacy systems run IIS. It doesn't offer anything valuable, except customer lock-in. (which is very valuable, but only for Microsoft)

      There's no way you can back that statement up. Corporations generally have a few outward-facing web servers, and yes, these are most likely running apache, but the vast majority of Intranet web servers are still IIS. After that you'll see Lotus Domino and iPlanet, and then Apache.

      (This is from my experience with large corporations, though the IT rags such as Information Week and Network Computing back me up.)

      IIS is the standard for Intranet web servers for a reason - it's standard. It comes with every NT server. It's easy, and setup/administration hasn't changed in years. Any clown with knowledge of Windows can make it work, and it is stable and reliable.

      In the last 7.5 years I have administered just about every popular web server written (including NCSA HTTPd, WebStar, and IIS on NT 3.51 back in the day). Of all of them, I've found IIS the easiest to work with. Coupled with Win2k workstation on the desktop, it's almost fun to administer them with MMC and watch their behavior with PerfMon.

      The reason I deploy mainly IIS servers is that I can order a server from the IT department with a standard Win2k build and have secure applications (with access control) running on it within minutes of taking delivery of the box. Try that with a Solaris, Irix, or Linux box, I dare you. (Yes, I currently deploy and manage Apache on Solaris, Irix, and Linux, just not as often as IIS on NT/Win2k.)

      Sure Open Source has a place in corporate webservers. That place just isn't big, and won't be until Apache is easy to configure and integrates seamlessly with Windows NT security. When an idiot with an IT degree from the local community college can integrate Apache on Unix with a corporate network and can authenticate users and implement access controls without opening a book, then Open Source will have arrived in the corporation, and will start to eat into IIS market share of the Intranet. Until then, it'll be fringe, relegated to use on big systems with unix sysadmins doing the implementation.

  3. Maintence must be easier by papasui · · Score: 5, Insightful

    I'm sure it must be easier to find someone who knows PHP then it is to find someone who does cgi-bin c/c++ to maintain their sites. We use PHP/Asp for many of our internal applications we use for monitoring network systems and integrate it with MySQL. Works very well.

    1. Re:Maintence must be easier by dimator · · Score: 5, Interesting

      I can't for the life of me figure out why so many people pick it for web apps.

      I guess everyone is smoking crack except you. Seriously, why does MySQL get all this smack talk? I use it because its easy, every language I know of has bindings for it, its fast enough, and its stable. PLEASE spare me your "But XXX does that too, not to mention bla bla bla!" No, I won't switch, because I learned MySQL first (as I'm sure many others have) and so far it hasn't let me down.

      --
      python -c "x='python -c %sx=%s; print x%%(chr(34),repr(x),chr(34))%s'; print x%(chr(34),repr(x),chr(34))"
    2. Re:Maintence must be easier by leviramsey · · Score: 5, Informative

      MySQL is faster in really only one particular case: lots of SELECTs with few UPDATE/INSERT/DELETEs. Many applications have orders of magnitude more SELECTs than other queries (I'd guesstimate that Slashdot books at least two orders of magnitude more SELECTs). Nothing beats MySQL in that environment, and there are a lot of apps where that's all that's needed (think CMS's and other such things).

  4. Re:Perl was ruled out WHY??? by inerte · · Score: 5, Informative

    I'm not understanding the reasoning behind choosing php over perl

    You haven't read the article. There's a whole page for "Why not Perl?"

  5. Dangers of PHP? I think not! by Anonymous Coward · · Score: 5, Informative

    I find it very funny that some people are posting comments suggesting there are security problems with PHP.

    PHP has had a few security problems but they have all been fixed very quickly, just like many other open source projects like FreeBSD and Linux.

    I find it very amusing the Perl programmers are shocked that Yahoo picked PHP instead of Perl. Perl has its uses but it is not designed for the web, PHP is.

    PHP is easy to learn, powerful and c-like which makes it good for rapid development and web based applications.

    I would have been very shocked if they picked Perl of PHP, in my experience PHP is faster, more secure, more feature rich, way easier to compile and maintain, and takes far less code to accomplish the same things as Perl.

    If you look at hotscripts.com you will notice PHP has more entries than Perl, this has only been the case for the last few months and though it is a small indicator it is obvious PHP is gaining popularity and it is well know it is the most installed apache module on the Internet.

    Furthermore if you don't code for PHP don't comment on it, you don't know what you are talking about.

  6. One Yahoo user's perspective by Waab · · Score: 5, Funny

    As long as the change doesn't cause me to lose the lead in my fantasy hockey league, Yahoo can do whatever it pleases.

    And, if I do happen to lose the lead in my fantasy hockey league, I now have something to blame it on.

  7. makes sense... by Anonymous Coward · · Score: 5, Informative

    ...considering it's initial creator is now a Yahoo! employee

  8. Re:Seems like a silly move... by photon317 · · Score: 5, Insightful


    Eep, why J2EE? It's slow, it's a memory hog, it doesn't deliver on the write-once-run-anywhere promise of Java because of the vendors' differences. Perhaps most importantly for them, you really can't use Java w/o threads, and thread support on FreeBSD is not great. Read that over again. That means that Java doesn't scale well for you if your OS's thread don't scale well for you. If you're running FreeBSD, then that's the case, which further limits Java's absymal performance.

    --
    11*43+456^2
  9. Re:Seems like a silly move... by TheTomcat · · Score: 5, Insightful

    isn't going to give any type of boost over a proprietary C/C++ app

    It wasn't a proprietary C/C++ app, it was a proprietary C/C++ scripting language.

    Performace should be same or better, if I understand correctly.

    S

  10. Re:Seems like a silly move... by Vaulter · · Score: 5, Informative


    Because Yahoo is one of the fastest sites on the 'net.

    EJB's are great, don't get me wrong. They are great for handling database abstractions with zero tolerance for errors. But they are not fast, and horrible overkill for a site like Yahoo. All that abstraction and IIOP communication kills performance. Which is why shops that have large EJB applications tend to run them on heavy duty sun hardware. Not i386 boxes running FreeBSD.

    --
    I don't have a sig...Do you??
  11. Re:Perl was ruled out WHY??? by ceejayoz · · Score: 5, Informative

    Quoth the link:

    Cons
    - There's More Than One Way To Do It
    - poor sandboxing, easy to screw up server
    - wasn't designed as web scripting language

  12. Re:Seems like a silly move... by glwtta · · Score: 5, Interesting
    Hm, if they are rewriting their entire app, wouldn't a move from FreeBSD to some other UNIX(-like thing) be small in comparison?

    I mean seriously, I'd love to hear the pros and cons of the "Moving our stuff off of FreeBSD" vs. "Having to maintain everything in PHP instead of J2EE" discussion.

    --
    sic transit gloria mundi
  13. Re:Dangers of PHP? I think not! by Anonymous Coward · · Score: 5, Insightful

    PHP's biggest security problem is it's users. PHP is a powerful and easy to learn and use tool, which means it attracts a lot of new users. And the more new users you have, the more new user mistakes are made.

    PHP has made a grep step forward in disabling register_globals by default. Unfortunately, a lot of legacy code isn't built for this.

  14. fascinating by erikdotla · · Score: 5, Interesting

    I'm glad Yahoo is moving to OSS and recognizes the dangers of proprietary software.

    I'm a Perl guy, and it was very interesting to note that:

    1. Perl beat PHP in all of their performance tests
    2. They listed TMTOWDI as a "con" yet,
    3. One of the requirements was a language that didn't require a CS degree to use. TMTOWDI helps that, I've noticed.

    I'm saddened that Perl has lost a major cheerleader but at least it isn't MS technology.

    Even so, I can actually see how PHP is more appropriate. For a site with lots of content, with code mixed in, PHP's "code in the page" model is more ideal. I've had to reinvent something similar in Perl many times, appropriate for whatever I'm working on at the time (I don't like Mason, I prefer my own solution.)

    I can see how a solution such as mine - where I prepare an output hash of data then show a webpage by opening and printing the file, using s/// to insert my hash contents with a search/replace method, isn't exactly ideal for Yahoo's high-content needs.

    While PerlScript somewhat solves this problem, I remember it being buggy and certainly not as mature as PHP in that regard.

    I can't say that I think this is a mistake on Yahoo's part - more like, I think if they wanted to, they could solve Perl's shortcomings and reap the benefits that Perl has over PHP. I guess they're just not interested.

    The presentation was a little vague, wish I knew more about the details of their decision.

    --
    # Erik
  15. Why is PHP so bad? by Anonvmous+Coward · · Score: 5, Insightful

    I skimmed the comments so far and it seems like some people don't have a very high opinion of PHP. It's one thing to feel like something is better, but to despise it baffles me.

    I do programming in PHP and have found it not only to be useful, but quite an upgrade over ASP. Is there something inherently bad about PHP that should make me shy away from it, or is it more of a religious debate?

  16. Re:Oh my god! by mr_z_beeblebrox · · Score: 5, Informative

    PHP useful at something!!!

    I didn't expect the spanish inquisition. Really, though. PHP is like PERL made for the web, it has easier access to databases than any other language I know of (which are only a few granted but Perl and C are among them).
    I would say more but Language choice tends to get religious. Everyone thinks theirs is superior and few will just yield to my choices :-)

  17. Why I'm excited about this. by heldlikesound · · Score: 5, Insightful
    Not that I give two rips about Yahoo, but I am glad to see PHP being embraced by companies that are considered "heavyweights" in the industry. It helps dispel the myth that ASP is the "industry standard" and paves the way for PHP / OS databases to be accepted or at least considered when beginning a project.


    It will be nice to go to a large corporate client that is looking for an enterprise solution (what the hell does that even mean) and say something like:
    "I'd reccomend using PHP and Postgres on the backend of the project, given Yahoo's recent success, I think the platform is powerful, sucure, and cost-effective."


    I realize that what Yahoo does in reality is irrelevant, but executives like to hear that kind of shit. Of course that assumes Yahoo can make it all work well, time will tell.

    --


    Cloud City Digital: DVD Production at its cheapest/finest
  18. Re:Oh no! by mr_z_beeblebrox · · Score: 5, Funny

    Would the PHB's like it?

    engineer:this is a rare opportunity phb: hmm?....
    engineer: PHP is not yet a buzz word...we can set the market, indicators would rise, indexes improve, shareholder confidence would surge!
    phb: WOW! I want PHP!
    Jr. Engineer: What did all that stuff you said mean?
    (clever)engineer: With Y having nearly 11M lines of code to rewrite in a new language....it means job security (and we still don't have to wear a suit)

  19. Re:Seems like a silly move... by FortKnox · · Score: 5, Interesting

    Because J2EE is slow to develop in

    I'd argue that if you use 2.0 EJBs and JBuilder, I could code just as fast as any regular language, but scripting languages are easier to slap code into.
    Now, good scripted PHP vs good abstracted OO Java. To code from scratch, PHP'ers could lay down code quicker. Java is easier to maintain and easier to add onto (if properly architected). In the end, I'd call it even ground.

    slow at executing

    Java 1 was slow. That was like 5 years ago. Go download JBuilder and run it. Made in C++, right? BUZZT! Its Java. Java has come a long way.

    J2EE is beautiful in theory, but not in practice

    Well, my job is a J2EE developer, so I guess the complex, enterprise level application that is running currently in front of me isn't java, cause it isn't beautiful in practice.

    Anyone with that only on their resume will have to shape up the next years, when PHB's stop buying that particular buzzword and move on to the next.

    Go look at monster. J2EE is one of the few languages that people have been hiring in throughout the recession. That doesn't sound like something PHB's are gonna just stop hiring.

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
  20. Lack of understand of how PHP works? by Inoshiro · · Score: 5, Informative

    "The drawback of using a code in template system, is that your code and HTML output quickly become forever intertwined."

    You see, the funny part here is that I write PHP, and I do not intermingle my XHTML and PHP at all.

    How does it work? Very simply! Your request handler parses the request, reads in any cookies, sets and changes, reads in the template from disk or cache, fills in the new variables, and pushes it to the client.

    Look, mah, no PHP/XHTML mingling! You move from a "myFirstPHP" model of HTML with PHP shoved in, to a proper model of a complete HTML document produced in anything with %%variables%% strewn throughout which are replaced at runtime by the PHP engine. With this separation of application logic and appearance, you get all the benefits of PHP with all the benefits of a separate interface code level (.NET WebForms does something similar, and Perl can easily do this too).

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
  21. Re:Perl was ruled out WHY??? by tzanger · · Score: 5, Insightful

    I agree, I just thought I'd point out that this doesn't change the fact that perl is HELL to maintain for larger projects :)

    Bullshit, or at least bullshit that Perl makes it harder to maintain than any other language.

    Code properly, document correctly and adhere to the same design rules for any other maintainable project (which includes firing the assholes who think that obfuscated perl has a place in a maintainable project) and you will have no more difficulty in maintaining a Perl project than you will any other.

    The fact that perl lets you create a mess may be open to debate, but it certainly doesn't mean it will be a mess.

  22. There are many good reasons. by Anonymous Coward · · Score: 5, Informative

    I work for Yahoo!.

    We chose PHP because our proprietary scripting language didn't give us any performance advantage anymore. PHP is a language with a lot of use and a large group of people in the workforce that know it. We wrote our proprietary solution at the time because nothing else could give us the performance that it could. Things have matured, and with accellerators such as Zend, PHP is a fit for us. There are many more reasons outlined in the presentation. Read it.

    Some people here appear *angry* that we didn't choose [their favorite language] and all I can say to you people is "grow up." PHP is a fit for us. Your solution is a fit for you. Get over it. We know *quite well* how to run enterprise sites, and the decision to go with PHP was not made by the clueless.

    Yes, we use PHP. We use Perl. We use Python. We use TCL. We use C/C++. We use Java. We use Apache. We use FreeBSD. We use Solaris. We use Windows. We use Linux. We use GCC. We use GPL software. We use BSD software. We use proprietary software. We use a lot of things. This isn't really news.

    1. Re:There are many good reasons. by T3kno · · Score: 5, Funny

      Um...just because you have an email address @yahoo.com doesn't mean you work for Yahoo!

      --
      (B) + (D) + (B) + (D) = (K) + (&)
  23. Next Obvious Question... by DarkHelmet · · Score: 5, Funny

    If Yahoo can do it, why can't slashdot?

    --
    /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i
  24. Big Whoop. by brunes69 · · Score: 5, Informative

    This doesn't tell me anything about the quality of these products. I cant speak for the others, but have you ever looked at the source for PHPNuke? It is a horrendous mess. Not only that, but the thing is routinely riddled with secuirty holes and other bugs. I had the displeasure of running it on my site for awhile, what a mess.

  25. They passed on Java because FreeBSD is crappy? by doomdog · · Score: 5, Insightful


    According to the slides, the only negative thing they had to say about Java (J2EE / JSP / etc.) is that FreeBSD has really lousy thread support (and proper J2EE solutions require threading)...

    To me, that seems like a really stupid, short-sighted way to approach the problem. If Java is the best solution for them (which I think it would be), then why not move to an operating system that properly supports it?

    Why hamstring yourself to an inferior solution just because you don't want to give up FreeBSD? That's like complaining that your Pinto is too slow -- but you'd rather fill it with Premium gas to get a little performance boost instead of getting a better car.

    And what's up with 4500 servers? What a nightmare! Who in their right mind would want to deploy and manage 4500 servers? If they were really serious about this, they'd upgrade to a couple dozen big-iron IBM mainframes (like one of these!), where it can run hundreds of virtual Linux instances (if needed)...

    I guess it goes back to the old saying "When you only have a hammer, everything looks like a nail"...


  26. Re:Oh my god! by tfoss · · Score: 5, Insightful
    I wonder if they've thought about the performance hit


    Dude, this isn't some little backwater ecommerce site, this is the most hit site in the world. I think it's safe to say they considered the performance. (BTW check slides 30-34 of the link for that exact info)


    -Ted

    --
    -=-=- Quantum physics - the dreams stuff are made of.
  27. Big Mistake by Pinball+Wizard · · Score: 5, Funny

    Clearly, they should have used Cobol.NET.

    --

    No, Thursday's out. How about never - is never good for you?

  28. Yahoo SHOULD be using Perl, not PHP. by Deven · · Score: 5, Insightful
    The reasons given for "Why Not Perl?" were:
    • There's More Than One Way To Do It - This is a feature, not a flaw! Perl is much more flexible and powerful than PHP. Maintainability comes from coding standards, not language limitations.
    • poor sandboxing, easy to screw up server - Perl can create sandboxes with the Safe module... (And if there's any rough edges, Yahoo's engineers could probably handle it.)
    • wasn't designed as web scripting language - So what?? With mod_perl and HTML::Mason or TT2, Perl fits this niche well, without PHP's predisposition towards mixing code and data.
    These excuses for not using Perl are hardly compelling; they sound like rationalizations. Perl is a more natural fit for Yahoo's needs, especially considering that they already have 3 million lines of Perl code.

    But they plowed ahead with PHP, and what did they learn?
    • very easy to get some pages up quickly - Expected, but Perl would have been nearly as easy, and probably much easier for their existing Perl programmers.
    • But mixed app/presentation problematic - PHP code and HTML forever intertwined - Surprise, surprise! This is exactly why PHP is inappropriate for enterprise applications. PHP encourages such shortsighted design. Beginners like it, but engineers should know better.
    • PHP != Perl - The "implement twice" problem - They knew that they had 3 million lines of Perl in the backend; why didn't they leverage it? This was avoidable.
    • PEAR != CPAN - repository smaller, less mature than CPAN - Again, this was a foreseeable problem.
    • Surprises for people used to coding Perl - It's not just that some semantics differ. Experienced Perl programmers forced to work in PHP have to live with the frustration of having to write ugly convoluted code for things that would be clear and simple in Perl. PHP 4 filled in many gaps, but it just doesn't work as well as Perl does. (I speak from experience here.)
    So let's see. Their problems with PHP basically boil down to the fact that it's not Perl. (Despite the claims of PHP advocates, it's just not an equivalent substitute.) Of course, any experienced Perl programmer familiar with PHP could see these issues coming from miles away. They rejected Perl as an option, claiming that it wouldn't be maintainable, then discovered the amount of discipline required for PHP -- would following good coding standards for Perl really have taken any more discipline?

    Perl was a natural fit for their needs, and the obvious choice. The entire presentation seems to be an exercise in rationalization, attempting to justify a poor strategic decision. They should have used Perl. (Even now, they should probably abandon PHP and use Perl instead, to save themselves from getting further entrenched into this bad decision...)
    --

    Deven

    "Simple things should be simple, and complex things should be possible." - Alan Kay

  29. These aren't really problems. by mgkimsal2 · · Score: 5, Informative

    1) This one is really annoying. Certain pre-defined variables (I'm not sure which, maybe only user-inputted data) are pre-slashed. So if a user inputs the string 'My name is "Jon"', you get it as 'My name is \"Jon\"'. WTF is up with that? That's not what he said! I can't find the reason for this or anything else about it in the documentation (maybe it's there somewhere, but I can't find it).

    It's also pretty annoying when you don't read the manual - and this one is NOT obscure to find. Section 8 - "Variables" (which is what you're dealing with) has a section about 'Variables from outside PHP':
    http://www.php.net/manual/en/language.varia bles.ex ternal.php

    2) Every time a page is loaded, it has to be re-parsed, as well as any included scripts that it uses. This is very inefficient.
    Then design a better language yourself that has nifty things like variable variables (echo $$b[0]->foo;) and is still faster than most other languages. Or just get a host that will use one of the many caching products available (zend, ioncube, etc)

    3) It's a real pain to include scripts that are in different directories which include other scripts, because they will try to open them relative to the location of the original page.

    Seems pretty damn logical to me. Of course, PHP will also look for files in the 'include_path' which is set in the php.ini file, so it's really looking in multiple places. And it wouldn't kill you to just use a predefined constant like DOCUMENT_ROOT and include files relative to that so your scripts would be portable and a bit easier to move around internally if you need to.

    PHP does have problems - nothing you've mentioned here is a 'problem' beyond the level of mere annoyance to a handful of people.

    Slight plug - those who've taken our PHP training course have never complained about the issues you brought up as 'problems'.

    Cheers

  30. Speed by Andy+Dodd · · Score: 5, Informative

    While this may have changed, a few years ago, Postgresql was a non-competitor for one reason and one reason alone: It was slow.

    MySQL had a reputation for being VERY fast. (In fact, this is why it was chosen for /. - It was the fastest choice available at the time.)

    Again, this may have changed, but in the past, MySQL was the speed king if you didn't need all of the other features that Postgres offer.

    So in short, the one users reason is, "I picked a database with less features/reliability because I need speed more than features/reliability."

    --
    retrorocket.o not found, launch anyway?