Slashdot Mirror


PostgreSQL Slammed by PHP Creator

leifbk writes "'The Web is broken and it's all your fault' says Rasmus Lerdorf, the creator of PHP. He talks about not trusting user input, and the brokenness of IE, which is all fine. Then he makes a statement about MySQL vs PostgreSQL: 'If you can fit your problem into what MySQL can handle it's very fast,' Lerdorf said. 'You can gain quite a bit of performance.' For the items that MySQL doesn't handle as well as PostgreSQL, Lerdorf noted that some features can be emulated in PHP itself, and you still end up with a net performance boost. Naturally, the PostgreSQL community is rather unimpressed. One of the more amusing replies: 'I wasn't able to find anything the article worth discussing. If you give up A, C, I, and D, of course you get better performance- just like you can get better performance from a wheel-less Yugo if you slide it down a luge track.'"

527 comments

  1. I love my Yugo luge commute by Anonymous Coward · · Score: 4, Funny

    It's very fast and I haven't been killed yet.

    1. Re:I love my Yugo luge commute by Simap · · Score: 1
      If you give up A, C, I, and D, of course you get better performance- just like you can get better performance from a wheel-less Yugo if you slide it down a luge track.

      I think that a 4 wheeled Yugo that isn't sliding down a luge track to be the best analogy to PostgreSQL's performance I've ever heard!
      I've never seen PostgreSQL perform, ever. Thats not to say that it can't or doesn't (perhaps when thrown down a luge track, memcached anyone?). ACID is worthless when you have to restrict how much data you process so that the DB doesn't choke.
    2. Re:I love my Yugo luge commute by Rob+T+Firefly · · Score: 3, Funny

      The luge isn't something you just dump Yugos on, it's a series of tubes!

    3. Re:I love my Yugo luge commute by LurkerXXX · · Score: 3, Insightful

      Your data is pretty worthless if you can't be bothered with ACID complience to make sure it is consistant.

    4. Re:I love my Yugo luge commute by RevDobbs · · Score: 1, Flamebait

      ACID is wothless when your data is worthless. Following Sturgeon's Revelation, mySQL is perfect for most web use.

      But if you're using a dbms for an actual application -- web-based or not -- you (more than likely) need the data integrity that ACID stives to provide.

    5. Re:I love my Yugo luge commute by antv · · Score: 1

      I've never seen PostgreSQL perform, ever.

      Yes, you did, when you hit Slashdot or any .org site: the root name server for .org domain is using PostgreSQL. Postgres needs some knowledge to set it up properly, but it certainly could perform very well.

      --
      Obama 2012: our incompetent asshole is slightly less of an incompetent asshole than the other incompetent asshole !
    6. Re:I love my Yugo luge commute by nocomment · · Score: 2, Interesting

      I have. I built a 'Do Not Call' DB server to house 2 do not call lists for a telemarketer. A simple php interface. It searches through something like 10 million records in a fraction of a second. You don't even have your finger lifted off the mouse button and you already know the circumstances surrounding that phone number. Whether it's one they can call if a prior business relationship exists, if the number is free and open to annoy during dinner, or whether they cannot call under any circumstances whatsoever. The sucker flies. It's running on 900Mhz AMD Duron, 256M RAM, Generic IDE HD, running OpenBSD, and Postgresql.

      --
      /* oops I accidentally made a comment, sorry */
      /* http://allyourbasearebelongto.us */
    7. Re:I love my Yugo luge commute by beckerist · · Score: 2, Funny

      Give up Acid and your whole world becomes quite clear! Just ask the '70's!

    8. Re:I love my Yugo luge commute by WuphonsReach · · Score: 1

      I love my Yugo luge commute

      I see that someone else also reads the PostgreSQL mailing lists. Of course, the prevailing consensus over there was that it wasn't worth discussing in the [general] list.

      --
      Wolde you bothe eate your cake, and have your cake?
    9. Re:I love my Yugo luge commute by Overloadplanetunreal · · Score: 1

      Actually, he just read the article summary.

    10. Re:I love my Yugo luge commute by ajs · · Score: 4, Informative
      Your data is pretty worthless if you can't be bothered with ACID complience to make sure it is consistant.

      For the last 10 years, MySQL data has been atomic across single transactions.

      For the last 5 years, MySQL data has been atomic across transactions.

      For the last 2-3 years, MySQL has supported the full gammut of ACID features.

      Can we PLEASE stop beating this particular dead horse?

      The MySQL 5.0 FAQ

      MySQL still lacks many of the high-level features of databases like Oracle, and for that many of us, the USERS of MySQL are generally greatful.
    11. Re:I love my Yugo luge commute by LurkerXXX · · Score: 2, Informative
      For the last 2-3 years, MySQL has supported the full gammut of ACID features.

      Can we PLEASE stop beating this particular dead horse?

      First off, the grandparent implied ACID was worthless. Not me.

      When some idiot MySQL fanboy says ACID is worthless, I'm going to make sure anyone new to databases who reads the thread learns the truth.

      Secondly, MySQL fanboys keep talking about how great it is at speed, and the only way modern MySQL is significantly faster than modern Postgres is when you use the non ACID compliant MyISAM. InnoDB and strict mode slow MySQL down so that it's no faster than Postgres or other 'real' relational databases. (With a real relattional database 'strict' isn't an option. It's a mandatory part of being a real relational database.) Plus with Postgres you get real modern high-level database features.

      So to answer your question. NO. It's not dead yet.

    12. Re:I love my Yugo luge commute by Simap · · Score: 1

      Your data is pretty worthless if you can't be bothered with ACID complience to make sure it is consistant.


      You don't need a fully ACID compliant DB to guarantee consistent data. It depends on what your data looks like, and what you can get away with. Throwing ACID at everything isn't going to solve your problems if you don't take failure into account in your design. If you do take it into account, then you know what parts of ACID you need.

      For instance, in MySQL's MyISAM, any single update or insert is attomic. If thats all you need to do, then you already have the A in ACID. If you can fit your updates into a single query, your data will be consistent even if your app crashes. The update is attomic, therefore it is isolated. MyISAM tables are already durable.

      MyISAMs are perfect for read mostly tables, especially ones where you need to perform ad-hoc queries on that can't be efficiently cached.
    13. Re:I love my Yugo luge commute by Simap · · Score: 1
      ACID is wothless when your data is worthless. Following Sturgeon's Revelation, mySQL is perfect for most web use.
      The inverse of that isn't necessarily true however.
      But if you're using a dbms for an actual application -- web-based or not -- you (more than likely) need the data integrity that ACID stives to provide.
      Couldn't agree more. Any application, web or not, requires data integrity. ACID does strive to provide this, I totally agree. However, data integrity and ACID are not the same thing, even though they are often treated like it. There is more than one way to skin a cat, and many more ways of ensuring data integrity.
      For me, its about saving me time while accomplishing the same task. If I can ensure data integrity and have a DB that is an order of magnitude faster than PostgreSQL at the same time, then I just saved the time and resources needed to scale out PostgreSQL.
    14. Re:I love my Yugo luge commute by Simap · · Score: 1

      And how many users were actively using this system at any given time?

      I don't want to slam your project, it sounds very nice, but given that your telemarketer client is too small to need some kind of predialer (they actually look each number up manually?), I'm going to assume its something like 20-50 hits a minute. Thats not exactly proof of performance.

    15. Re:I love my Yugo luge commute by Esteanil · · Score: 1
      If the replacement horse had worked properly, yeah, maybe. But MySQL falls back to dropping reference integrity unless you do a ton of index magic, and it drops transactions implictly when you use locks, and the transaction support in general seems like a bolt on that people do not use.

      Oh, and it would be nice if subselects worked properly, too. Not sort of pseudo worked, except for half the time when you have to create a temp table because of some weird restriction saying that you can't reference the same table in a sub and main select.

      --
      I'm a dreamer, the world is my playpen. But hey, I'm a serious person, I can't dream all the time.
    16. Re:I love my Yugo luge commute by irc.goatse.cx+troll · · Score: 1

      I actually slightly disagree - I think mySQL is adequet for what most web people use it for, but I would say its overkill/not perfect. SQLite does a much better job for what most people use mysql for (blogs and other simple webapps, anything that doesnt need multiple users with different permissions messing with the tables at the same time). Its downright silly to have to run two large daemons (apache + mysql) and configure them both just to set up something simple like wordpress.

      SQLite gives you all* the power of SQL in something as simple as a single .db file. I highly recommend every check it out, its public domain so you can do whatever you want with it and embed it into your packages without worrying about license conflicts. It also makes it very simple to move a page around or create full backups as everything goes nicely into the same tarball.

      Only downside is for most people they will need their sysadmin to manually edit the php configs and compile a module seperately to get it working, but thats a php fault, not SQLite. You're fine if you use perl or whatever else. I think the next version of php is shipping with sqlite out of the box too.

      *k, technically not "all", but certainly all that most webapps would use.

      --
      Pain lasts, kid. Its how you know you're alive. Sometimes I think this growing up thing is just pain management-TheMaxx
    17. Re:I love my Yugo luge commute by nocomment · · Score: 1

      they do have a predialer. but it's too old, and no longer compliant with new laws, and they didn't (or couldn't, i'm not sure) wamt to upgrade. I dont know that many details as for hit/min, i'm not sure I only know that it's big enough that 2 callcenters in 2 states use it.

      I do also use postgres on my wifes website. It had 10.5k hits yesterday, and didn't slow down a bit, if thats helpful for you.

      --
      /* oops I accidentally made a comment, sorry */
      /* http://allyourbasearebelongto.us */
    18. Re:I love my Yugo luge commute by Anonymous Coward · · Score: 0

      Unless you've utterly denormalized your data and crammed it all into a single table, atomic INSERT isn't going to prevent other clients from seeing half-finished changes. MyISAM is only appropriate for a single user (and a single thread) or for tables that are completely (not mostly) read only. Devs who become aware of the problem usually panic and resort to locking everything or adding flags that mean "ignore this record, in a real database it wouldn't exist".

    19. Re:I love my Yugo luge commute by mw · · Score: 1

      MySQL data has never been atomic - and never will be - if you're using MyISAM. Try a big update and while it's running kill -9 all mysqld processes. Your data is now half updated, congratulations.

    20. Re:I love my Yugo luge commute by ajs · · Score: 1

      Obviously, that first sentence should have ended with, "across single statements." I'm surprised that no one called me on the fact that MySQL has not had transactions for 10 years. Perhaps everyone just got what I meant from context...?

    21. Re:I love my Yugo luge commute by Anonymous Coward · · Score: 0

      So use InnoDB tables instead of MyISAM. Idiot.
       
      Next you'll be complaining that cake tastes bad if you use nails instead of flour.

    22. Re:I love my Yugo luge commute by WgT2 · · Score: 1

      MyISAM tables are already durable.

      I suppose that's a fine statement until work in a webhosting environment long enough for you to have to rebuild the tables for a website whether the server was powered down, purposefully or otherwise, or MySQL corrupted itself for no apparent reason.

      In the end: hopefully the client had proper backups.

    23. Re:I love my Yugo luge commute by Simap · · Score: 1

      It sounds like you have a buggy version. I use MyISAM tables whenever I can get away with it, which happens to be most of the time and I can count on one hand the number of times I've had a problem with the MySQL server itself, and each was an easy fix.
      How long is long enough?
      <shameless self promotion> I've been building and supporting enterprise class web applications since early 2001 (and other web stuff going back to 95). Most of the stuff I build is hosted at a colo or sold and redistributed to enterprise customers. Some of my MySQL based products are certified and resold by Cisco (hopefully that doesn't scare you ;-) </shameless self promotion>
      I've used MS SQL server, PostgreSQL and MySQL but I prefer MySQL for speed, ease of use, and development time. I do thoroughly test each release that I use, but I do the same for any other software I use (open source or otherwise).

    24. Re:I love my Yugo luge commute by WgT2 · · Score: 1

      Your "shameless self promotion" in nowise scares me because the experience I have had with multiple, that is to say, literally thousands of installations of MySQL does not change because of your experience.

  2. Avoid databases... by DreddUK · · Score: 5, Funny

    Honestly, just avoid this discussion by using flat files.

    --
    "If A equals success, then the formua is A=X+Y+Z. X is work. Y is play. Z is keep your mouth shut" - A Einstein.
    1. Re:Avoid databases... by networkBoy · · Score: 0, Redundant

      This is why I love flame wars right here:

      "of course you get better performance- just like you can get better performance from a wheel-less Yugo if you slide it down a luge track."
      -nB

      --
      whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
    2. Re:Avoid databases... by neonprimetime · · Score: 1

      That's just nonsense! Oh, sorry, didn't see the Sarcasm tags.

    3. Re:Avoid databases... by beavt8r · · Score: 1

      And we could have somebody there interpreting the raw requests and serving them up himself!! That way we could do exactly what we wanted!! -Register, huh? Let me get my pencil...

    4. Re:Avoid databases... by spun · · Score: 5, Funny

      You kids and your fancy flat files. Back in my day, we kept our data in huge honking boxes of punchcards, and we were grateful!

      --
      - None can love freedom heartily, but good men; the rest love not freedom, but license. -- John Milton
    5. Re:Avoid databases... by LWATCDR · · Score: 1

      Actually that isn't as dumb as you might think.
      MySQL is often used some would say abused for things that a flat file would be just fine for.
      Last time I did look MySQL and Postgres where very close in speed. I use Postgres for a lot of in house work but I use MySql for a lot of web work. Most of the CMS packages I see out there have better support for MySQL then Postgres. The program I use I wrote for in house use does a lot of transactions which MySQL didn't support at the time.
      Postgres is a better database but it is possible that for some tasks MySQL is better. A multiaxis cnc machine is a great tool but you wouldn't want to dig a ditch with it.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    6. Re:Avoid databases... by $RANDOMLUSER · · Score: 5, Funny

      You had boxes?

      --
      No folly is more costly than the folly of intolerant idealism. - Winston Churchill
    7. Re:Avoid databases... by beavt8r · · Score: 5, Funny

      We were supposed to keep that stuff?

    8. Re:Avoid databases... by Vraylle · · Score: 4, Funny

      Why, we used to DREAM of boxes and punchcards! In MY day we had to line up large stones into neat rows to represent binary. On a steep slope. In the middle of an earthquake. In Antarctica.

      --
      Mutant Freaks of Nature: "Frighteningly Addictive"
    9. Re:Avoid databases... by neonprimetime · · Score: 1

      Which Antarctica Earthquake was it? 1952, 1974, or 1985? Each of which were quite wimpy.

    10. Re:Avoid databases... by drinkypoo · · Score: 1

      Yeah I run drupal and the postgresql support is pathetic, most modules are written for mysql so postgres isn't really a valid option if you want to run many of them. Hence, mysql.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    11. Re:Avoid databases... by dextromulous · · Score: 5, Funny

      You had binary? We had to get about with only zeros, and some days we didn't even have those!

      --
      There are two types of people in the world: those who divide people into two types and those who don't.
    12. Re:Avoid databases... by MikeBabcock · · Score: 1

      For one thing, a lot of people are designing database schemas (for MySQL and Postgres alike) that have no business doing so. Their designs are bad and no amount of intelligent RDBMS will fix that.

      To give credit where credit is due however, many of those people are just using MySQL or Postgres or another SQL database system for upward mobility. They write a small tracking program for their music collection and it becomes unwiedly so they move to MySQL for storage. Would it work in a BDB or CDB format instead? Probably a lot faster to be honest, but SQL is a nice query language even if its serious overkill for tracking one person's CDs.

      PS, no I don't care if you own thousands of CDs -- go look up DJB's constant database format.

      --
      - Michael T. Babcock (Yes, I blog)
    13. Re:Avoid databases... by Anonymous Coward · · Score: 3, Interesting

      PostgreSQL actually did used to be slower in most basic operations than MySQL. This was largely because MySQL used to lack some of the most basic things that make a DBMS relational (for example, for quite a long time there was no ACID compliance at all) whereas Postgres had them right from the start, but they weren't terribly efficient. As MySQL started trying to patch itself up into something a competent DBA wouldn't burst into flames over, PostgreSQL patched itself up to improve performance. The result was that they both basically got to the point where they were similar in features and performance.

      The question you have to ask, I suppose, is this:

      Would you prefer to have the patchwork system that made itself into a DBMS at some point after it's wide adoption, or the one that started out a relatively proper system and then just tweaked things to get performance gains?

      I'm not going to begrudge the MySQL people their choice, but I'll stick with PostgreSQL and MS-SQL instead, thanks. I remember MySQL's orginal state, and my distrust for its ability and the competency with which it was initially built still runs pretty deep.

      Regarding PHP: it's okay for moderate tasks and I use it, but I only use it because nobody else who's likely to maintain my code in the future seems to know any actual useful programming languages. If I thought I could trust future programmers to be reasonably competent with actual programming constructs (instead of just being trained to rely on the language to provide a function for every possibly thing you might need to do), I'd build everything in mod_perl with CGI::Application and a template framework instead.

      And if you think I'm a database and language elitist, you might want to reconsider your position: am I an elitist, or are you (not the OP, you the reader) just poorly informed about the underlying concepts of these two things?

    14. Re:Avoid databases... by rk · · Score: 5, Funny

      We only had ones because the zeros were too fat to fit through our tiny wires.

    15. Re:Avoid databases... by partenon · · Score: 1

      Or even better! We can replace those stupid humand by really smart pigeons, just like google!

      --
      ilex paraguariensis for all
    16. Re:Avoid databases... by chris_mahan · · Score: 1

      We still have a bunch of zeros here...

      --

      "Piter, too, is dead."

    17. Re:Avoid databases... by AceCaseOR · · Score: 1

      1242 of course! Slept right through the '52, '74, '85 quakes.

      --
      Zagreus sits inside your head, Zagreus lives among the dead, Zagreus sees you in your bed and eats you in your sleep.
    18. Re:Avoid databases... by Anonymous Coward · · Score: 0

      You had PUNCH CARDS!? Back in my day, we carved our data onto stone tablets!

    19. Re:Avoid databases... by hullabalucination · · Score: 2, Funny

      huge honking boxes of punchcards

      We had punchcards but we didn't have keypunch machines. We had to take X-Acto knives and cut out perfect little tiny rectangles from each card by hand. Putting a simple 100-line program on cards could take over a year. I started my first programming class (Fortran 101) in 1974 and I'm on schedule to finish it next year. My first TA passed away seven years ago from old age.

      * * * * *

      Do not compute the totality of your poultry population until all the manifestations of incubation have been entirely completed.
      --William Jennings Bryan

    20. Re:Avoid databases... by DragonWriter · · Score: 4, Insightful
      Would you prefer to have the patchwork system that made itself into a DBMS at some point after it's wide adoption, or the one that started out a relatively proper system and then just tweaked things to get performance gains?


      Personally, I don't care what it used to be, I care what it is now. And, even if I did, I don't see how either course you describe is worse than the other. They are different development models, and depending on your needs the products will have very different advantages and disadvantages before they converge to both being relatively feature-complete and efficient, but generally neither is worse or better.



      Regarding PHP: it's okay for moderate tasks and I use it, but I only use it because nobody else who's likely to maintain my code in the future seems to know any actual useful programming languages.


      If you use it, and it works, and you have people that are more productive maintaining it than some other languages, it is, ipso facto, an "actual useful programming language".



      Now, it might lack features that you would find ideal in a perfect world where everyone shared your background and tastes, but that doesn't stop it from being actually useful.



      And if you think I'm a database and language elitist, you might want to reconsider your position: am I an elitist, or are you (not the OP, you the reader) just poorly informed about the underlying concepts of these two things?


      I've reconsidered. I still think you seem to be an insecure language and database elitist with a strong need to feel superior to everyone whose preferences differ from yours, and a deep resentment that your favored tools aren't always the most popular.


    21. Re:Avoid databases... by dextromulous · · Score: 1

      At least you have french and english zeros. :-D

      --
      There are two types of people in the world: those who divide people into two types and those who don't.
    22. Re:Avoid databases... by rocjoe71 · · Score: 5, Funny
      You had paper? We recorded everything on slabs of rock.

      ...When the system crashed, you knew it crashed. That's how we lost Ug, we really miss Ug.

      --
      Height: 38U, Weight: 0 Newtons, Eyes: #0000FF, OS: Gray Matter 1.0 (Alpha)
    23. Re:Avoid databases... by plague3106 · · Score: 1

      And like flat files, you should only use MySql for data you don't care about.

    24. Re:Avoid databases... by I+Like+Pudding · · Score: 5, Funny

      Pfft. I was a sysadmin for the Tower of Babel. When that thing divided by zero, man, nobody could even talk anymore.

    25. Re:Avoid databases... by chris_mahan · · Score: 1

      Indeed! I use French zeros and English zeros. How do I tell them apart? They're pronounced differently :)

      --

      "Piter, too, is dead."

    26. Re:Avoid databases... by paranode · · Score: 5, Funny

      You had stuff?

    27. Re:Avoid databases... by mpcooke3 · · Score: 1

      Or go ahead use MYSQL, it amounts to pretty much the same thing ;)

    28. Re:Avoid databases... by LWATCDR · · Score: 1

      You just named the main reason I am sticking with MySQl for web work. That and Moodle.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    29. Re:Avoid databases... by Dirtside · · Score: 1
      We had to take X-Acto knives and cut out perfect little tiny rectangles from each card by hand.

      Hands? Luxury!
      --
      "Destroy science and religion. Science would re-emerge exactly the same; but not religion." - Penn Jillette, paraphrased
    30. Re:Avoid databases... by operagost · · Score: 1
      Would you prefer to have the patchwork system that made itself into a DBMS at some point after it's wide adoption, or the one that started out a relatively proper system and then just tweaked things to get performance gains?
      Why are new features considered "patchwork", while performance enhancements are considered "tweaks"?
      --

      Gamingmuseum.com: Give your 3D accelerator a rest.
    31. Re:Avoid databases... by otis+wildflower · · Score: 1

      Wires??

      You were LUCKY!

      We only had a series of TUBES! And not big nice ones either, just small leaky ones fit for infrequently-utilized urinal duty!

      And it was in a LAKE!

    32. Re:Avoid databases... by Anonymous Coward · · Score: 0

      There was light?

    33. Re:Avoid databases... by jrockway · · Score: 1

      > This was largely because MySQL used to lack some of the most basic things that make a DBMS relational (for example, for quite a long time there was no ACID compliance at all)

      Uh, ACID doesn't make a database "relational", being able to JOIN does. ACID is a feature that you expect to have in a RDBMS, but they have nothing to do with relation.

      Also, you can have a database without relations, or a relational database without a database management system (i.e., Berkeley, and yes, it's ACIDic).

      --
      My other car is first.
    34. Re:Avoid databases... by TheLetterPsy · · Score: 4, Funny

      You had?

    35. Re:Avoid databases... by CDarklock · · Score: 2

      This is a very good point to consider.

      Let's take the old adage "good, fast, cheap: pick two", and use that as our basis.

      Both PostgreSQL and MySQL chose cheap. PostgreSQL then chose good, while MySQL chose fast.

      Which approach is better? It's hard to say, but FAST benefits everyone, while GOOD benefits only the elite.

      From a pure business perspective, the choice to be fast was of greater benefit to more users, and hence should have been higher priority.

      --
      Microsoft cheerleader, blue flag waving, you got a problem with that?
    36. Re:Avoid databases... by Anonymous Coward · · Score: 5, Funny

      Back in my day, we no fancy verbs! And we it!

    37. Re:Avoid databases... by shark72 · · Score: 1

      You had zeros? We had to use the letter "O".

      --
      Sitting in my day care, the art is decopainted.
    38. Re:Avoid databases... by Anonymous Coward · · Score: 2, Insightful

      Nah, you're just too insecure to admit that there are actually ways to rank the functionality of these things. MySQL is good specifically in situations where you're going to do a lot of simple transactions on fairly simple data. That it's superior in that one, very narrow, situation, however, does not make it superior as an RDBMS or even equal to other software in the category.

      Likewise: PHP. PHP is an inferior programming language and that's that. It's good at RAD and it has a very gentle learning curve. That's it. That's all it's good at. Perl is a better language. C is a better language yet. That PHP is good in one narrow field does not make it superior or even equal in its category.

      It's really not that complicated of a concept. If you have two quarterbacks and one can throw the ball 75 yards consistently but can rarely get the ball anywhere near his receiver beyond five yards, he's very good at doing one particular thing, but he's still an inferior quarterback. That you get him out when you need an undirected hail mary does not make him an equal to the guy that carried the rest of the game.

      Contrary to what some people would like to believe, not everything is equal just because it does certain things well that other products do on a more average scale.

    39. Re:Avoid databases... by jalefkowit · · Score: 3, Interesting

      Amazingly this actually seems to be the approach lots of "Web 2.0" companies are taking. See Tim O'Reilly's database war stories series for details.

      Some quotes from that series:

      • Gabe Rivera of Memeorandum.com: "I didn't bother with databases because I didn't need the added complexity... I maintain the full text and metadata for thousands of articles and blog posts in core. Tech.memeorandum occupies about 600M of core. Not huge." [full story]
      • Mark Fletcher of Bloglines: "[T]raditional database systems were not appropriate (or at least the best fit) for large parts of our system." [full story]
      • Greg Linden of Findory: "We make thousands of random accesses to this read-only data on each page serve; Berkeley DB offers the performance necessary to be able to still serve our personalized pages rapidly under this load." [full story]

      The "databases cause more problems than they solve" sentiment was so pronounced in O'Reilly's interviews that he took the question to Brian Aker of MySQL for rebuttal, but ended up concluding that

      I didn't hear that flat files don't scale. What I heard is that some very big sites are saying that traditional databases don't scale, and that the evolution isn't from flat files to SQL databases, but from flat files to sophisticated custom file systems. Brian acknowledges that SQL vendors haven't solved the problem, but doesn't seem to think that anyone else has either.
    40. Re:Avoid databases... by stonecypher · · Score: 1

      We had to punch the holes with teeth pulled from passing dogs.

      --
      StoneCypher is Full of BS
    41. Re:Avoid databases... by Paradise+Pete · · Score: 1
      You had boxes?

      Not only boxes, but boxes that honked. Talk about living the life of Riley!

    42. Re:Avoid databases... by Anonymous Coward · · Score: 0

      TUBES?
      Back in my days, we used TRUCKS! And we had none of these fancy "engines", either! We pulled them uphill, both ways, and we loved it!

    43. Re:Avoid databases... by Thuktun · · Score: 1

      *Tiny* wires? Everyone knows that in the Good Ole Days, wires were larger.

      That's why lower-numbered wire gauges are larger, they came first!

    44. Re:Avoid databases... by DragonWriter · · Score: 3, Interesting
      Nah, you're just too insecure to admit that there are actually ways to rank the functionality of these things.


      No, I've admitted that, several times, in this thread.

      There are many ways to rank the functionality of things, not one correct way.

      MySQL is good specifically in situations where you're going to do a lot of simple transactions on fairly simple data.


      Which is, in fact, what a lot of web applications on LAMP infrastructure do.

      That it's superior in that one, very narrow, situation, however, does not make it superior as an RDBMS


      "Superior as an RDBMS" is mostly a meaningless, or at least equivocal and ambiguous, category.

      or even equal to other software in the category.


      Sure, in the sense that "different" is not "equal".

      Likewise: PHP. PHP is an inferior programming language and that's that.


      "Inferior programming language" is meaningless.

      It's good at RAD and it has a very gentle learning curve.


      And, in that, it is superior to languages that lack those features for uses where those are key features. Making it not unqualifiedly an "inferior programming language". Its like saying "A hammer is an inferior tool. It's good at driving nails, and that's it."

      Perl is a better language. C is a better language yet.


      There are certainly things for which C is better than Perl, and certainly there are things for which Perl is better than C. Your standard for saying that C is in some trascendent, unqualified sense "better...yet" compared to Perl is...what?

      That PHP is good in one narrow field does not make it superior or even equal in its category.


      True, again, because "superior" in the nonspecific sense you are using it is meaningless and, therefore, nothing could make anything superior in that sense.

      It's really not that complicated of a concept.


      It isn't a matter of complicated. It is a matter of wrong.

      If you have two quarterbacks and one can throw the ball 75 yards consistently but can rarely get the ball anywhere near his receiver beyond five yards, he's very good at doing one particular thing, but he's still an inferior quarterback.


      Really? If the other one can consistently hit a receiver out to 80 yards, but almost always fumbles the snap, I'm not sure if I could agree that the one you describe is "still an inferior quarterback": you can't label something inferior to something else when you describe the features of only one of the two things being compared. Further, the function of a quarterback on a football team is much more narrowly defined than that of a programming language or data storage solution, so it makes a lot more sense to talk about an inferior quarterback than an inferior programming language or datastore, without reference to a use for the latter.

      Contrary to what some people would like to believe, not everything is equal just because it does certain things well that other products do on a more average scale.


      I don't know what "some people" you are talking about, but I've never said "everything is equal". I would say that ranking tools without reference to application is generally meaningless except in the narrow case where the ranking holds without exception for all conceivable, or at least realistic, tasks.
    45. Re:Avoid databases... by Christopher+B.+Brown · · Score: 1
      Back in the day, what really happened was that MySQL chose simple. In some cases, that happened to be faster.

      PostgreSQL has been getting pretty steadily faster; MySQL has been steadily adding additional database engines. The paucity of published benchmarks suggests that the latter probably hasn't helped performance; the confusion that results from having too many subtly incompatible features to choose from doesn't suggest that it's getting "better" terribly quickly.

      --
      If you're not part of the solution, you're part of the precipitate.
    46. Re:Avoid databases... by tzanger · · Score: 1

      Which approach is better? It's hard to say, but FAST benefits everyone, while GOOD benefits only the elite.

      Nonsense. Total, utter nonsense.

      What good is fast if you put in "ooga" and get back "3*(~..!`" ? Or worse, what good is fast if you put in known good data and get back corrupted-but-still-appears-to-be-good data?

      No, sir, FAST does not benefit anyone but the speed freaks that don't give a shit for data integrity, or who feel that taking the system down to restore from backup is a valid option to data corruption. I'll stick with throwing more hardware at it and staying in a far more comfortable position of knowing my database is not only enforcing the constraints I place on the data going in, but can also retrieve the information exactly as it went in. I don't trust any DB that takes artistic license with my data.

    47. Re:Avoid databases... by Nutria · · Score: 0
      Personally, I don't care what it used to be, I care what it is now. And, even if I did, I don't see how either course you describe is worse than the other. They are different development models, and depending on your needs the products will have very different advantages and disadvantages before they converge to both being relatively feature-complete and efficient, but generally neither is worse or better.

      • Choice A) Speed demon that has had bits and pieces of ACID ad-hockery bolted on here and there, and still lets you insert bad data without a warning.
      • Choice B) ACID-compliant system that has been, piece by piece, rearchitected for speed while retaining ACID as the prime, unshakeable goal.

      I'll take Choice B, PostgresQL, thank you very much, because I don't trust the developer to take care of my data...

      --
      "I don't know, therefore Aliens" Wafflebox1
    48. Re:Avoid databases... by mjjw · · Score: 1
      You had wires?

      We had to mark everything down in potato print, tie it to the back of a dog and hope it got there!

      Wait a minute I think we called that system dial-up.

      --
      If you aren't far left by the age of 18 you have no heart. If you aren't far right by 30 you have no brain.
    49. Re:Avoid databases... by Dix_sw · · Score: 1

      You where lucky, We could only afford one '1'. And it was enough for us!

      --
      "So, once you know what the question actually is, you'll know what the answer means."
    50. Re:Avoid databases... by roman_mir · · Score: 1

      Back in the days there was no self awareness, all those fancy 'you', 'I', 'he/she' weren't applicable.

    51. Re:Avoid databases... by crawling_chaos · · Score: 5, Funny

      Just be glad that you missed the 40 day and night core dump. Boostrapping a planet takes forever and they hadn't invented overtime yet.

      --
      You can only drink 30 or 40 glasses of beer a day, no matter how rich you are.
      -- Colonel Adolphus Busch
    52. Re:Avoid databases... by Gnavpot · · Score: 1
      We only had ones because the zeros were too fat to fit through our tiny wires.
      You had ones? We had to write all our code using the letter "l".
    53. Re:Avoid databases... by Polarism · · Score: 1

      If you had tubes it would've been the opposite problem.

      --
      All your base are belong to Google.
    54. Re:Avoid databases... by Anonymous Coward · · Score: 0

      "They are different development models..."

      The main reason I use Postgres rather than MySQL is that Postgres is covered by the LGPL while MySQL is covered by the GPL (unless you pay for a license). I only write in-house code at the moment, so it's not a big difference in practice...and it's their right to choose which terms they want. But, other things being similar, I'd rather go with LGPL packages.

    55. Re:Avoid databases... by Gorshkov · · Score: 3, Funny

      And the lord said, "Let there be light!" And Moses, who was the chief electrician at the time, pulled the switch, blew the fuse, and fucked up the entire miriacle ........

    56. Re:Avoid databases... by Anonymous Coward · · Score: 0

      Postgres lacks a native, integrated, built-in replication engine. Replication was a hacked on afterthought for postgres, whereas it was in there from the start for mysql. Why do I use mysql for real world applications? I required replication and didn't like the add-on hack postgres uses.

    57. Re:Avoid databases... by paranode · · Score: 5, Funny

      You it?

      Maybe this too far...

    58. Re:Avoid databases... by paranode · · Score: 2, Funny

      Pssh, overtime? Try creating the whole thing in seven days and not getting paid!

    59. Re:Avoid databases... by Anonymous Coward · · Score: 0

      They aren't wires they are tubes. Didn't you listen to cave leaders?

    60. Re:Avoid databases... by nocomment · · Score: 4, Funny

      40 days would have been a vacation for us. We had to muck about for 40 years just trying to get the rain server going. For years it just rained bread, and the Manna pages were completely useless.

      --
      /* oops I accidentally made a comment, sorry */
      /* http://allyourbasearebelongto.us */
    61. Re:Avoid databases... by Fulcrum+of+Evil · · Score: 1

      Because the new features change the basic design, which didn't care about ACID, while performance changes should do the same stuff, only faster.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    62. Re:Avoid databases... by Anonymous Coward · · Score: 0

      You had ones? We had to use lower case L's!

    63. Re:Avoid databases... by BigTunaCan · · Score: 0

      The really sad part is that it is mostly the PHP developers that hold on to this belief that MySQL is something other than a flying piece of crap that utterly disregards data integrity. It is no wonder that the developer of a piece of shit like PHP would think that an equally stinking pile like MySQL is superior.

    64. Re:Avoid databases... by killjoe · · Score: 1

      Postgres is great but it's replication and clustering are so far behind mysql it's not even funny. The reason people use mysql are because mysql jumped on replication early on and gave people a usable (if not transactionally correct) replication that anybody could set up in five minutes.

      As for MS-SQL I try to avoid it like the plague. I can't stand the damned thing. I want to personaly choke to death every programmer who ever wrote an error message for ms-sql. Besides it only runs on windows. It's only database that I know of that only runs in windows.

      --
      evil is as evil does
    65. Re:Avoid databases... by Bugs42 · · Score: 1

      At which point Moses, being a hardware guy, blamed it all on the software.

      --
      Programmer: an ingenious device that converts caffeine into code.
    66. Re:Avoid databases... by Agripa · · Score: 1

      We only had ones because the zeros were too fat to fit through our tiny wires.

      You were lucky. We had fat wires but someone didn't screw a terminator down completely on our thinnet and all of our ones leaked out onto the floor. Before we found out, an intern sold them to someone who only had tiny wires . . .

    67. Re:Avoid databases... by Bastian · · Score: 1

      Back in day, no fancy pronouns! And!

    68. Re:Avoid databases... by Bastian · · Score: 1

      You lucky bastard. I used to have to make do with the empty set. We didn't even have successor sets back then!

    69. Re:Avoid databases... by Bush+Pig · · Score: 1

      All he needed was a 4000 Amp slo-blo fuse (4" nail) ...

      --
      What a long, strange trip it's been.
    70. Re:Avoid databases... by putaro · · Score: 1

      In Soviet Russia, verbs fancy you!

    71. Re:Avoid databases... by Master+of+Transhuman · · Score: 1


      Back in the day, you were all chimpanzees...

      Oh, wait: s/Back in the day//

      --
      Richard Steven Hack - This sig is TOO GODDAMN SHORT TO DO ANYTHING USEFUL WITH! MORONS!
    72. Re:Avoid databases... by Master+of+Transhuman · · Score: 1


      No, you didn't lose Ug - he's President now...

      And he's STILL crashing things...

      --
      Richard Steven Hack - This sig is TOO GODDAMN SHORT TO DO ANYTHING USEFUL WITH! MORONS!
    73. Re:Avoid databases... by LurkerXXX · · Score: 1
      Which approach is better? It's hard to say, but FAST benefits everyone, while GOOD benefits only the elite.



      It's 'elite' to want to get back the same data you entered? You've got a real strange definition of elite.

      Silent corruption of the data is great as long as it's fast eh? Brilliant.

    74. Re:Avoid databases... by LurkerXXX · · Score: 1

      ACID keeps the relationships relevant. If it isn't ACID compliant, you can get corruption from bad transactions. What good are relationships if they are the wrong ones?

    75. Re:Avoid databases... by innosent · · Score: 1

      Actually, he buys houses. See http://www.ugbuysuglyhouses.com and note the mascot.

      --
      --That's the point of being root, you can do anything you want, even if it's stupid.
    76. Re:Avoid databases... by Tablizer · · Score: 1


      Regarding PHP: it's okay for moderate tasks and I use it, but I only use it because nobody else who's likely to maintain my code in the future seems to know any actual useful programming languages.

      Please don't say "Java". It takes roughly 3 times more code to do the same thing with Java as PHP. How can it help maintenance if it takes 3 times longer to read the code and the HelloWorldWriterFactoryDecoratorManager classes.

    77. Re:Avoid databases... by Anonymous Coward · · Score: 0

      What good are relationships if they are the wrong ones?

      Winner for this year's Best Line To Use When Dumping a DBA contest.

    78. Re:Avoid databases... by MZoom · · Score: 1

      You did it in seven days? Pfft. Try doing it in six days leaving the seventh day for rest.

      --
      Integrity is what you are when nobody is looking.
    79. Re:Avoid databases... by Anonymous Coward · · Score: 0
      Postgres is great but it's replication and clustering are so far behind mysql it's not even funny.

      I notice a chuckle every now and then, so maybe they're getting closer.

    80. Re:Avoid databases... by Anonymous Coward · · Score: 0

      You?

    81. Re:Avoid databases... by tpv · · Score: 1
      Yeah, but your system got corrupted by the first users.

      It's not professional to build a system and then tell the users "But don't touch this, or it will all crash".

      --
      Read more of this story at Slashdot.Read more of this story at Slashdot.Read more of this story at Slashdot.
    82. Re:Avoid databases... by Money+for+Nothin' · · Score: 1

      Silent corruption of the data is great as long as it's fast eh? Brilliant.

      No kidding. One of the rules developers follow (in the real world, at least) is to "make it work, then make it fast" -- which is to say, accuracy comes before speed. Write code that doesn't destroy data first, then refactor and tighten it up. PostgreSQL wisely took this approach...
    83. Re:Avoid databases... by Anonymous Coward · · Score: 0

      "Error: invalid data" is simpler than "we're going to make up a value of the correct type that's kinda like what we think you wanted and pretend you specified that instead".

      "Error: 'BEGIN TRANSACTION' not supported" is simpler than "we're going to add that statement to our grammar but may or may not ignore it without telling you depending on the runtime state of the database".

      "Error: 'LOCK TABLE' before 'UPDATE'" is simpler than "we're going to extend the grammar of the UPDATE (but not INSERT) statement for a non-ANSI form that allows multiple tables, and we'll figure out which values go into each table for you".

    84. Re:Avoid databases... by Anonymous Coward · · Score: 0

      We had to punch the holes with teeth pulled from passing dogs.

      Passing dogs?

      Man, I don't want to know what you were eating!

    85. Re:Avoid databases... by aevans · · Score: 1

      You have zero's over there? We have zero's over here.

    86. Re:Avoid databases... by aevans · · Score: 1

      MySQL has always been fast, and PostgreSQL had a goal of being good. Maybe it got there, but MySQL has done 2 of 3 for years and PostgresSQL isn't scalable or stable yet.

    87. Re:Avoid databases... by aevans · · Score: 1

      You know there are protocols that can communicate with a windows box? ODBC does well, and JDBC well enough. TCP/IP can do in a pinch and CORBA will do in a poke. Even WS* can get your info off it, if not in time.

    88. Re:Avoid databases... by Anonymous Coward · · Score: 0

      You're a fucking idiot.

    89. Re:Avoid databases... by rossjudson · · Score: 1

      The future will be memory-mapped files coupled with STM (software transactions). The type system will guarantee transactional boundaries.

      Stupid object-relational boundaries drive me nuts. Objects drive me nuts too.

    90. Re:Avoid databases... by Anonymous Coward · · Score: 0

      You?

  3. So... by Richard_at_work · · Score: 4, Insightful

    If I 'emulate' enough features in the code, I can do away with both packages AND still get a performance boost. Probably. However, the whole point of having a seperate package do it is so I dont have to work more than needed.

    1. Re:So... by linuxwrangler · · Score: 3, Insightful

      Not entirely true true. The main point is to have your database contain known-good data. And not lose it. (Yes, you can boost PostgreSQL's performance by turning off fsync but most people are bright enough not to do this.)

      Ensuring data integrity requires a well thought-out design of table structures, primary/foreign keys, rules, triggers, etc. It also requires a database server that actually provides the tools required to implement your plan.

      Maybe Mr. PHP hasn't heard of Perl, Python, C, Java, Ruby and so on and thinks that databases are only accessed via PHP code written by careful talented programmers eager to reinvent database features. Maybe he doesn't think that people use ad-hoc tools like psql or PgAdmin. Sure, it's possible to re-implement some of the safeguards inherent in a good database design running on good database software. But only for that one piece of code.

      It's kind of like a homeowner who carefully installs one new energy efficient window, leaves all the others open, and then wonders why the heating bill is so high.

      --

      ~~~~~~~
      "You are not remembered for doing what is expected of you." - Atul Chitnis
    2. Re:So... by jadavis · · Score: 1

      However, the whole point of having a seperate package do it is so I dont have to work more than needed.

      Not only that, if write all the consistency code yourself, and you make mistakes in one application that inserts bad data, that can cause other applications to fail. Try tracking down THAT bug. It's not fun.

      However, if you know the data in your database is consistent, that narrows your bug hunt to one application. Usually, it means that the database will report a nice, useful error to the offending application at an earlier stage of development.

      --
      Social scientists are inspired by theories; scientists are humbled by facts.
    3. Re:So... by ben+there... · · Score: 1
      If I 'emulate' enough features in the code, I can do away with both packages AND still get a performance boost. Probably. However, the whole point of having a seperate package do it is so I dont have to work more than needed.

      Also, the whole point of having some of those features in the database, rather than emulating them in code, is to reduce duplication. If he's talking about any integrity checks, or input validation, or even querying strategies, it makes a whole lot more sense to write it once in the database, then use that same functionality in every application that needs it. It makes it a whole lot harder to make mistakes, especially when you're talking about more than one programmer maintaining it.
  4. There ARE other scriping languages besides PHP ... by xmas2003 · · Score: 5, Funny

    "Rasmus Lerdorf, the creator of PHP ... said the current state of the Internet includes a litany of broken items, but with a little help from PHP there may well be some hope for the Web yet."

    I wonder if he has ever consider using Perl ...

    --
    Hulk SMASH Celiac Disease
  5. Let me be the first to say... by Mongoose+Disciple · · Score: 4, Insightful

    The creator of PHP thinks that PHP is #1 and all others are #2 or lower? Shocking.

    They say to a man with a hammer, everything looks like a nail. I'm sure it was even worse for the guy who invented the hammer.

    1. Re:Let me be the first to say... by syntaxglitch · · Score: 5, Funny

      But with PHP and MySQL, you can hammer screws much faster! :D

    2. Re:Let me be the first to say... by Anonymous Coward · · Score: 0

      s/a nail/the back of someone's head/ There. Fixed that up for you.

    3. Re:Let me be the first to say... by Anonymous Coward · · Score: 2, Funny

      They say to a man with a hammer, everything looks like a nail. I'm sure it was even worse for the guy who invented the hammer.

      Yeah but this is the guy who invented broken thumbs.

    4. Re:Let me be the first to say... by Anonymous Coward · · Score: 0
      They say to a man with a hammer, everything looks like a nail. I'm sure it was even worse for the guy who invented the hammer.


      Corollary: Don't let that man masturbate.

    5. Re:Let me be the first to say... by jonadab · · Score: 1

      > But with PHP and MySQL, you can hammer screws much faster!

      I prefer Perl. With DBI, I can hammer the fasteners in a portable way, so that it doesn't matter whether they're nails, screws, pegs, rivets, brads, or what. If I decide to port my code from MySQL to PostgreSQL (or vice versa), I only have to change a couple of lines and it's done. Want to port to SQLite? Change those couple of lines again. Oracle? Same deal. And so forth.

      This is much more valuable than the ability to replace database functionality with application-layer code.

      --
      Cut that out, or I will ship you to Norilsk in a box.
  6. wow by aleksiel · · Score: 3, Interesting

    he's quite full of himself, isn't he?

    the web is "broken" independant of the language used. bad/inexperienced developers are causing the problems, no matter what language is used. in order to not shoot yourself in the foot, you have to know that you're holding a gun and that pointing it at your foot and pulling the trigger are bad things to do.

    and mysql and postgresql are different. they both have strengths and weaknesses. you can hammer in a screw faster than using a screwdriver, but thats not the friggin point of it.

    1. Re:wow by Anonymous Coward · · Score: 0

      you can hammer in a screw faster than using a screwdriver, but thats not the friggin point of it.

      Is that an analogy for transactions?

    2. Re:wow by Goaway · · Score: 1

      the web is "broken" independant of the language used.

      Well, you know, most langauges make it quite easy to protect yourself against this.

      Most language, that is, except for PHP, which expects users to understand and use functions like "mysql_real_escape_string()".

  7. Considering the source by grammar+fascist · · Score: 4, Insightful

    Considering that this is coming from the author of one of the worst hack-jobs of a language since Visual Basic, I'm going to have to give his opinions a pass. Pragmatism is great, but even Perl has principles.

    --
    I got my Linux laptop at System76.
    1. Re:Considering the source by PhrostyMcByte · · Score: 1, Interesting

      I'm sure you'll be modded to hell (who knows, maybe me too), but I agree with you entirely.

      Take design advice from the people who brought us "magic quotes" and a configurability that makes it such a pain in the ass to write websites that will work the same on different servers? No thanks!

    2. Re:Considering the source by Dion · · Score: 1, Flamebait

      I agree with you fully.

      PHP is trainwreck built ontop of a thousand nasty hacks and halfbaked ideas.

      PHP+MySQL are the VB+Access of the Open Source world and just like on windows there are nutters who keep using it for real work.

      PHP (along with MySQL, VB and Access) should be sealed in concrete and dumped at sea.

      --
      -- To dream a dream is grand, but to live it is divine. -- Leto ][
    3. Re:Considering the source by Overly+Critical+Guy · · Score: 1

      Frankly, comments like this coming from prominent developers only serve to polraize people and turn them even more against PHP.

      --
      "Sufferin' succotash."
    4. Re:Considering the source by Savage-Rabbit · · Score: 1

      PHP (along with MySQL, VB and Access) should be sealed in concrete and dumped at sea.

      If you can fit Perl and Lotus Notes in there I'll pay for the extra cement.

      --
      Only to idiots, are orders laws.
      -- Henning von Tresckow
    5. Re:Considering the source by Anonymous Coward · · Score: 0

      Add Exchange, XSL and ODBC too. I'll pay for the cement *twice*

    6. Re:Considering the source by Trails · · Score: 1

      "turn them even more against PHP"

      So you're saying this is a good thing?

    7. Re:Considering the source by plague3106 · · Score: 1

      PHP (along with MySQL, VB and Access) should be sealed in concrete and dumped at sea.

      Can we also include the nutjobs that still prefer these technologies?

    8. Re:Considering the source by plague3106 · · Score: 1

      Think we'd still have enough room for Filemaker?

    9. Re:Considering the source by paranode · · Score: 1

      A Perl zealot calling PHP a 'hack-job'? Consider THAT source. ;)

    10. Re:Considering the source by freeplatypus · · Score: 1

      And that's is good right?

      I am full off php4 :( If it wasn't for legacy code that has to be maintained, it would be long gone.

    11. Re:Considering the source by Anonymous Coward · · Score: 0

      Ah magic quotes...

      I think it is one off the worst things in php. before I used php I could count and I knew how to escape, now thinks just crash and a sql error smiles at me. Yes I hate 'magic quotes'. I could live with the inconsistend functions php has but magic quotes bring hell. But then again, when I started using php, mysql was part of the deal :(

      How I yearn for the days that are gone, or what the f happend to the oracle I loved.

    12. Re:Considering the source by grammar+fascist · · Score: 1

      If you really want to know, I'm no kind of zealot, but an admirer of Python. Perl is FUGLY, it looks like SWEARING, and I'll probably never learn it unless I'm threatened with stampeding spectral flamingos. (Or something of that nature.)

      But even Perl has design principles.

      I do computer vision research. C is cumbersome, C++ does a lot of things nicely but gets in my way, Java is adequate for most things, and Python... well, my Python code is generally 1/4 the length of equivalent Java, and it never demands anything weird from me.

      I tried PHP once, and after spending a few hours looking through the library docs, I threw up on my keyboard.

      --
      I got my Linux laptop at System76.
    13. Re:Considering the source by Anonymous Coward · · Score: 0

      I like it how you complain about a language that you haven't even learned, and even vow not to. You're no kind of zealot, no, of course not.

    14. Re:Considering the source by msh104 · · Score: 1

      microsoft bob anyone?

    15. Re:Considering the source by Anonymous Coward · · Score: 0

      s/ bob//

  8. And We'd listen to the creator of PHP by Gr8Apes · · Score: 4, Insightful

    Why would we listen to the creator of a badly performing broken scripting language about a reliable performance oriented DB?

    Not the whole world is interested in rendering HTML tables with blathering text.

    --
    The cesspool just got a check and balance.
    1. Re:And We'd listen to the creator of PHP by Karma+Farmer · · Score: 1

      PHP isn't broken. It's almost as good as Microsoft's ASP technology was in 1998!

    2. Re:And We'd listen to the creator of PHP by Mateo_LeFou · · Score: 1

      "Why would we listen to the creator of a badly performing broken scripting language about a reliable performance oriented DB?" Because he does his research on the facts under discussion before spouting off about them. "Insightful" indeed. This article has the worst comments thread ever.

      --
      My turnips listen for the soft cry of your love
    3. Re:And We'd listen to the creator of PHP by Gr8Apes · · Score: 1

      Actually, I was going for an insightful troll, but it looks like I got modded as having trolling insight... :)

      In any case: the problems with PHP. Additionally, RoR is a better paradigm for web based developement, even though Ruby's still an interpreted script which has the same performance failings as PHP.

      This is admittedly dated, and DBs have improved since, but PostgresSQL performed well at the time. Various DBs no longer allow publication of third party benchmarks. Quite understandably IMHO.

      Lastly, I went and read TFA. The reason for my post was essentially "people in glass houses shouldn't throw stones". For someone who created something as admittedly bad as PHP to go criticizing a product that's designed for something other than pure sloppy speed is ludicrous. Yes, MySQL is faster in many cases. If you've got heavy transactions it was the last DB you'd want to use until just recently. It really comes down to using the right tool for the job, and configuring said tool correctly.

      --
      The cesspool just got a check and balance.
    4. Re:And We'd listen to the creator of PHP by Mateo_LeFou · · Score: 1

      "comes down to using the right tool for the job, and configuring said tool correctly." Which is exactly what Rasmus says below in this thread, when things began to get useful. He also explains why reading TFA isn't a good way to get informed on what he said. You might note that Rasmus never says "zomg Postgres is teh suxorz" PS: Ruby is not a script, and Rails is not a "paradigm"

      --
      My turnips listen for the soft cry of your love
    5. Re:And We'd listen to the creator of PHP by Gr8Apes · · Score: 1

      He spoke poorly then. Either way, controversial sounding statements make for great soundbites when giving keynotes, and I think he got his 15 minutes again. I guess part of this is whether you view PHP as good to begin with, and think it can effectively emulate those features of Postgres not available in MySQL. Apparently 4 out of 5 mods disagree.

      Rails is a framework (an implementation of a paradigm) and Ruby (scripts), are, surprisingly, scripts. "Ruby" itself is the name of the scripting language.

      --
      The cesspool just got a check and balance.
    6. Re:And We'd listen to the creator of PHP by tolan-b · · Score: 1

      >> In any case: the problems with PHP. Additionally, RoR is a better paradigm for web based developement,
      >> even though Ruby's still an interpreted script which has the same performance failings as PHP.

      Hello? You're comparing an application framnework to a language...

      RoR is great for small projects, but there are some fundamental design decisions that will cause headaches for larger projects.

      My main concern with Rails and it's clones is how well they'll scale to larger apps. For small to medium (in terms of web-app sizes) apps they look like a good design, but I fear that, as you scale up, some of the design choices might start to bite.

      In particular Active Record is a nice pattern for simpler models, if a little close to the DB for my liking, it's going to be a lot more difficult to manage when the model gets more complex.

      Personally I'm not sure I really see the utility of taking advantage of the simplicity of Active Record when you're building a framework. It seems to me that the framework developer shouldn't be the one avoiding the hard work involved in creating some sort of implementation of the Data Mapper pattern. Once the framework is written it's actually easier for the end user to use in many circumstances. You can still get the advantages of convention over configuration with a Data Mapper, but with the option of altering your modeldb abstraction if you need to. You also don't have to subclass a specific parent object, so you can persist any class.

      Another issue is putting all the actions for a model class within the controller. You can pretty rapidly end up having to deal with a massive file that's pretty unwieldy, even on a relatively small application.

      Basically I do wonder whether the initial simplicity these frameworks offer in terms of getting up and started is worth the eventual trade-off you have to pay in terms of larger scale flexibility.

      Personally I use PHP5, and you know what? If used properly it's fine. I have a moderately large codebase for a web-app (30 kloc excluding comments, whitespace and HTML), proper separation of layers, a Repository based object / relational mapping layer and a solid web framework.

      Oh sorry I forgot, it's not Rails though is it? Must be shit.

    7. Re:And We'd listen to the creator of PHP by Gr8Apes · · Score: 1

      RoR is a framework. Ruby is a language.

      Now, RoR/Ruby are great for prototyping, but I personally wouldn't use either for production code. There's a whole slew of reasons why, but my last project had 35,000 concurrent users during peak usage, which should give a good indication of why both Ruby and RoR are insufficient.

      PHP? Ick! 30K LOCs? I personally saw a single java class with over 18KLOCs. Just one. out of over 1400. Again, last project. I'm very happy I'm no longer dealing with it.

      So PHP is fine for toy apps, but for real code, you'll need something more structured. If you disagree with this, talk to me after trying it.

      --
      The cesspool just got a check and balance.
    8. Re:And We'd listen to the creator of PHP by tolan-b · · Score: 1

      >>RoR is a framework. Ruby is a language.

      Er yes.. the OP compared PHP to RoR: "In any case: the problems with PHP. Additionally, RoR is a better paradigm for web based developement"

      >> Now, RoR/Ruby are great for prototyping, but I personally wouldn't use either for production
      >> code. There's a whole slew of reasons why, but my last project had 35,000 concurrent users during
      >> peak usage, which should give a good indication of why both Ruby and RoR are insufficient.

      Gosh your cock must be huge! Still, you seem to be basically agreeing with me here.

      >> PHP? Ick! 30K LOCs? I personally saw a single java class with over 18KLOCs. Just one. out of
      >> over 1400. Again, last project. I'm very happy I'm no longer dealing with it.

      I'm not suprised you're happy to be rid of it, it sounds like a fucking abortion. I'm well aware tht 30K LOCs isn't that big as applications go, which is why I clearly qualified my statement.

      As for PHP being ick, well actually it's perfectly usable. Personally I prefer Java for web-apps, but I'm not going to wet myself over PHP just because it's not shiny. It has everything that I actually *need* to build a well structured OO app. I'd prefer to have namespaces and return hinting, but they're not deal breakers.

      >> So PHP is fine for toy apps, but for real code, you'll need something more structured. If you
      >> disagree with this, talk to me after trying it.

      Define real code mister macho. What specifically is PHP missing that's so vital?

    9. Re:And We'd listen to the creator of PHP by Gr8Apes · · Score: 1

      Middle school insults aside, to get to the only thing worth talking about in your post: real code.

      Real code is code that functions over time and is maintainable.

      FYI: Code that functions initially is generally known as a prototype. And that OP was me.

      Lastly, the numbers were to let you know I wasn't some 12 year old talking out of my ass. I've been there, done that, and have the tattered T-shirt. 5 9s SLAs can suck, especially if it starts out with some prima donna's code regurgitation. This wasn't my only project in that space, just the one that sucked the worst.

      --
      The cesspool just got a check and balance.
    10. Re:And We'd listen to the creator of PHP by tolan-b · · Score: 1

      >> Real code is code that functions over time and is maintainable.

      I couldn't agree more, which was exactly why I made my original point about Rails having some (imho) bad design choices for those who want their app to grow over time and remain maintainable...

    11. Re:And We'd listen to the creator of PHP by Gr8Apes · · Score: 1

      Rails is a good prototyping system, and a decent system for specialized functions. I wouldn't use any scripting language at this juncture for "real" systems.

      --
      The cesspool just got a check and balance.
    12. Re:And We'd listen to the creator of PHP by tolan-b · · Score: 1

      Again you seem to be implying that an application can't be a 'real' application unless it has a huge codebase or massive concurrency.

    13. Re:And We'd listen to the creator of PHP by Gr8Apes · · Score: 1

      neither is true - I'm saying it can't be a real application unless it scales.

      --
      The cesspool just got a check and balance.
    14. Re:And We'd listen to the creator of PHP by tolan-b · · Score: 1

      There I have to disagree with you. Some apps will simply never have to scale much because of the type of functionality they offer. It sounds like you're describing 'enterprise' (a nebulous term at best I'll grant you) web-apps specifically.

      Take phpBB for instance. It's not a bad application because it's written in PHP, or because it won't scale (although I suspect it will still handle a fairly heavy load with the right hardware), it's a bad app because it's it's badly designed and written.

      A well designed PHP or Ruby (maybe not Rails specifically) app will be able to scale perfectly well. Sure there are features available in JEE that make scaling a lot easier to handle, but they're not essential for all apps.

    15. Re:And We'd listen to the creator of PHP by Gr8Apes · · Score: 1

      You are correct. I guess the main problem is in the definition of a "real" app. When talking about web apps, in general I think large, scalable, thousands of concurrent users. I don't think ma & pa's store with 5 or even no concurrent users, although that too is a perfectly appropriate example of a webapp.

      It's just that such apps are generally much more forgiving of mistakes and allow lots of choices in design and architecture not available to "enterprise" apps. Some of those choices make the app much easier to write and deploy than a corresponding application that is required to scale to large numbers.

      --
      The cesspool just got a check and balance.
    16. Re:And We'd listen to the creator of PHP by tolan-b · · Score: 1

      Well I think there's a middle ground too, and that that's a place that scripting languages are perfectly capable of fulfilling.

      Anyway, I guess we can leave it there while we're on relatively similar ground.. ;)

  9. Moo by Chacham · · Score: 5, Insightful
    FTA:

    "The Web is pretty much broken, we can all go home now," Lerdorf said somewhat sarcastically to the capacity crowd. "Luckily most people don't realize that it's broken."
    Header "stupidity," as Lerdorf referred to it in Apache HTTP Web server, can also be the root cause for the broken Web.
    "IE is completely broken in so many ways," Lerdorf said.
    This guy is an idiot. PHP is a nice product though, if anyone can get past its inconsistent function naming schemes.

    He also states:

    "You have to filter everything and then poke a few holes to let things through, "Lerdorf advised.
    He *just* learned that? Oh my, that's scary.

    "If you can fit your problem into what MySQL can handle it's very fast," Lerdorf said. "You can gain quite a bit of performance."
    MySQL is made for speed compromising to act like a database where it does not break its own convenience. PostgreSQL is a database which will compromise for speed, if it does not break the database.

    From someone who obviously is suprised that to secure something you need to make a safe-house and then be strict about what gets in, it seems that he missed the point on the MySQL/PostgreSQL thing.

    Maybe by the next conference he'll grow up and state the new revelation "You have to use a database like PostgreSQL and use a warehouse schema to allow faster reporting."

    ====

    Nor was this a "slam". PostgreSQL is not made for specifically web use. If anything, Lerdorf merely publicly demonstrated his own immaturity.
    1. Re:Moo by kahei · · Score: 1

      . If anything, Lerdorf merely publicly demonstrated his own immaturity.

      I'm pretty sure that inventing PHP demonstrated that pretty effectively. /Don't hate PHP //Don't get it mixed up with proper languages though ///Slashies on Slashdot!

      --
      Whence? Hence. Whither? Thither.
    2. Re:Moo by Jack9 · · Score: 0, Flamebait
      He *just* learned that? Oh my, that's scary.

      You actually think he *just* learned that? Wow, you're just making noise...Ad-hominem much? In other news,

      This guy is an idiot. -Chacham

      WoW Chacham calls *himself an idiot*. Try making a technical argument, it might not seem as ridiculous next time you post.

      Anyone can play your child's game to get attention, by defending PostgreSQL vs MySQL like it's necessary. Making up semi-intelligent abstract comparisons like

      MySQL is made for speed compromising to act like a database where it does not break its own convenience. PostgreSQL is a database which will compromise for speed, if it does not break the database.

      The statement, states a philosophical difference that doesn't exist. You're back to stating fiction, within the same post *sigh*. Not only have you failed to actually illustrate why Rasmus is wrong on any particular point, but you come off like you're a driveling moron. Thx for the bandwidth anyways.
      --

      Often wrong but never in doubt.
      I am Jack9.
      Everyone knows me.
    3. Re:Moo by masklinn · · Score: 2, Interesting

      PHP is a nice product though, if anyone can get past its inconsistent function naming schemes.

      And 3000 redundant functions, and absence of namespaces, and stupid syntax (does ANYONE know why PHP uses $prefixed names? I mean they make sense in Perl or Ruby because they have a meaning, but in PHP?), and the completely stupid misfeatures (register_globals or magic_quotes) which generate as many security holes (flash news: the web is mostly broken because of PHP), and retarded implementations of new features (yeah PHP finally having OO may be great, but Java's OO model just isn't fit for a dynamically weakly implicitely typed language)

      Lerdorf is an idiot.

      --
      "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
    4. Re:Moo by Chacham · · Score: 1

      >>If anything, Lerdorf merely publicly demonstrated his own immaturity.
      >I'm pretty sure that inventing PHP demonstrated that pretty effectively.

      Hey, i'll give him credit for creating a language that appeals to so many people. I've coded i it myself for a while.

      He is defnitely capable, just seemingly immature or something.

    5. Re:Moo by Overly+Critical+Guy · · Score: 1
      The statement, states a philosophical difference that doesn't exist. You're back to stating fiction, within the same post *sigh*. Not only have you failed to actually illustrate why Rasmus is wrong on any particular point, but you come off like you're a driveling moron. Thx for the bandwidth anyways.

      You, sir, have faithfully defended our Lord. How dare the heathan speak his mind. I would ask you over for crumpets to celebrate this mighty defeat, but as I'm sure you're far too busy bringing in the ladies with your highly advanced debate skills, I'll have to make do with staying home and rendering HTML tables in PHP (also known as "God's Language").

      You, sir, are a scholar and a gentleman, and I salute you.
      --
      "Sufferin' succotash."
    6. Re:Moo by nuzak · · Score: 2, Insightful

      > does ANYONE know why PHP uses $prefixed names?

      Consistency I suppose, since you need the $ to interpolate in a string (which PHP doesn't even manage to do inside HTML without special escape brackets, where velocity and TT2 actually does). You can also call functions through variables that name them, e.g. $foo() so you need the $ to dereference it. You may as well use $ for dereference in all contexts at that point.

      Not that I think that much logic actually went into it. Heck, does it still deep-compare objects by value or did they fix that awesome misfeature in PHP5 now that it actually does the super-advanced thing of passing objects by reference now?

      Back on topic, I wonder how Rasmus thinks his mealy-mouthed talk goes over to anyone but his fanbase? Is he a developer or a politician?

      --
      Done with slashdot, done with nerds, getting a life.
    7. Re:Moo by 14CharUsername · · Score: 4, Insightful

      Wow I didn't get that at all. Yeah the writer of the article tried to slant it that way but thats just a typical journalist trying to sensationalise an otherwise boring story.

      First of all he was pointing out that its a mistake to trust any data from the client. Pretty obvious, but there are a lot of sites that ignore this. He didn't "just learn that", he is pointing that a lot of developers haven't learned it yet. And unfortunately this is all too true.

      You yourself admit "MySQL is made for speed compromising to act like a database" and that is exactly what he is saying too. See, if you're web app doesn't require a full featured database, ie. "If you can fit your problem into what MySQL can handle", then Mysql is a good choice for performance reasons. And even if there's one or two features you need that Mysql doesn't support, then you can do a few hacks to make it work anyway and still be ahead performance-wise.

      Nor was this a "slam". PostgreSQL is not made for specifically web use. If anything, Lerdorf merely publicly demonstrated his own immaturity.

      I don't think he was intending to slam PostreSQL. He was only saying that MySQL has better performance for web apps than PostGreSQL, which you seem to agree with. He didn't say MySQL is better than PostgreSQL, he just said it gives better performance for web apps, and even added the caveat "If you can fit your problem into [it]".

      What he is really talking about is the classic problem of elegance vs. performance, a dilemma programmers constantly have to grapple with. Postgres is more elegant, but Mysql has better performance in its niche.

      The writer sensationalised it all a bit and then slashdot turned it into a troll. A mature reader would see through that and pay close attention to things actually between quotes, the things the dude actually said.

    8. Re:Moo by ahodgson · · Score: 1

      "If you can fit your problem into what MySQL can handle", then Mysql is a good choice for performance reasons

      If your problem space doesn't include having known to be good and consistent data in your database, then I suppose MySQL could be a good choice ...

    9. Re:Moo by cicadia · · Score: 1
      And 3000 redundant functions, and absence of namespaces, and stupid syntax (does ANYONE know why PHP uses $prefixed names? I mean they make sense in Perl or Ruby because they have a meaning, but in PHP?)

      PHP needs $-prefixed identifiers because of its 3000+ functions and absence of namespaces, of course.

      Since any variable name you care to invent, no matter how obscure, could become the name of a PHP built-in function next week, the only way to ensure that your code still runs at all after the next upgrade is to syntactically differentiate all of the variable identifiers like that.

      Of course, there's still nothing there to prevent PHP developers from coming up with new functions that clobber your function definitions, or, for that matter, changes to PHP core syntax that do the same, but still, I'm sure it seemed like a good idea at the time.

      --
      Living better through chemicals
    10. Re:Moo by Chacham · · Score: 1

      I read the article, and had that opinion.

      But you're corect anyway. Lerdoff replied here, and i basically take back what i said about him. :) The submitter, however, will just have to take the brunt of it.

    11. Re:Moo by 14CharUsername · · Score: 2, Insightful

      Yeah, for those rare cases where consistency isn't important. That covers almost every web app.

      See, consistent data is pretty moot in most web apps. I can store the location of an image and then, oops, someone deletes the image file. What's the result? Well technically the data is still consistent within the database, all my foreign keys check out and everything. But I still end up with a broken web page.

      So I have to write some code somewhere to make sure that all the images my database points to are real existing images. And then I'll have to so that for the hyperlinks too, nobody likes broken links. Oh and if someone renames a page in the database, we should make sure the address for the old page redirects to the new address.

      With all that going on, do you really think data consistency is that big of a problem? Come on, writing a few scripts to make sure data in the MyISAM tables is dead simple. I mean really, really, really simple. I wish all my problems could be solved so easily.

    12. Re:Moo by 14CharUsername · · Score: 1

      Yeah, well article submitters and the editors are the biggest trolls here. When I see an article here that makes someone seem like they're a complete asshole I go read what they really said immediately. Usually the difference between the article summary here and what someone actually says is day and night.

      The worst thing is that he was saying some things about caching opcodes which was very interesting. I myself have always thought about doing exactly that since where I work now we develop websites in a very specific industry, so I've developed a little library so I can easily do the most common things. If that library was permanently compiled and stored in memory it would be much more efficient.

      It would have been nice to have a discussion on opcode caching and what languages support it and the performance benefits of it. But instead we get a database trollfest. Oh well, maybe google will tell me more.

    13. Re:Moo by stonecypher · · Score: 1

      "You have to filter everything and then poke a few holes to let things through, "Lerdorf advised.

      He *just* learned that?


      No, he's been saying that for ten years. Are you really that hard up for criticisms?

      From someone who obviously is suprised that to secure something you need to make a safe-house and then be strict about what gets in

      Where do you get that? He's surprised about something he himself said? That doesn't make a whole lot of sense, senator.

      And then, my personal favorite:

      This guy is an idiot. ... He *just* learned that? Oh my, that's scary. ... From someone who obviously is suprised that to secure something you need to make a safe-house ... Maybe by the next conference he'll grow up ... Lerdorf merely publicly demonstrated his own immaturity.

      Nor was this a "slam".


      Though not for lack of trying.

      I find it amusing that you see fit to look down your nose at one of the inventors of one of the most successful programming languages of our day in this fashion, based on questionable readings of what he said and some pointless attacks, then not only do you have the gall to say that you're not trying to slam him, but are willing further to call him immature.

      I'm curious: do you have any credentials to your name, or are you the type who likes to criticise actual successful people from the sidelines?

      --
      StoneCypher is Full of BS
    14. Re:Moo by ahodgson · · Score: 1

      See, consistent data is pretty moot in most web apps

      Well, if that's true, then you don't actually need a database. SQLite might be a better choice than MySQL; it's faster and that's all you care about, right? MySQL is overkill.

      If it isn't true, then you need something better than MySQL.

      So it's hard to see where MySQL is an appropriate fit.

    15. Re:Moo by Anonymous Coward · · Score: 0

      good post. i wil add, though, that pgsql is pretty darn fast, too. i have set up a blazing fast web app. mysql might be a smidgeon master, but i can live with losing that 20 ms in order to get all th eadvantages of pgsql.

      mysql isn't bad, it is good for many things.

      it is obvious this guy knows mysql and is trying to *sell* it.

      i think he'd do well to learn postgresql in depth, but that's just me.

    16. Re:Moo by leifbk · · Score: 1

      You yourself admit "MySQL is made for speed compromising to act like a database" and that is exactly what he is saying too. See, if you're web app doesn't require a full featured database, ie. "If you can fit your problem into what MySQL can handle", then Mysql is a good choice for performance reasons. And even if there's one or two features you need that Mysql doesn't support, then you can do a few hacks to make it work anyway and still be ahead performance-wise.

      I use both PostgreSQL and MySQL. I use MySQL in my Web application to display data. A Web application whose sole purpose is to display data fast, is relatively well suited for the MySQL/ISAM paradigm. There's no concern about data corruption in a db that only serves SELECTs. In my production database, I think that data integrity is a rather important issue, never mind the speed of execution. So, I decided at a relatively early stage that MySQL was no option there.

      Over time, I've found that although MySQL/ISAM serves simple SELECTs from one table fast enough, the situation deteriorates rapidly if you have to do a join between two or even more tables. Then, PostgreSQL is actually faster, even without substantial trimming. In addition, thanks to the PostgreSQL views and functions, it's quite easy to produce 'flattened' tables from the production database that MySQL can handle in the read-only Web interface.

      If you will try to overcome MySQL's shortcomings wrt joins, you may of course follow Rasmus Lerdorf's allegedly misquoted option:

      1. Do a simple query against the MySQL database.
      2. Load the results into a PHP array.
      3. For each result row, do a second query against the database.

      That approach has actually been posted here on Slashdot earlier as a way of optimizing MySQL interactions. The guys that go this misguided route probably don't know much about relational databases in the first place, and might actually be better off with a flat-file system.

      --
      I used to be a sceptic. These days, I'm not so certain.
    17. Re:Moo by jonadab · · Score: 1

      > does ANYONE know why PHP uses $prefixed names?

      Two reasons. First, it makes very simple examples (along the lines of Hello, World) superficially resemble Perl and Python. Second, it makes interpolation syntax straightforward.

      I'm not a big fan of PHP, but the sigil _is_ worthwhile.

      --
      Cut that out, or I will ship you to Norilsk in a box.
    18. Re:Moo by Master+of+Transhuman · · Score: 1

      "With all that going on, do you really think data consistency is that big of a problem? Come on, writing a few scripts to make sure data in the MyISAM tables is dead simple. I mean really, really, really simple. I wish all my problems could be solved so easily."

      You've never written a "real" business application, right?

      Data vetting can easily be a HUGE portion of ANY application - involving much more code than the core function of the application. And if it isn't done, stupid shit like required files not being there and breaking the app - or worse, inconsistent results - is what happens next.

      I'll grant you that probably most WEB apps weren't (originally) that sophisticated - which seems to me to be what Lerdorf was saying - the Web is broken BECAUSE Web apps weren't and aren't considered "real" applications and thus the necessary design and data vetting isn't done. If all you're doing is serving up pages from a MySQL database in response to page requests, that may be acceptable. My impression is that most Web sites today are trying to be some kind of "real Web application", which requires a different set of technologies and a different set of programming and design skills than just knowing HTML and JavaScript to do a mouse rollover.

      That said, if Lerdorf deprecated using a reasonably well designed DBMS such as Postgres over a wannabe DBMS like MySQL strictly for performance reasons, he's wrong. If you need performance, it means your database is big and/or complicated - or you simply have a LOT of users of a simpler one. If the former, you NEED the better designed database. Only in the latter case can you get away with MySQL - and sometimes even in that situation, you may need database features that are implemented poorly or not at all in MySQL. The application determines what features a database needs to have implemented, not the performance requirements. You do design FIRST, performance tuning SECOND in any application development.

      --
      Richard Steven Hack - This sig is TOO GODDAMN SHORT TO DO ANYTHING USEFUL WITH! MORONS!
    19. Re:Moo by MadMidnightBomber · · Score: 1

      You forgot $$foo where if $foo="bar" and $bar="baz", $$foo = "baz".

      I think someone has already coined the phrase "syntactic strychnine". If not, I claim dibs.

      --
      "It doesn't cost enough, and it makes too much sense."
    20. Re:Moo by ffrinch · · Score: 1

      Oh, it's much worse than that! $foo="bar", $bar="foo", $$foo="foo", $$$foo="bar, $$$$$$$$$foo="bar"...

      I don't think there's any limit to it other than memory.

    21. Re:Moo by AmVidia+HQ · · Score: 1

      Wrong on "MySQL has better performance for web apps than PostGreSQL". MySQL is faster only if you are doing simple selects. Do more complex queries and mixing with a good dose of updates and MySQL locks up like spaghetti. You can use innodb to get around some query lockup issues but I don't think innodb is really faster than PostgreSQL.

      --
      VIVA1023.com | Political Fashion.
  10. WTF? by Anonymous Coward · · Score: 0

    WTF? Someone guilty of creating PHP complains about the quality of other people's work? This is September 15, not April 1...

    1. Re:WTF? by menix · · Score: 1

      I completely agree... WTF

  11. Rather incomplete quote by Rasmus · · Score: 5, Informative

    You are basing this on a rather incomplete account of my actual talk. I went through a series of optimizations of a sample Web application, and one of many steps was to try MySQL instead of PostgreSQL for that particular application. By profiling it with Callgrind it was obvious that in this particular case MySQL was significantly faster. I don't think this is news to anybody that MySQL is quicker at connecting and issueing simple queries, and I am not sure why me showing some Callgrind profiles and stating that MySQL is particular good at these things is frontpage slashdot material. Slow day?

    And the "The Web is broken and it is all your fault" thing was just a bit of humour to wake people up for this 9am talk, but I guess it makes for good headlines.

    1. Re:Rather incomplete quote by SETY · · Score: 0

      moderators, helllo?????????

      MOD UP.

    2. Re:Rather incomplete quote by Azarael · · Score: 1

      Unfortunately this is /. and not one has the interest and/or time to look behind every inflammatory article. All I have to say is that the company that I work for has been using PHP and PostgreSQL in unison and I haven't seen anything that makes me doubt the fitness of that combination.

    3. Re:Rather incomplete quote by courtarro · · Score: 1

      It seems the Slashdot editors and contributors get their kicks by watching the comment count shoot through the roof. The only way to do that is to misconstrue the truth to get people infuriated about nothing. Unfortunately articles like these distract from those that warrant relevent discussions.

    4. Re:Rather incomplete quote by Rasmus · · Score: 5, Insightful

      By the way, the "emualting PostgreSQL features in PHP" part was completely misquoted. I was explaining how MySQL's internal prepare/execute API is rather broken because if you use it you completely miss the query cache, so my suggestion is to turn on prepare/execute emulation in PDO while behind the scenes it will use the faster direct query api calls and thus will also hit the query cache. So this was actually a bit of a MySQL slam which was utterly misquoted. Trying to emulate PostgreSQL things in userspace PHP would be moronic.

    5. Re:Rather incomplete quote by drinkypoo · · Score: 2, Insightful

      So since you stepped in here for some abuse :) don't you think that putting application logic in your program instead of letting the RDBMS handle it makes for a less-maintainable program?

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    6. Re:Rather incomplete quote by Azarael · · Score: 1

      Thanks for the clarification, that's a handy piece of information.

    7. Re:Rather incomplete quote by Azarael · · Score: 2, Interesting

      :) Read his 2nd comment, above. You aren't emulating the behavior in your program, but letting one of php's db abstraction libraries handle it for you.

    8. Re:Rather incomplete quote by Anonymous Coward · · Score: 0

      > By profiling it with Callgrind it was obvious that in this particular case MySQL was significantly faster.

      How many concurrent clients used the database when you profiled?

    9. Re:Rather incomplete quote by Rasmus · · Score: 4, Informative

      Sure, the more you can offload to the database, the better. Like I said, my point about emulating things in PHP was directed at MySQL's broken query cache implementation when using the prepare/execute API.

    10. Re:Rather incomplete quote by LWATCDR · · Score: 0, Offtopic

      I use both Postgres and MySQl. I use Postgres for in internal application that requires a lot of transactions and almost an equal amount of time updating as reading the data.
      Websites tend to be write a little and read often in nature.
      Where the author "which from your id I assume it is you" of this talk left himself open for bashing was his dismissal of the benefits of Postgres's additional features. It is probably possible to code around the features of Postgres but is that really the best solution for every website? I don't think I would want to code a web based accounting application with MySQL as a back end. Postgres or Oracel, or maybe DB2 might be a better solution for that problem than MySQL. If I need more performance I could always throw more hardware at the problem. From that very short news story the information from the talk seemed trivial and incomplete. Unlike most people on Slashdot I am willing to give you or whoever gave that talk the benefit of the doubt. It is a sad state of affairs but flames sell.
      Any chance of downloading a transcript of the talk or a video/mp3 of it?

      I think that for some applications MySQL is a good choice. For others Postgres is a better one. For other Maybe DB2 is needed. Some times you need a Civic, sometimes an SUV, and sometimes a semi-truck.
      Now if we want to start in on the problems of PHP... :) Well let's just say I find adding modules a pain. the function names tend to be inconsistent, and configuration to be a pain in general. I use PHP because it is so dang useful but I can't say love using it.
      However if you are the presenter of that talk I will say thanks for the tip on the cache. I will try that out. I am getting ready to deploy a new website using Drupal as the CMS and will load the cache up on our test server today. Also is there any reason not to boost the allowed size for uploads? Does it eat more ram for buffers or anything ugly like that?

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    11. Re:Rather incomplete quote by Rasmus · · Score: 1

      Tested with 5, 10, 25 and 50. I tend to keep my Apache MaxClients low to keep latency low. You are better off getting a fewer number of concurrent connections in and out quickly than to try to handle hundreds of them slowly. The actual number of course depends on the horsepower of your server.

    12. Re:Rather incomplete quote by Rasmus · · Score: 5, Informative

      Once again, I never said it was a good idea to "code around the features of PostgreSQL". I didn't write the article. I gave a talk at a conference. Someone was in the audience taking rather bad notes apparently, and he posted these notes as an article. What I showed was that if your problem fits what MySQL is good at, there are significant performance benefits from using it. It wasn't a PostgreSQL slam in any way. It was a "profile and choose the best and fastest tool for the job" statement.

    13. Re:Rather incomplete quote by rk · · Score: 1

      Posts such as these is why I keep reading the 'Dot. It's not uncommon to wind up hearing things right from the horse's mouth, instead of hearsay of hearsay.

    14. Re:Rather incomplete quote by MagicMerlin · · Score: 1

      I think you will find if that you do the simple mechanism of preparing statements, postgresql queries are just as fast even if in the form of 'select a,b,c from t where k' type queries. if you don't believe me, try it yourself. the speed advantage of mysql is highly overated.

    15. Re:Rather incomplete quote by Chacham · · Score: 1

      Wow, that is *completely* different than what the article states.

      *phew* i was beginning to wonder..

      Than again, you have a lower id than me. You *must* be telling the truth. :P

    16. Re:Rather incomplete quote by Savage-Rabbit · · Score: 3, Insightful
      By the way, the "emualting PostgreSQL features in PHP" part was completely misquoted. I was explaining how MySQL's internal prepare/execute API is rather broken because if you use it you completely miss the query cache, so my suggestion is to turn on prepare/execute emulation in PDO while behind the scenes it will use the faster direct query api calls and thus will also hit the query cache. So this was actually a bit of a MySQL slam which was utterly misquoted. Trying to emulate PostgreSQL things in userspace PHP would be moronic.

      I wish the people writing the news summaries here would tone down their appetite for sensationalism. We all like to have a nice friendly anti Microsoft flamewar-deathmatch every once in a while just for fun but headlines like 'PostgreSQL Slammed by PHP Creator' sound like they were written by a member of the British tabloid press. Can't people voice some criticism without getting gutted any more? And, no, I am not new here I'm just getting a little tired of the fanboyism.
      --
      Only to idiots, are orders laws.
      -- Henning von Tresckow
    17. Re:Rather incomplete quote by Karma+Farmer · · Score: 4, Insightful

      You're kidding, right? In this case, Slashdot was directly responsible for distributing the hearsay of hearsay in the first place.

      It's pretty routine to have a just plain wrong articles on the front page of Slashdot, and posts pointing out the editor's idiocy buried deep in the comments. It's amazine to me that you think this is a positive thing.

    18. Re:Rather incomplete quote by Anonymous Coward · · Score: 0

      Please don't call it "the 'Dot."

    19. Re:Rather incomplete quote by Anonymous Coward · · Score: 0

      Once you apologize for the insane cluster fuck that is the 'naming' system used for functions built into php we will listen. Why is it so hard for the php devs to admit they didn't know what they were doing. Don't say that php5 fixed it, because it didn't due to PHP5 not being supported by the vast majority of hosting companies.

    20. Re:Rather incomplete quote by Rasmus · · Score: 4, Informative

      It is getting to be rather annoying. A quick email asking me whether the article was an accurate representation of what I actually said would certainly have been more useful, but instead the poster chose to go the other way and focus on the misquoted bits of the article. I have been doing this stuff a long time and have been slammed on /. countless times, but please, slam me for things I actually said or did.

    21. Re:Rather incomplete quote by B3ryllium · · Score: 1

      "it didn't due to PHP5 not being supported by the vast majority of hosting companies"

      That's like accusing Firefox of failing to make the web safer because PCs still ship with IE. It's not Firefox's fault! Blame the supplier. They are at fault.

    22. Re:Rather incomplete quote by rk · · Score: 1

      I think you may be missing my point. Sure, /. propagated the hearsay, but because many of the people we read about in these articles read and post here, we get to read what they have to say without being filetered by anyone.

      I'm not saying this place doesn't have some serious faults, but having the subject of the news story in question participating in the discussion of it goes a long way in making those faults more tolerable. Now, there's no hearsay. You're hearing from Rasmus the man himself, not a news article about him.

    23. Re:Rather incomplete quote by LWATCDR · · Score: 1

      Dude I am on your side notice in my comment "From that very short news story the information from the talk seemed trivial and incomplete. Unlike most people on Slashdot I am willing to give you or whoever gave that talk the benefit of the doubt. It is a sad state of affairs but flames sell.
      Any chance of downloading a transcript of the talk or a video/mp3 of it?"

      I hate to say it but welcome to the journalist integrity in the 21st century. Pick the most inflammatory way of saying something and trivialize the details.

      I am not good at writing so maybe I should have made it clear when I said "flames sell" I was talking about the person that wrote the article and not the author of the actual talk.
      So you and I agree on the Postgres vs MySQL issue. They are both tools so pick the best tool for the job.

      I am downloading APC as we speak. So again thanks for that tip. I have heard good things about APC but never took the time until I read what you said about in that short article. So for all the grief some good came out of it.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    24. Re:Rather incomplete quote by jaydonnell · · Score: 1

      putting application logic in your database is a bad idea in most cases, imho. For example, putting application logic (I think you meant validations) in ruby makes it far more powerfull, much easier to test, and it fits in with our normal workflow much better (version control, etc). I don't see a reason for putting application logic in your database unless your using that database for multiple applications in multiple languages. That hasn't been the case for most projects I've worked on.

      p.s. - I do web coding and the DB is always the bottleneck. It's much easier to scale logic that is in the application vs the DB because it's trivially easy to add new web/app servers. It's not easy to add extra database servers.

    25. Re:Rather incomplete quote by Anonymous Coward · · Score: 0

      PHP5 isn't fully backwards compatible with PHP4 so yes you can blame the supplier. And Dual PHP4/PHP5 installs can be very flaky.

    26. Re:Rather incomplete quote by SCHecklerX · · Score: 1

      Why be worried about "connecting and issuing simple queries". I am not a PHP coder, so don't know whether this is standard practice or not, but shouldn't you be using a persistent connection to the database? Especially if you are using something like MySQL which (the version I still use, it's likely changed by now) forces you to make a whole lotta little queries if you want to emulate a sub-select? I'd hate to see the MySQL logs for some apps if it is standard practice to open that connection for every query on every page!

    27. Re:Rather incomplete quote by azterix · · Score: 2, Insightful

      The contributor of this article should be ashamed of his/herself for the sensationalized, misleading title. And - /. mods - you there? Did you read the article before posting this to the front page? Hardly an accurate depiction.

      The presentation that Rasmus gave showed some very, very powerful tools for profiling & improving PHP performance. The MySQL/PostgreSQL comment was barely a footnote on a presentation of tools that deserve the positive attention that Rasmus gave them.

      "The web is broken and it is all your fault" comment was completely taken out of context. I took it as a challenge to the majority of web developers out there that are ambivalent to security and practices that represent a challenge to our profession. Anybody hear this thing folks are talking about called 'identity theft'? We as web developers have a responsibility to our customers and end users to protect the data they share with us. Rasmus was presenting to improve awareness of both the technical vulnerabilities as well as tools & techniques to address the problems we face. It's a shame that those messages didn't reach the slashdot community.

      Seriously, check out the tools that were the focus of Rasmus's presentation: valgrind, callgrind & kcachegrind - they are amazingly powerful.

    28. Re:Rather incomplete quote by Anonymous Coward · · Score: 0

      Thanks for responding to the facts of the case and avoiding the temptation of name-calling back at the people calling you an idiot above. I have no particular feelings on PHP; it's just nice to see someone handle (misdirected) criticism well for once.

    29. Re:Rather incomplete quote by slamb · · Score: 3, Insightful
      I went through a series of optimizations of a sample Web application, and one of many steps was to try MySQL instead of PostgreSQL for that particular application. By profiling it with Callgrind it was obvious that in this particular case MySQL was significantly faster. I don't think this is news to anybody that MySQL is quicker at connecting and issueing simple queries

      It's news to me. I haven't seen a recent benchmark that says this, and I'm always skeptical of claims MySQL is faster:

      • Were you using MySQL as an ACID database? I.e., all tables using a transaction table type, fdatasync() on, real tests telling you that durability is actually working? If not, either run it properly or run PostgreSQL in stupid mode for something approaching an apples-to-apples comparison. fsync = off in $PGDATA/postgresql.conf.
      • Were you using MySQL's query cache? Turn it off. It shows bigger numbers on some bad benchmarks but doesn't help real situations: artificially claims silly numbers for tiny sets (are your real data as small as your benchmark?), cleared after every DML statement on that table, etc.
      • For that matter, did you issue any DML statements at all? As the bullet point above mentions, they have much greater impact on performance than their proportion would suggest. For other reasons, too. Doesn't MySQL still just have table-level locks? PostgreSQL's the other extreme; it has MVCC.

      Seriously, if you can prove MySQL is faster for a real-life situation, write a paper, lay all your steps out for review. (Or point me at one someone else has done on modern versions of said databases.) There are lot of potential mistakes in benchmarking, and I won't believe claims unless I actually see that none of them were made.

      By the way, what were you saying about Apache header stupidity? The article is annoyingly vague.

    30. Re:Rather incomplete quote by slamb · · Score: 2, Insightful
      have been doing this stuff a long time and have been slammed on /. countless times, but please, slam me for things I actually said or did.

      Sure thing. Did you say this?

      Part of the reason Lerdorf considers the Web "broken" is that it is inherently insecure for a variety of reasons. One of those reasons sits at the feet of developers. "You don't know that you have to filter user input," Lerdorf exclaimed.

      If you don't like insecurity due to poor input handling, why did you design your language to encourage it? magic-quotes-gpc is the worst language feature I have ever seen. It manipulates one particular set of inputs to make them conform to one set of output which doesn't always apply but is always a bad idea. People should be using bind variables supplied by the database library, not quoting according to MySQL x.x's rules and then sticking things directly into their statements. This is like a giant neon sign called "Security" pointing in the opposite direction from the real thing.

      In contrast, Perl has taint mode, a feature you'd do well to emulate. It actually tracks a flag on each variable seeing if it came, directly or indirectly, from untrusted input. If so, it must be untainted before being used in any of a number of security-related situations. It's smart enough to avoid requiring any way of doing so which is probably inappropriate. It just flags things which are almost certainly wrong. Actual thought needs to go into correcting them, and as users learn the situations taint mode complains about, they trip it less and less often. Correct taint-mode code runs the same with it off, which makes it much superior to magic-quotes-gpc.

    31. Re:Rather incomplete quote by Rasmus · · Score: 3, Interesting

      That was a reference to the Expect header problem in Apache that was recently fixed and that not all the problems can be blamed on IE.

      And yes, I do know my way around PostgreSQL. It's a good database, but no matter how you tweak it, it still has more connection overhead than MySQL does. And as I explained, I wasn't actually using the query cache in MySQL in the initial steps in this iterative optimization because MySQL's query cache doesn't kick in for prepare/execute queries. This isn't a PostgreSQL slam, it is simply pointing out that people should benchmark and profile their actual applications and understand the costs.

    32. Re:Rather incomplete quote by loucura! · · Score: 1

      Doesn't MySQL still just have table-level locks? PostgreSQL's the other extreme; it has MVCC.

      The MyISAM engine still has table-level locks, but MyISAM isn't remotely ACID. Other engines have different locking mechanisms: page, row, et cetera.

      --
      Black and grey are both shades of white.
    33. Re:Rather incomplete quote by KermodeBear · · Score: 1

      Hi Rasmus!

      It is upsetting to me that your talk was taken out of context. I often feel that this is happening more and more in the world of reporting. Whenever I read or hear news I always feel like someone is trying to pull a fast one on me by leaving out context, twisting words, and purposefully mis-quoting in order to push an agenda - and in this case, the agenda seems to have been to make you look like an ass.

      It's a shame. )o: I think we all know you're a lot smarter than the article makes you sound.

      --
      Love sees no species.
    34. Re:Rather incomplete quote by slamb · · Score: 1
      And yes, I do know my way around PostgreSQL. It's a good database, but no matter how you tweak it, it still has more connection overhead than MySQL does.

      Are you talking about the actual connection initiation? Let me add to my list: were you pooling connections? I'd never actually considered that someone wouldn't do this in a web application. Even if MySQL's connection overhead is lower, it doesn't matter, because both can be trivially made 0.

      This isn't a PostgreSQL slam, it is simply pointing out that people should benchmark and profile their actual applications and understand the costs.

      That I agree with. But it must be done carefully. It's very easy to deceive yourself by benchmarking something you think is similar to your application but is not. Or by comparing two different techniques, with one done improperly.

    35. Re:Rather incomplete quote by Bob+Uhl · · Score: 1
      I suppose I should have expected that. My father deals with reporters as part of his job, and I don't believe that one has ever properly quoted him. They always hear something other than what one says. That probably applies to most of us.

      I'm glad to see from your comments below that this was blown rather out of context. It's true that for what MySQL is good at that it can be a good choice. I'd say that it's not good for much than an speedy SQL interface to flat files, though.

    36. Re:Rather incomplete quote by Fiznarp · · Score: 1

      The PHP devs seem to be aware of these issues and are moving in the right direction, IMHO. PHP5 and PHP6 fix a bunch of this stuff. Magic quotes and register globals are going away completely in PHP6.

      http://www.corephp.co.uk/archives/19-Prepare-for-P HP-6.html

    37. Re:Rather incomplete quote by Rasmus · · Score: 1

      Yes, of course I showed how persistent connections improved things as well. That was an early step.

    38. Re:Rather incomplete quote by leifbk · · Score: 1

      As the contributor of this /. story in the first place, I'll like to say that you sum up my own view quite nicely. It's good to see Rasmus Lerdorf himself debunking TFA. I believe him completely when he says that he has been grossly misquoted. If not for this discussion on Slashdot, TFA might have gone down in history as representing the actual views of Rasmus Lerdorf.

      BTW, I'm a regular user of both PHP and MySQL as well as PostgreSQL.

      --
      I used to be a sceptic. These days, I'm not so certain.
    39. Re:Rather incomplete quote by jalefkowit · · Score: 1

      If Rasmus wasn't a god for having invented the Web's most popular scripting language, he'd be a god for his low uid! 740! I bow to you, sir :)

    40. Re:Rather incomplete quote by stonecypher · · Score: 1

      and I am not sure why me showing some Callgrind profiles and stating that MySQL is particular good at these things is frontpage slashdot material.

      Because operating systems, programming languages and video games aren't the only things zealots go into blind rages over? Welcome to Slashdot. I notice that someone seems to have stolen several digits from your user ID; someone that old should be used to the volume of stupid that goes through this site by now.

      By the way, thanks for PHP.

      --
      StoneCypher is Full of BS
    41. Re:Rather incomplete quote by slamb · · Score: 2, Insightful
      Yes, of course I showed how persistent connections improved things as well. That was an early step.

      Okay...so is that what you were talking about here?

      It's a good database, but no matter how you tweak it, it still has more connection overhead than MySQL does

      If so, why are you complaining about something that has no significance? If not, what are you talking about?

    42. Re:Rather incomplete quote by FormOfActionBanana · · Score: 1

      From now on I shall call slashdot "S to the D to the org".

      --
      Take off every 'sig' !!
    43. Re:Rather incomplete quote by jwsd · · Score: 1

      slam me for things I actually said or did.

      That wouldn't be very slashdottish, would it?

    44. Re:Rather incomplete quote by Rasmus · · Score: 1

      Even eliminating connection overhead, MySQL was faster in this case. There are also cases where you can't necessarily leave the connections up.

    45. Re:Rather incomplete quote by Anonymous Coward · · Score: 0

      Indeed, the only thing more moronic would be to emulate PostgreSQL in kernel space PHP.

    46. Re:Rather incomplete quote by TheLink · · Score: 1

      That's funny. They should have been aware of these issues from the very beginning. It's not like PHP was the first language ever. Why didn't they just learn from other people's mistakes?

      PHP3- use addslashes/magic_quotes. PHP4 - use PEAR DB. PHP5 use PDO. PHP6? Forget it - use Python or even Perl ;).

      Next thing you know MySQL5 and MySQL6 will be deprecating/removing a bunch of braindeadness as well ;).

      PHP and MySQL...

      --
    47. Re:Rather incomplete quote by slamb · · Score: 1
      Even eliminating connection overhead, MySQL was faster in this case.

      In the later tests, after you'd turned on the deceptive query cache?

      I wasn't actually using the query cache in MySQL in the initial steps in this iterative optimization because MySQL's query cache doesn't kick in for prepare/execute queries.
      my suggestion is to turn on prepare/execute emulation in PDO while behind the scenes it will use the faster direct query api calls and thus will also hit the query cache.
      The same one I complained about in my first post:
      Were you using MySQL's query cache? Turn it off. It shows bigger numbers on some bad benchmarks but doesn't help real situations: artificially claims silly numbers for tiny sets (are your real data as small as your benchmark?), cleared after every DML statement on that table, etc.

      Look, I don't care about your progression, I care that you've made in this thread a claim that it's well-known that MySQL is faster in real-world situations. I assert that you're wrong. If you want to convince me, you'll have to give me a single reasonable configuration of a modern MySQL database, a nearly-equivalent single reasonable configuration of a modern PostgreSQL database, and show me the MySQL one being faster in a good approximation of a real-world load. No one's ever done that, so it's certainly not well-known, and it's probably not true.

    48. Re:Rather incomplete quote by Rasmus · · Score: 1

      Yes, the MySQL numbers were without the query cache, although in this particular application the query cache helps quite a bit. And yes, fsync was off in PostgreSQL. I am not trying to convince you or anybody else really. The point of the talk was to show people how they could benchmark and profile something to get a real sense of where their application was spending most of its time. It just so happened that for this application MySQL was faster. I have plenty of experience with both, and there are use cases where both make sense.

    49. Re:Rather incomplete quote by slamb · · Score: 1
      I am not trying to convince you or anybody else really. The point of the talk was to show people how they could benchmark and profile something to get a real sense of where their application was spending most of its time.
      That's cool, but please don't spread this myth:
      I don't think this is news to anybody that MySQL is quicker at connecting and issueing simple queries
    50. Re:Rather incomplete quote by Anonymous Coward · · Score: 0

      People have done it, and it certainly is true. You fucking zealot, shut the fuck up. Prove it wrong you whiny bitch.

    51. Re:Rather incomplete quote by Anonymous Coward · · Score: 0

      why would i want to learn two dbs in order to get some alledge micro speed improvement that nobody will notice?

      assuming your answer was right, and it well may be, i think the question was wrong.

    52. Re:Rather incomplete quote by Goaway · · Score: 1

      And the "The Web is broken and it is all your fault" thing was just a bit of humour to wake people up for this 9am talk, but I guess it makes for good headlines.

      You know, if the web is broken and it's anybody's fault, it's really yours. Putting the C API for mysql right in front of a huge population of inexperienced coders is about the worst design choice I've seen in years and years. More people have shot themselves in the foot with that API than anybody can count.

      I'd wager that the fact that PHP doesn't ship with a safe and reliable database API out of the box is really the biggest single cause of SQL injection attacks on the web today.

    53. Re:Rather incomplete quote by SanityInAnarchy · · Score: 3, Interesting

      You are right, you were quoted out of context on at least a couple of things. And you probably had some insightful things to say, so I'm just going to use this as an excuse to rant:

      What I find especially annoying is that it seems that the Web is more broken because of PHP than in spite of it. Valid to wake people up to a 9am talk -- when you're presenting Ruby to a PHP conference.

      My own personal gripes are:

      • While it's possible to call $self->method() from a method (or maybe that's $this->method?), if your function is called as a static class method, it has no way I've found of discovering what class it's in. Yet, you're forced to call static class methods as MyClass::Method. This defeats the main purpose of using a class as a namespace -- you still end up with your namespace referred to throughout the code, meaning you still have to use grep to change it, which can be unreliable.
      • The syntax, in general, is clumsy at best. It basically feels more or less like any other C-like language. But this is web programming. I thought we were taking a speed hit to make things easier. I like Perl, Python, and Ruby for tons of syntactic sugar that PHP never had. preg_match is definitely clumsy when compared to =~.
      • In order to access a global variable, I must have a line that says "global $variable". Forcing people to declare a variable is good, it means you'll probably notice your typos. If you're declaring a variable anyway, it saves a lot of typing, especially if you're using lots of tiny functions, to do this the Perl way -- say "my $variable" if you want it to be local, and just say "$variable" if you want it to check for a global one first.
      • Prefixing every variable with a $ doesn't seem to serve any real purpose. Ok, so I can have a variable called $variable and a function called "function". I could do that anyway. It means you don't have to define variables to use them -- same with Ruby, except Ruby doesn't use prefixes. Perl uses prefixes, but it also uses them for interpolation in strings -- I don't think PHP can do that. Ruby manages that interpolation without prefixing variables except when they're in a string.
      • Not a lot of scope choices. In fact, there seems to only be method scope and global scope, and maybe loop scope (foreach and friends), unless I'm missing something. What I miss is easy access to, say, class scope and object scope.
      • A history of being seen as the easiest language for web programming, to where now many think "web backend programming" is always PHP, means you have lots of clueless newbie web programmers. The advantage of PHP was being easy to learn and having some nice features for web programming, but many of these (register_globals, anyone?) have been found to be security flaws, and are no longer reasons to use it. Yet, and I know this isn't your fault, given the choice between a PHP app and a Python|Perl|Ruby|C|ASP app, I won't choose PHP, because PHP developers tend to be the ones who say "If our app gives you security errors, just chmod 777..."

      To be fair, I have found some advantages:

      • Easy insertion of HTML code. This is nice for developing an app quickly. I still don't find it too incredibly useful in larger apps, though, because it makes more sense to split most of the HTML out into a separate file, and generate the rest, maybe even through some XML API.
      • Powerful templates. Being able to embed real code into a mostly HTML template is a beautiful thing. And yet, I find myself both wishing it was a more powerful language, and thinking a better design (separating logic from presentation, using an existing template engine) would be better than what PHP offers.
      • Good apps. As much as I hate the poorly-written PHP apps, I'm starting to work on Drupal... In this way, apps are a bit like game consoles, you get the one that plays the games you want. I think PHP attracting newbies probably leads to more decent web apps being written in PHP than in o
      --
      Don't thank God, thank a doctor!
    54. Re:Rather incomplete quote by Master+of+Transhuman · · Score: 1

      "I don't think this is news to anybody that MySQL is quicker at connecting and issueing simple queries."

      If that's true - and I think it is - then why did you bother?

      It seems to me to be common knowledge that MySQL was a poorly designed DBMS intended to be fast at the application of serving up Web pages for a Web site. It is not and never was designed to be a general purpose database for enterprise class production database and data warehousing applications. It's gotten better since version 5.0 was introduced, but still has a LONG way to go to be considered a serious database for larger applications. It's fine for replacing crap like Microsoft Access systems and it's fine for Web page serving - where the Web site is not trying to be a "real Web APPLICATION".

      For anything else, more mature DBMS systems like Postgres are clearly preferred by anyone who knows anything about database and application design.

      I would suggest that the next time you discuss the use of databases in Web site design, you make this clear to your audience. Then maybe people wouldn't misinterpret your meaning - or maybe they will anyway; this is /. after all.

      --
      Richard Steven Hack - This sig is TOO GODDAMN SHORT TO DO ANYTHING USEFUL WITH! MORONS!
    55. Re:Rather incomplete quote by Josuah · · Score: 1

      It's not always better to offload onto the database. If you have a database that has heavy load, but because it's a database needs to remain a single "instance", moving heavy processing into the clients can be a better thing. That way, you can scale horizontally while not placing as much hit on the database resources.

    56. Re:Rather incomplete quote by 00lmz · · Score: 1

      Prefixing every variable with a $ doesn't seem to serve any real purpose. Ok, so I can have a variable called $variable and a function called "function". I could do that anyway. It means you don't have to define variables to use them -- same with Ruby, except Ruby doesn't use prefixes. Perl uses prefixes, but it also uses them for interpolation in strings -- I don't think PHP can do that. Ruby manages that interpolation without prefixing variables except when they're in a string.

      I hate PHP too, but it can interpolate variables in strings...

    57. Re:Rather incomplete quote by Dom2 · · Score: 1
      Hear, hear!

      If people used profilers a bit more, there'd be a lot fewer programmers wasting their time out there. You don't know where the problems are until you've profiled it!

      -Dom

    58. Re:Rather incomplete quote by Roland+Bouman · · Score: 1

      "It seems to me to be common knowledge that MySQL was a poorly designed DBMS intended to be fast at the application of serving up Web pages for a Web site. It is not and never was designed to be a general purpose database for enterprise class production database and data warehousing applications."

      I think you have mistaken one of the popular myths about MySQL for common knowledge. MySQL was originally created to meet the needs of a large datawarehousing environment and then become popular as a backend for websites primarily because of it's ease of use and it's speed.

      "For anything else, more mature DBMS systems like Postgres are clearly preferred by anyone who knows anything about database and application design."

      is in my opinion a rather blunt generalization which basically claims that MySQL users like Amazon.com, Digg, Google, Livejournal Slashdot, Yahoo, Nokia, flickr, YouTube and Wikipedia are basically a bunch of idiots that have no clue what they are doing.

      This is /. after all, so it is only fair that your idea of what is common knowledge is also published. May it give lots of people a good laugh.

    59. Re:Rather incomplete quote by Master+of+Transhuman · · Score: 1


      The facts remain that MySQL is used more for Web page serving than anything else.

      And the fact that large companies use it - perhaps even successfully - does not change the fact that it is a poor database from the standpoint of support of relational database theory. And large companies have just as manyu poor database designers as smaller ones.

      And MYSQL's level of capability is far less than Postgres - another known fact.

      It does have its uses and its advantages. But for serious database work, Postgres is to be preferred.

      And that remains a fact. The only reason it might not be common knowledge is the lack of knowledge of much of the IT industry - which should come as no surprise.

      --
      Richard Steven Hack - This sig is TOO GODDAMN SHORT TO DO ANYTHING USEFUL WITH! MORONS!
    60. Re:Rather incomplete quote by Roland+Bouman · · Score: 1

      "The facts remain that MySQL is used more for Web page serving than anything else."

      Now that is indeed a fact as well as common knowledge. Actually it's probably two facts:
      1) MySQL is used more often to serve web pages than to back other kinds of applications.
      2) There is no other rdbms that is used so widely to serve web pages.

      Having read your earlier statements:

      "MySQL was a poorly designed DBMS intended to be fast at the application of serving up Web pages for a Web site. It is not and never was designed to be a general purpose database for enterprise class production database and data warehousing applications."

      I believe you intended to express the first interpretation. Apparently, you are trying to prove again that MySQL is only suitable for serving web pages, and that that is one of the reasons why it is used so often for that purpose. Well, if the amount of usage is a really measure for suitability, where does that leave Postgres then?

      "And the fact that large companies use it - perhaps even successfully -..."

      Tsk, tsk "...perhaps...". They *are* using it successfully, and they are (in part) large companies *because* they use MySQL.

      "...does not change the fact that it is a poor database from the standpoint of support of relational database theory."

      I think you would have a hard time explaining exactly which parts of relational theory are not supported by MySQL that cause it to be such a "poor database". But go ahead, convince me.

      "And large companies have just as manyu poor database designers as smaller ones."

      Let's just forget for a while that you are *again* bashing these highly succesfull companies and their developers because of their preference for a particular rdbms. Let's concentrate on your reasoning instead. You seem to want to imply that despite the fact that these companies are large (please note that I did not introduce "large" - you did. I just copied a list of names from the wikipedia), they still have poor database designers, just like smaller companies, and preferring MySQL over, say Postgres, is a symptom of having poor database designers, or being a poor database designer.

      Well, I don't see how this can reflect negatively on MySQL. I mean, suppose all those poor database designers would suddenly switch to Postgres, would that make Postgres a bad product? Wouldn't they be poor database designers anymore?

      "And MYSQL's level of capability is far less than Postgres - another known fact."

      Well, that is quite possible. I wouldn't know that. However, I don't see how that could hurt using MySQl in enterprise or datawarehousing applications. I mean, MySQL does everything a database should do, and fast too, and I don't really see much reason for having capabilities beyond that.

      "But for serious database work, Postgres is to be preferred." "And that remains a fact."

      Well, could you at least name which users do what kind of serious database work that makes them prefer Postgres? After all if it's a fact, it should not be too hard to come up with a few examples, or one even.

    61. Re:Rather incomplete quote by Master+of+Transhuman · · Score: 1

      "Well, that is quite possible. I wouldn't know that."

      I think that sums up your knowledge of the issues of relational design and the relative merits of MySQL vs. Postgres.

      And "MySQL does everything a database should do".

      Not even.

      I don't need to spend time rehashing all the MySQL vs Postgres articles available on the Net. Do your own Google and you'll see why I made the statements I did.

      --
      Richard Steven Hack - This sig is TOO GODDAMN SHORT TO DO ANYTHING USEFUL WITH! MORONS!
    62. Re:Rather incomplete quote by Roland+Bouman · · Score: 1

      Actually I was hoping you would finally come up with just one single argument to support your earlier claim that MySQL "...is a poor database from the standpoint of support of relational database theory."
      It would be fab too if you could give just one example of a user that prefers Postgres for all that serious database work they need to do.
      You might find it hard to believe, but I really am interested in your reasons for saying all these things.

      My remark ("Well, that is quite possible. I wouldn't know that.") you are so eagerly lifting out of context was actually a nice way of letting you know that I think you made your remark ("And MYSQL's level of capability is far less than Postgres - another known fact.") just based on hearsay, esp. because you don't name even one such capability.

      The attempts you have made so far to give your views some credibility, have only led to catchy phrases like "relational theory" but these remain utterly void since you take no effort to show that *you* actually know what you're talking about. Sure I can google - I'm interested in what *you* have to say about it.

      Cutting this thread short by taking my comments out of context and totally ignoring sound critique is quite childish, and your eagerness in doing so makes me think you just want the easy way out. If you want the easy way out, the do so gracefully and just admit that your bashing is just a social thing, and not based on any technical experience.

  12. Re:There ARE other scriping languages besides PHP by $RANDOMLUSER · · Score: 1

    "Insightful" heh. You're killing me here.

    --
    No folly is more costly than the folly of intolerant idealism. - Winston Churchill
  13. Pot, kettle, black? by A+beautiful+mind · · Score: 3, Insightful
    "You don't know that you have to filter user input," Lerdorf exclaimed.
    Apparently the much belowed MySQL doesn't know it either, since in contrast to most standard SQL relational databases like Postgresql, it silently trims certain input/fields instead of reporting an error.

    While people might not agree with me that PHP is horribly broken, I think we can all agree that if we were to choose between Apache, PHP and Postgresql as to what made the web more broken, I think almost everyone would pick PHP. The reason can be summed up as bad design decisions in PHP (slashes, inconsistent naming, header fun, etc.).

    I don't blast someone if they choose the smaller learning curve with PHP + Mysql, but they're certainly not the superior solution compared to for example Perl/Python + Postgresql/Oracle.
    --
    It takes a man to suffer ignorance and smile
    Be yourself no matter what they say
    1. Re:Pot, kettle, black? by kwark · · Score: 2

      "Apparently the much belowed MySQL doesn't know it either, since in contrast to most standard SQL relational databases like Postgresql, it silently trims certain input/fields instead of reporting an error."

      Might you be looking for: http://dev.mysql.com/doc/refman/5.0/en/server-sql- mode.html ?

    2. Re:Pot, kettle, black? by Anonymous Coward · · Score: 0

      Personally I'd blame programmers who use PHP but are too stupid to actually understand it.

      And, does anyone know what Rasmus is referring to in regards to apache header stupidity?

  14. Re:There ARE other scriping languages besides PHP by neonprimetime · · Score: 1

    I wonder if he has ever consider using Perl ...

    I'd prefer to point him towards Python.

  15. I want to move from MySQL by Anonymous Coward · · Score: 5, Insightful

    I've used MySQL on several projects. At first because we didn't know any better, later because it was the thing we knew best, or because the project was already using it when I joined it. Inertia. We're using a 5.0.x now, on a setup where we replicate to six slaves, it's not small.

    I knew that MySQL could do stupid things now and then, but at least it was our stupid thing. We have some experience with it, by now.

    Recently though, some colleagues on another project had an issue with major data loss - an input script had put data into the database that wasn't really compatible with the data model.

    Turns out that in a table with an auto-increment primary key named 'id', some of those ids occurred over 200 times. A primary key.

    I don't care if there's options or ways to have it check that, even without "emulating it in PHP" (shudder) - anything that is even considering putting "SQL" in its name has to complain loudly when someone tries to insert such crap, and then abort. Not just silently accept it.

    That's the eternal problem with MySQL - everywhere, the default action on wrong input is to silently continue, perhaps trying to read the mind of the programmer and turn the nonsensical value into some equally nonsensical default. Put a string into an int field? Let me guess what you meant... etc.

    I've had it, I don't want MySQL anymore.

    1. Re:I want to move from MySQL by Anonymous Coward · · Score: 0

      "Turns out that in a table with an auto-increment primary key named 'id', some of those ids occurred over 200 times. A primary key."

      I am continuing my move away from mysql (on FreeBSD), and just yesterday I was happy to do a 'drop table' on 8.1 million rows that had been moved to postgresql. I feel much better storing it in that DB; from the first struggles on its learning curve I was struck by how professional it was. But, in all fairness, if your investigation of the above claim is clear-headed, and perhaps even reproducible, you should communicate with the mysql folks about it. I'll never go back to mysql, but they're good people working through a sticky period (vis a vis engines) and their product deserves a place in the toolscape.

    2. Re:I want to move from MySQL by raehl · · Score: 1

      Put a string into an int field? Let me guess what you meant... etc.

      Not a big fan of Perl, are you?

    3. Re:I want to move from MySQL by Anonymous Coward · · Score: 0

      Yes!

      People make mistakes and a database must complain so it will be noticed and can be corrected.
      If a db doesn't do that 'it' is the mistake made and should be corrected.

      Learn!

    4. Re:I want to move from MySQL by 14CharUsername · · Score: 1

      You wouldn't happen to be using multiple masters in your replication are you? If you are the problem could be that data was being inserted into two masters at the same time so the insert gets replicated before the autoincrement. This is easily avoided by setting an offset for autoincrement. link here.

      I'm really surprised there wasn't an error somewhere. Did you check the replication logs? You wouldn't get one on the insert, because the inserts worked, its just the replication screwed things up.

    5. Re:I want to move from MySQL by Bob+Uhl · · Score: 1
      I've been very happy with my move over to PostgreSQL from MySQL. The book Beginning Databases with PostgreSQL is a pretty good introduction to its dialect of SQL and even covers some stuff which isn't really covered well in the official docs (or wasn't when I was looking, anyway).

      PostgreSQL doesn't have as many built-in types as MySQL, but its types are IMHO more consistent, and extending the database with your own types really isn't a pain.

      I've been happy with its speed, and am given to understand that an intelligent DBA can make it extremely fast.

      Take a look--I think that you'll be pleasantly surprised. And you'll never have to worry about duplicated primary keys again!

    6. Re:I want to move from MySQL by egghat · · Score: 1

      Atleast Perl has a rather useful

      use strict;

      Bye egghat.

      --
      -- "As a human being I claim the right to be widely inconsistent", John Peel
  16. Re:There ARE other scriping languages besides PHP by Billosaur · · Score: 3, Interesting

    I've been writing Perl for 6 years now and I've yet to find a more versatile language. I just started working in PHP, and it's Perl-like enough that learning it has been easy. But some things are just not done elegantly, and one has to wonder why that is, given that PHP is in fact pretty good as languages go.

    --
    GetOuttaMySpace - The Anti-Social Network
  17. PostgreSQL "Slammed" you say? by tjw · · Score: 5, Insightful

    The headline implies that Rasmus blames PostgreSQL for breaking the web which is not the case. The focus of his ire is web application programmers for putting too much trust in user input. I don't think anyone can truthfully argue with that.

    His comment regarding PostgreSQL was:

    "If you can fit your problem into what MySQL can handle it's very fast, you can gain quite a bit of performance."

    As someone who uses both MySQL and PostgreSQL in production environments, I couldn't agree more. The key qualifier is "If you can fit your problem into what MySQL can handle". In order to argue that this statement is wrong you would have to argue that PostgreSQL is faster than MySQL in situations that are ideal for MySQL.

    --

    XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UB E-TEST-EMAIL*C.34X
    1. Re:PostgreSQL "Slammed" you say? by mpcooke3 · · Score: 1

      How about: "If you can't get the performance you need from PostgreSQL then you could try using MySQL after all they do now offer ACID features if you use the right table types"

      I've always found the performance on Postgresql to be excellent (once you have done the neccessary optimisations) but looking at it this way round I get a rock solid ACID compliant database that runs easily fast enough.

      It just seems sensible to start with something rock solid and only compromise that reliability and feature set for better performance as a last resort.

    2. Re:PostgreSQL "Slammed" you say? by drew · · Score: 1
      In order to argue that this statement is wrong you would have to argue that PostgreSQL is faster than MySQL in situations that are ideal for MySQL.


      That's a very good point, and I'm glad somebody called that out. Hold on for a minute while I rack my brain for situations that are ideal for MySQL...

      nope.

      still nothing.

      wait!

      no, never mind...

      In all seriousness, MySQL does have some uses. I've worked for a company that had great success using about a dozen MySQL servers for fast access to temporary data while aggregating all of the critical data to a pair of Oracle databases. When the MySQL databases threw up, all you lost was the CPU time required to recalculate whatever was in the database at the time. In essense an L2 cache for a server farm.
      --
      If I don't put anything here, will anyone recognize me anymore?
  18. Who cares? use ORM. by profet · · Score: 5, Informative

    I got sick of the syntax dialects of every SQL engine, so I started writing my applications using Hibernate and haven't looked back.

    I learned HQL (Hibernate Query Language) and just use whatever database is handy at the time.

    I usually start with MySQL 5, and then if I need more muscle (Read: the boss wants to spend money), I can switch the entire application to Oracle in about two hours.

    You want ACID...? Use J2EE transactions and Hibernate, and never worry about which database you use again.

    1. Re:Who cares? use ORM. by T-Ranger · · Score: 1

      And this helps users of the language in question - PHP - how?

    2. Re:Who cares? use ORM. by profet · · Score: 1
    3. Re:Who cares? use ORM. by Deinesh · · Score: 3, Insightful


      You want ACID...? Use J2EE transactions and Hibernate, and never worry about which database you use again.


      Yes. But shit happens. It is always nice to have a relational database that GUARANTEES data integrity. You should not depend on the application for maintaining data integrity - all applications have bugs and you don't want those bugs thrashing your data. You shouldn't completely depend on the framework for transactions - even Websphere has bugs.

    4. Re:Who cares? use ORM. by Anonymous Coward · · Score: 0

      You want ACID...? Use J2EE transactions and Hibernate, and never worry about which database you use again.

      That works fine for trivial data models bearing trivial loads. Then the load ramps up and your ORM is copying massive amounts of data from the database to the application server behind the scenes, whereas a well-tuned app would take care of the most bulky processing right in the database.

      Oh, wait... you're a Java programmer. You wouldn't know "well-tuned" if it hit you over the head with a J2EE reference book.

    5. Re:Who cares? use ORM. by Richard+W.M.+Jones · · Score: 3, Interesting
      Who are these people who change databases all the time? We just figured that PostgreSQL was the best, it's free, we know how to use it and tune it, and so that's all we ever use. Now we can use all the wonderful SQL features of PostgreSQL and not worry.

      A solution which forced us to regress to using Java or .Net is no solution at all BTW.

      Rich.

    6. Re:Who cares? use ORM. by Angvaw · · Score: 1

      It is my opinion that database independence is a myth, and not necessarily something to strive for, regardless of how great your ORM is. Copying a post I wrote elsewhere (slightly revised):

      Over the past decade or so I've worked with several RDBMSs: Oracle, Postgres, MS SQL, DB2, Sybase, Access (if that counts) and a little MySQL (wasn't a fan). If there's one thing I've learned is that each database has a fundamentally different architecture, and database independence is NOT easy to achieve. I'm not even sure if it's desirable.

      Switching databases has always been a big, big deal in my experience. This coming from a guy who started on the completely opposite end of the spectrum. I did everything generically - this is just the perspective I was taught in college and literature (black boxing and all that). The first way I ever used a database was by querying MS-SQL doing "select * from mytable" and iterating through the results. I realized that was stupid and learned this whole SQL thing. I learned about ANSI SQL and how I should try to conform to this standard to achieve independence. Then I realized I was using the lowest common denominator and achieving poor results. And coding became much more difficult - had to check against the ANSI standard before using a particular feature: "Darn, x isn't 'ANSI'? Well, I'll do it the hard way..."

      If you just replace one database with another, plug-in style, you're going to notice differences (perhaps "bugs"), even with the latest and greatest ORM. With the exception of trivial applications, these differences will affect your application, possibly drastically. For example, you have two users running a transaction on the same row(s) of data. Due to fundamental differences in concurrency mechanisms, Sybase might deadlock (and so one user is rolled back and gets an error) while Oracle runs smoothly. Or MS SQL will give you one answer while Postgres literally gives you a different answer to the same query! And yes, I'm talking about setting the same isolation level in your ORM...

      If you use DB2, you're going to have to use repeatable read isolation to get a consistent result set. Not the case with Oracle.

      Database A may give you non-blocking reads; Database B does not. Therefore your app plugged into database A may run just dandy. You switch to B and your users complain of slowness. Maybe you then conclude that Database B is bad, but really the problem is that you perhaps unwittingly designed for Database A, thinking that you were database independent all along.

      Many developers want to treat the database as a black box - they feel they don't need to know anything about it - they believe they should AVOID knowing anything about it in order to be good object-oriented programmers. The culture supports this notion with terminology such as "data store" and "persistence layer" - just a place to plop down your data and take it out again later, as if it were spreadsheet. In reality, most RDBMSs are very robust with countless features to manage, manipulate, safeguard, and serve your data to many concurrent users.

      Why not use the features that make your database special? If you're using a commerical database, you paid a lot of money for these features. Why use the lowest common denominator? Using Oracle's analytic queries I've seen queries run literally orders of magnitude faster than lowest-common denominator queries with Java code on top. I've seen an overnight job transformed into a sub-minute job by using native SQL that lets you do, through a single query (not row-by-row): "If a row having the matching ID exists, update, else insert".

      I find it much easier to rewrite the database API (stored procedures) entirely than to deal with the above issues. I've used ORM in the form of Hibernate, in order to solve the database independence problem (wasn't my choice), and I found the cure was worse than the disease - I'd rather translate my 100 PL/SQL functions to PL/PgSQL (maybe a bad example as they're nearly identical - or maybe a good example

    7. Re:Who cares? use ORM. by Kent+Recal · · Score: 1

      +5 Insightful.

    8. Re:Who cares? use ORM. by Josuah · · Score: 1

      You want ACID...? Use J2EE transactions and Hibernate, and never worry about which database you use again.

      By doing this you are restricting yourself and ignoring the problem. Putting J2EE transactions and Hibernate in front of a MySQL ISAM table isn't going to guarantee you data integrity. What if your Java app crashes? It also means you are not bothering to ensure data integrity at the database level, and someone who accesses it through a different tool can screw you over. Plus, you are abstracting things away when you might not be able to. If you need to process millions of statements a day, knowing the right way to build your schema and manage database resources in the first place, and also how to deal with your transactions and transaction interactions, which is unique to each database and application, is important.

    9. Re:Who cares? use ORM. by Anonymous Coward · · Score: 0

      +5 for me too :) Laika *Arf*

  19. Re:There ARE other scriping languages besides PHP by Anonymous Coward · · Score: 0

    Rasmus's first version of PHP (PHP/FI) was written in Perl http://www.kme.eku.edu/tools/php/doc.html#history

  20. Pot and Kettle by markbthomas · · Score: 3, Funny

    "'The Web is broken and it's all your fault' says Rasmus Lerdorf, the creator of PHP."

    Translation:

    "Hello, Kettle? Yes, this is Pot. What colour are you..?"

    Really, if Lerdorf wants to know who broke the web, he just needs to look in a mirror.

  21. Needs more Enterprise by lowe0 · · Score: 1

    Not Enterprisey enough. You should be using XML for everything - transactions are just a fad anyway!

  22. "a universal fix all" by jimstapleton · · Score: 1

    I got the impression he thinks PHP is a univeral fix all.

    There are no universal fixalls except time, effort, and if you are lucky, good documentation.

    Use what works, Sometimes PHP is good, other times it sucks. It all depends on your needs and wants. But to inxrease performance over 50x by switching from Postgress to MySQL? I like/use MySQL as my primary DB, but somehow I doubt Postgress is THAT much slower.

    I think someone needs to go sit in a corner.

    --
    34486853790
    Connection too slow for X forwarding? Try "ssh -CX user@host"
    1. Re:"a universal fix all" by Anonymous Coward · · Score: 0
      Here, let me fix that for you ;-)

              Sometimes PHP sucks, other times it sucks

      Here, let me fix that for you ;-)
      I not a programmer and don't know what I don't like about PHP but I know how to post a comment on /.!
    2. Re:"a universal fix all" by TheNinjaroach · · Score: 1

      Yeah this WAS at a *PHP* developer's conference where they were learning about the best ways to implement (wait this is a shocker): PHP.

      --
      I went to eat some animal crackers and the box said, "Do not eat if seal is broken." I opened the box and sure enough..
  23. Re:There ARE other scriping languages besides PHP by andy753421 · · Score: 1

    From wikipedia: 'PHP was originally designed as a small set of Perl scripts'. So yes, he has.

  24. PHP Creator says PHP is great at PHP Conference by BrianRoach · · Score: 1

    Er, this is news?

    - Roach

    1. Re:PHP Creator says PHP is great at PHP Conference by SpinJaunt · · Score: 1

      Possibly, although I really think this is just Slashdot at it's best.

      --
      /. is good for you.
  25. Re:There ARE other scriping languages besides PHP by Rasmus · · Score: 5, Informative

    PHP/FI was the second version, and it wasn't written in Perl. Neither was the first version. The first version of PHP replaced some Perl code which may be where this myth comes from.

  26. It's entirely a matter of appropriateness by kahei · · Score: 3, Insightful

    Recently, I've been using Drupal (PHP CMS system) with a MySQL backend and I am STUNNED, STUNNED I SAY by how productive the combination is compared with, say, ASP.NET and SQL Server. It's a messy, awkward, ambiguous and utterly unscalable language with a cluttered global namespace stuffed full of magic variables and near-identical functions -- combined with a 'database' that simply does not do what a proper database does. And I love it!

    I don't understand this compulsion to prove that PHP and MySQL are good. They're not good. They're sh*t. They're extremely old fashioned and underpowered solutions to problems that are already solved far more effectively in the MS world AND in the OSS world AND even in the proprietary Unix world. Every time I poke around in the Drupal source I have a little smugness session as I think how much clearer and more efficient and more cleanly extendible it could be in C#, or even Java. Then I go right back to using it -- not because it's good, but because for the size of task I'm using it for, it's productive.

    Sure, SQL Server is better and so is PostgreSQL, and sure, the antics of LAMP people to prove that PHP and MySQL (and CVS, for that matter) are real grown up systems are laughable. But so what? I'm not trying to be scalable or extensible or secure beyond very narrow parameters that I already know fall within the limited scope of PHP and MySQL. I don't want to use the best tools; I'm familiar with the best tools and the scale of operation they best suit. When I want the following methodology:

    GET
    gunzip
    tar -xvf
    vim vim vim
    exit ...I want PHP and MySQL!

    (end of long meandering rant)

    --
    Whence? Hence. Whither? Thither.
    1. Re:It's entirely a matter of appropriateness by drinkypoo · · Score: 1

      I'm personally curious as to why drupal is, in some ways, such a mess. I've been running it for a short while now (started only with 4.6, a bit before 4.7 became current) and I'm having tons of problems, bad output (like blank pages) with no errors in any log, etc etc. All my problems began when I installed the categories module, but now I still have them when it's uninstalled. But what's worse is that I posted message about this problem, and then bumped it, and have no replies in two days. At least a bad, wrong reply would let me know someone's thinking about me, but it doesn't look like they're too concerned about stability of the current version. If I had to do it all over again I'd probably pick a different CMS, and at this rate, I might have to do it all over again, because I want a website that works.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  27. But this is for a database by benhocking · · Score: 1

    You still need to store the XML somehow. This is obviously where the flat file format makes sense. Actually, it would be just as funny if someone was actually storing XML in MySql or PostgreSQL. Come to think of it, I bet someone does.

    --
    Ben Hocking
    Need a professional organizer?
    1. Re:But this is for a database by tcopeland · · Score: 1

      > Actually, it would be just as funny if someone was actually
      > storing XML in MySql or PostgreSQL. Come to think of it,
      > I bet someone does.

      Yup, the Jabber database adapter stores XML in tables - for example, the "last time the user was online" timestamp is stored in a field; it's a tiny xml document with one element and one attribute. Egads.

      And go Wahoos!

    2. Re:But this is for a database by sachar · · Score: 2
    3. Re:But this is for a database by David_W · · Score: 1
      Actually, it would be just as funny if someone was actually storing XML in MySql or PostgreSQL. Come to think of it, I bet someone does.

      Oh yeah... Sun's Identity Manager stores everything in a database (among which MySQL is a choice)... and pretty much all of it is BLOBs full of XML. Very disturbing...

    4. Re:But this is for a database by lowe0 · · Score: 1

      XML-in-RDBMS was actually the Daily WTF a couple of days ago.

    5. Re:But this is for a database by theshowmecanuck · · Score: 2, Informative

      They do. And unfortunately I have direct experience with these people... and for the record, I *mostly* hate it.

      Where I work, some of the architects and designers have decided to store more than a little XML in Oracle tables. In some cases this is not an entirely onerus decision (i.e. can make sense). e.g. if you are storing standardized configuration information in XML that will be queried as a string from the table and can be used by/passed to different consumer services/applications as an atomic unit (and which is not used in whole or in part as an sql 'where' predicate), then it can work.

      However any time you may need to query information contained in the XML string, it seems to me to be kind of retarded to store it in a relational table. e.g. I have seen cases where IDs or service types etc. are stored in a large XML string in a field in a record, and eventually someone wants to retrieve a record based on that ID which is in the XML. This means parsing the field storing the XML in your query, killing any chances on performance since you are likely going to need a 'like' clause with wild cards at the front and back of the search term (even if the RDBMS has a built in XML search tool, the field still needs to be parsed). Unfortunately, people buy in to XML so much that some think that it is still OK to store XML in database tables... even in these cases.

      I personally think it is generally a bad idea to store XML in a relational database as eventually the 2nd situation will come about (that is what experience tells me). You will then find that the practice totally negates the benefit of a relational database and sql (language) to easily and quickly retrieve relational data. I have seen this bite people many times. Ahhh... to use a technology, even a useful one, just because it is hip... but that is just my experience.

      --
      -- I ignore anonymous replies to my comments and postings.
    6. Re:But this is for a database by sbjornda · · Score: 1
      In that regard, the new version of DB2 looks kind of interesting. (I'm not an IBM-er, nor do I currently use DB2). Here's a marketing pdf: ftp://ftp.software.ibm.com/software/data/pubs/broc hures/db2_9_overview.pdf. It's still the DB2 rdb, but it stores the XML hierarchically and cross-indexes it. It'll be interesting to see if it works in the real world.

      --

      .nosig

    7. Re:But this is for a database by ebyrob · · Score: 1

      Here here!

      I can certainly see the need (or usefulness) to store wholly unparsed snapshots of external XML (or other) data in binary or text fields. Or even, to store pre-computed XML to be externally emitted later. However, it makes no sense to keep internally parsed data and structure in anything but basic/native database data types if you're going to the trouble of using an RDBMS in the first place.

      Heck, you may even duplicate the data (an evil in itself) by storing both parsed values split into columns and external values aggregated into XML for the same record. My excuse for the evil portion of data duplication being that on the input side is "keeping a record of what was input" and on the output side is "caching or pre-caching for performance reasons", or even "keeping a record of exactly what was output". The presumption being that it's always possible for a parsing or emitting error to occur and recording pre-parsed and post emitted data, in addition to the internal structures, helps in diagnosing such problems when they occur.

      Actually... Keeping both copies (fully or partially indexed and raw XML) might be something you could even sell in your situation. Of course, I still totally agree that using XML in an internally/controlled environment where you're doing RDBMS is a huge mistake. (XML is best for interfacing externally!!)

    8. Re:But this is for a database by Bush+Pig · · Score: 1

      It sounds like they've re-implemented a CODASYL database as a data type within a relational database - braindead.

      --
      What a long, strange trip it's been.
    9. Re:But this is for a database by jadavis · · Score: 1

      You will then find that the practice totally negates the benefit of a relational database and sql (language) to easily and quickly retrieve relational data.

      Keep in mind that relational databases were adopted not because of their good performance, but in spite of their bad performance. Relational databases, by definition, create a logical layer of abstraction over the physical representation of your data. You can operate on this logical layer according to the relational model.

      Heck, you could have a relational database that represents its tables as XML documents, and you can probably even make it fast. You can create secondary indexes to index the data, just like with normal tables.

      --
      Social scientists are inspired by theories; scientists are humbled by facts.
    10. Re:But this is for a database by julesh · · Score: 1

      You're looking at it from the perspective that storing XML in a database is worse than storing flat relational data in a database: in many ways that's true. But if the data you have isn't really relational in nature (e.g. you're storing hierarchically structured data that should be accessible as whole units), then it's probably better than the alternative, which is storing XML (or some other data serialization) in files.

      You do need to do a fairly good job of isolating your keys to separate columns (or even tables, if you can have multiple entries for them), though. I'm working on a project at the moment which stores data from PHP's serialize() method in RDBMS tables, and haven't had any of the problems you describe, exactly because I've done the data analysis to know what keys I need to store outside of the serialized data.

    11. Re:But this is for a database by theshowmecanuck · · Score: 1

      Yeah... that is what I meant by 'if you need it as an atomic unit'...

      --
      -- I ignore anonymous replies to my comments and postings.
  28. The real story here... by Anonymous Coward · · Score: 3, Informative
    PHP 6, which is still in development, will have opcode cache built in by default.

    For current PHP 5 users, there are various opcode cache implementations that can be used, including the Alternative PHP Cache (APC), which is what Lerdorf recommended.


    APC is broken in so many ways it is unbelievable.

    eAccelerator however performs a thousand times better and actually works.

    Ever new major php build makes noticeable efforts to break eAccelerator while making concessions to APC.

    It is very frustrating. APC just plain sucks. eAcclerator rocks.
    1. Re:The real story here... by kashani · · Score: 1

      Totally agree. Additionally APC is completely broken when trying to use PHP 5.1 in any sort of object oriented way.

      kashani

      --
      - Why is the ninja... so deadly?
  29. Re:There ARE other scriping languages besides PHP by Abu+Hurayrah · · Score: 1

    Yes, he did. When he first wrote PHP/FI as a series of Perl scripts back in the middle to late 90s.

    --
    Kindness is not to be found in anything but that it adds to its beauty...
  30. Ssshhhh... You'll ruin a perfectly good flamewar!! by 3.5+stripes · · Score: 1

    It's one of those things that /. geeks can argue in circles about for hours, let them have their fun.

    --


    He tried to kill me with a forklift!
  31. Re:There ARE other scriping languages besides PHP by Anonymous Coward · · Score: 0
    From wikipedia: 'PHP was originally designed as a small set of Perl scripts'. So yes, he has.

    Wikipedia isn't the most reliable source. According to the author of PHP, it was meant to replace some Perl scripts.
  32. Where's the slam? by Abu+Hurayrah · · Score: 3, Interesting
    One performance enhancement that Lerdorf suggested based on code analysis was to use MySQL instead of PostgreSQL for the database. "If you can fit your problem into what MySQL can handle it's very fast," Lerdorf said. "You can gain quite a bit of performance." For the items that MySQL doesn't handle as well as PostgreSQL, Lerdorf noted that some features can be emulated in PHP itself, and you still end up with a net performance boost.
    There's your "slam". Hardly a revelation, really. MySQL & PostgreSQL are two excellent databases that have different target audiences that overlap somewhat. I guess there are different kinds of extremists out there as well...
    --
    Kindness is not to be found in anything but that it adds to its beauty...
  33. database usually more robust than apps that use em by Anonymous Coward · · Score: 0
    .


    Databases are usually more robust than the apps that use them. Apps make lots of mistakes, while DBs, even simple ones, usually do a lot better. ACID is fine and dandy, but if it causes my app to be less robust (takes too long, grows files too large, too many files open), then what good is it really? Get in and get out is a good moto. Play around with ACID, and you're liable to take a header out the window !!

    .

  34. Postgres by JustNiz · · Score: 1, Interesting

    OK here's something I never did understand about postgres:

    If you modify a record in a postgres DB it keeps an invisible copy of the original for 'transactional reasons' and does not ever automatically delete it, even if there are no current transactional queries running. This means you can have a DB containing a single one field record and if you keep altering the field value you'll eventually run out of disk space. With any Postgres DB you therefore have to manually run a purge every now and again, and the purge slows the whole DB down to a crawl while its running (for us a purge had to be run every day otherwise the DB performance would be crazy slow, and the purge took over half an hour which during that time hardly any queries would run).

    Basically, it just seems like Postgres has shot itself in the foot there.

    I spoke to the developers and was told in a rather snooty reply that they had no plans to allow the user to optionally disable transactional 'features'.

    1. Re:Postgres by mlwmohawk · · Score: 2, Informative

      The feature you are talking about is vital to the proper operation of a real database. The "transactional reasons" you refer too are the difference between a "real" database and a toy like "mysql" (which is neither yours nor very good SQL) Imagine two operations concurrently operating on a database, one in the process of modifying the data, the other simply reading it. The first process starts a transaction and makes a lot of changes, then commits the changes. The second query just wants to execute a quick query. The second query gets its data and is done. When the first operation finishes, its changes become available. No one had to wait for anything. In MySQL, the second query would have to wait. As we see in so many MySQL web sites, as the waiters pile up, sooner or later you run out of MySQL connections and start to get error messages. IMHO, one of the reasons why the web is broken is that it is so easy to create content that no one takes the time to learn the basic computer science involved. When things break or perform poorly, they blame everyone but themselves. There is REAL science in computers, if if you ignore it, you'll never do anything worth while.

    2. Re:Postgres by tcopeland · · Score: 1

      > With any Postgres DB you therefore have to manually run a purge

      Hm, with the current PostgreSQL release (8.1.x) there's "autovacuum", which runs in the background and takes care of that for you.

      I'm not sure about the 'invisible copy' thing; I'll let someone more familiar with PostgreSQL internals speak to that...

    3. Re:Postgres by Doctor+Memory · · Score: 1

      Sounds like a performance enhancement to me. Instead of searching through blocks of records, looking for an open slot to stick a new record in, Postgres just sticks the new record in the first available space in the last block. My guess is the "vacuum" process just consolidates the records, eliminating the deleted ones. Compare this with Oracle's "row chaining" issues (where a table row must be split across multiple blocks, necessitating multiple I/Os for a single row).

      ISTR that as of PostreSQL 8, the vacuum process is automatic and runs periodically while the database is up.

      --
      Just junk food for thought...
    4. Re:Postgres by Anonymous Coward · · Score: 0

      Nice FUD.

      Haven't heard of autovacuum in Postgres -:)

    5. Re:Postgres by rawg · · Score: 1

      Dude, upgrade to the latest version and solve that problem. Yes, the 7.x versions had major problems with slowing down due to this. I have a medium sized project that I forgot to vacuum for about 6 months and didn't see any slowdown in it using the 8.x versions. The only reason I found out was that I was doing a code audit and seen that I had it remarked out. The auto-vacuum works very well these days.

      So dump your RedHat/Fedora install, go with FreeBSD and get some performance from your box.

      --
      The above is not worth reading.
    6. Re:Postgres by j.+andrew+rogers · · Score: 1
      The reason PostgreSQL copies every single row on write is that it enables very high ACID transaction concurrency that would otherwise not be supportable -- it is a feature. It is called Multi-Version Concurrency Control (MVCC) and is used by Oracle and, as of the latest version, SQL Server. A big part of MVCC database engine design is how to manage the row version bloat in a fast and efficient manner. While there are a couple different common strategies, they all have not insignificant drawbacks and put the pain in different places. If you compare mature MVCC implementations, e.g. PostgreSQL and Oracle, you will find the "cost" of MVCC expressed in different database operations that reflect their design strategies. TANSTAAFL.

      In recent versions of PostgreSQL, the visible cost of managing the row copies in MVCC has been greatly reduced such that it should be largely invisible for most people most of the time. It is an area of PostgreSQL that is constantly being refined and discussed in development.

    7. Re:Postgres by raehl · · Score: 1

      The feature you are talking about is vital to the proper operation of a real database. The "transactional reasons" you refer too are the difference between a "real" database and a toy like "mysql" (which is neither yours nor very good SQL) Imagine two operations concurrently operating on a database, one in the process of modifying the data, the other simply reading it. The first process starts a transaction and makes a lot of changes, then commits the changes. The second query just wants to execute a quick query. The second query gets its data and is done. When the first operation finishes, its changes become available. No one had to wait for anything. In MySQL, the second query would have to wait. As we see in so many MySQL web sites, as the waiters pile up, sooner or later you run out of MySQL connections and start to get error messages. IMHO, one of the reasons why the web is broken is that it is so easy to create content that no one takes the time to learn the basic computer science involved. When things break or perform poorly, they blame everyone but themselves. There is REAL science in computers, if if you ignore it, you'll never do anything worth while.

      And yet none of that explains why it is necessary for the original record to persist indefinitely. When the change is committed, delete the echo of the record. There's no reason to maintain copies of records in the DB that are never going to be used again. Otherwise, you have to purge them all at once, and queries don't get executed while you're doing that, and start to get error messages.

    8. Re:Postgres by jabbo · · Score: 1

      > I spoke to the developers and was told in a rather snooty reply that they had no plans to allow the user to optionally disable transactional 'features'.

      If you don't need transactions, why are you bothering with a database? Just use a coherent shared-memory cache and dispense with the slowdown from parsing queries.

      It's called a design decision, and the postgres developers decided to focus on features important to people who need transactions. If you really want this 'feature' (non-transactional behavior), and it can't be set as one of the transaction isolation levels, I'm sure they'd be willing to accept a patch from you.

      Or use Postgres' autovacuum features. You aren't, by chance, referring to an ancient version of Postgres that lacked autovacuum, are you? I was under the impression (having used Postgres in some fairly heavy-duty deployments with thousands of concurrent users) that this is exactly what VACUUM takes care of. Autovacuum must be even nicer. I wouldn't know, I seem to use MySQL all the time nowadays unless the task requires a real database.

      Or, hell, you could (gasp) use MySQL. Its original design was focused on non-transactional database needs. It's great for light-duty things where you want to throw them together and not spend too long optimizing queries.

      Use the right tool for the job... maybe postgres isn't the right tool for your jobs.

      That's not really something you can attribute to the tool manufacturers, you know?

      --
      Remember that what's inside of you doesn't matter because nobody can see it.
    9. Re:Postgres by vadim_t · · Score: 1

      You've got to consider concurrent queries.

      In "databases" like mySQL (note, MS SQL Server is included here as well) during a transaction locks pile up, as rows are modified in-place. The result is that it's very easy to shoot yourself in the foot, as if one process is updating a row, another wanting to read it has to wait until it's done. This results in rather lousy concurrency. If you're unlucky enough that a transaction happens to progress slowly while holding locks somewhere important, it can easily lead to the whole database grinding to a halt. Other processes wait for the slow transaction, new ones wait for the previous ones, etc.

      In postgres, readers don't block readers, and don't block writers either. Writers only block each other when accessing the same row. Concurrency is *much* better, and you can do backups by simply doing a SELECT * FROM table. Try to pull that one off on a large mySQL or MS SQL database, and the whole system will grind to a halt until your query is done.

      The price to pay for that is vacuuming the database, but in current versions it's automatic and usually doesn't require extra attention.

    10. Re:Postgres by Anonymous Coward · · Score: 0

      > I spoke to the developers and was told in a rather snooty reply that they had no plans to allow the user to
      > optionally disable transactional 'features'.

      Asking the developers of a transactional database to disable "transactional 'features'" is like asking Ford to give you the option to buy their premium SUV with only two wheels, one seat, and no roof. You don't want an SUV, you want a moped. The transactional nature of a transactional database is not an optional feature; it is an inherent and necessary piece of the software. MySQL may not make claims to be a transactional database and you may not need it to be but asking that others turn their product into something that it's not is sure going to get you some funny looks and a definite "no".

      If you had submitted a patch to make those transactional features more efficient, faster, or more transparent to the user, you would likely have received some better feedback.

    11. Re:Postgres by mlwmohawk · · Score: 2, Informative

      And yet none of that explains why it is necessary for the original record to persist indefinitely.

      It isn't "indefinitely," it is until vacuum is run, and yes, queries run while vaccum is operating.

      Every database that has "multi-versioning" needs some sort of "purge" operation. It is all how and when it is executed.

    12. Re:Postgres by RzUpAnmsCwrds · · Score: 2, Insightful

      which is neither yours nor very good SQL

      Open-source GPL + optional commercial licensing not good enough for you?

      real database

      But maybe we don't need a "real" database. Maybe we need an easy-to-use replacement for flat files with some database features. Not everyone is running a bank, or handling a billion emails a day, or tracking inventory for Wal-Mart. Lots of users just want something that can handle their small little application.

      IMHO, one of the reasons why the web is broken is that it is so easy to create content that no one takes the time to learn the basic computer science involved

      Spoken like a true CS major. CS is a valuable, valuable field - I have nothing but the highest respect for it (which is why I'm getting an ECE degree + CS minor). But the web is not 'broken' - it is the single most valuable informational resource that we have ever created. And the web is useful precisely because you don't have to understand CS to create content. Do you think that there would be 1/1000th of the content on the web if you had to understand CS to contribute to it? No. What we would end up with would be a web that consists entirely of pages created by pencilnecks like yourself and by corporations with big budgets. There would be no Slashdot. There would be no Wikipedia.

      In MySQL, the second query would have to wait.
      Perhaps you should stop using MyISAM and start using InnoDB:
      http://dev.mysql.com/doc/refman/5.0/en/innodb-cons istent-read.html

    13. Re:Postgres by Anonymous Coward · · Score: 0

      There's no reason to maintain copies of records in the DB that are never going to be used again

      It's there because in order to delete the record, you have to move all the data in the file up to cover the hole where the record was. In order to do that, you have to lock the entire table so that nobody reads a row while it is being moved. And the whole thing grinds as each record is read then re-written over the record before it.

      So it sits there until the vacuum you've scheduled during off-peak time.

      Newer versions have an autovacuum server that watches the queries and runs a vacuum when there has been a lot of "churn" in the records so you're not wasting time running vacuum when it wont do anything.

    14. Re:Postgres by MeanMF · · Score: 1

      MS SQL has had row-level locking for many many years now.

    15. Re:Postgres by mlwmohawk · · Score: 1

      But maybe we don't need a "real" database. Maybe we need an easy-to-use replacement for flat files with some database features. Not everyone is running a bank, or handling a billion emails a day, or tracking inventory for Wal-Mart. Lots of users just want something that can handle their small little application.

      If you have a choice between a motecarlo and a mercedies, both were free, which would you choose? Oh, yea, I'll take the chevy. NOT!

      Spoken like a true CS major ...

      I am not, as it turns out, a CS major. I studied CS in the 70s when it was still math.

      Perhaps you should stop using MyISAM and start using InnoDB:

      If you are going to do, you flush any of the so-called benefits of MySQL down the drain.

      Face it, there is no serious technical advantage to MySQL while PostgreSQL has.

    16. Re:Postgres by vadim_t · · Score: 1

      And row locking is exactly the problem.

      Take a postgresql database, run "BEGIN TRANSACTION; SELECT * FROM products" (where products is something referenced everywhere) and leave it like that. It'll work fine, while MSSQL will grind to a halt.

      Every row locking database has dire warnings in the documentation about keeping transactions as short as possible, while with postgresql many people set up psql to automatically start a transaction and keep it until the user manually commits or rollbacks.

    17. Re:Postgres by 14CharUsername · · Score: 1

      Not necessarily. For the tables you need constraints and transactions you use Innodb. For the tables you need performance you use MyISAM. And you can use foreign keys between them. That's the real strength of Mysql, you can choose your features on a per table basis.

      And yes both PostGres and Mysql are free. The software is free. The hardware is another matter, isn't it? If I have to buy twice as much hardware for PostGres to run as opposed to Mysql, its not exactly free anymore is it? I'm paying a lot of extra money for features I don't use.

      What is it about databases that turns people into snobs?

    18. Re:Postgres by mlwmohawk · · Score: 1

      For the tables you need constraints and transactions you use Innodb. For the tables you need performance you use MyISAM

      What happens when you've discovered that your first estimate was wrong?

      What happens when you update a couple tables and one or more of them are ISAM?

      What is it about databases that turns people into snobs?

      What is it about databases that make people disregard all the knowledge, experience, and expertise gained in the field over 40 years of study and implementation.

    19. Re:Postgres by Anonymous Coward · · Score: 0
      What happens when you've discovered that your first estimate was wrong?

      You change the table type. Unless of course you are using Postgres. Then I guess you give up and switch to MySQL.
    20. Re:Postgres by 14CharUsername · · Score: 1

      What is it about databases that make people disregard all the knowledge, experience, and expertise gained in the field over 40 years of study and implementation.

      No one is disregarding anything. Just using the right tool for the job. Sometimes you need a flat file. Sometimes you need a Database. And then there's time you need to use MySQL.

      Would it make you feel better if we said that MySQL isn't a database? We could call it a "constraintless transactionless data file accessible by SQL". Would that make you feel better?

      Regardless of what you call it, its a nice little solution for situations where a flat file isn't enough and a database is too much. Is it really necessary to hire a DBA to maintain a database to store pictures of people's cats?

    21. Re:Postgres by Anonymous Coward · · Score: 0

      From my understanding, this has changed in recent versions of Postgres, where vacuum now just records where the holes are in memory (in the free space map) instead of trying to compact the table. The old vacuum is offered as VACUUM FULL.

    22. Re:Postgres by ClassMyAss · · Score: 1
      As we see in so many MySQL web sites, as the waiters pile up, sooner or later you run out of MySQL connections and start to get error messages. IMHO, one of the reasons why the web is broken is that it is so easy to create content that no one takes the time to learn the basic computer science involved. When things break or perform poorly, they blame everyone but themselves.
      The knowledge that MySQL craps out when you hit it with too much traffic has nothing to do with computer science, it is a quirk of one very specific piece of software. I don't think it's reasonable to blame a programmer for expecting a piece of software to do what it purports to do, or to expect them to divine that it won't perform well because they understand the underlying problem. Having only dealt a tiny bit with MySQL, I did not know up until reading the comments on this article that it handled this stuff so badly - I understand the nature of the problems involved, but I assumed that they were dealt with. I don't think this speaks at all to my understanding of computer science, although it may belie the fact that I don't eat, sleep, and breathe SQL.

      Besides, if a program you write for a thousand users doesn't work very well, I'd blame you, not the user; similarly, if a programming language doesn't work very well for thousand programmers, I'd blame the people who made the language, not the programmers forced to use it.
    23. Re:Postgres by Anonymous Coward · · Score: 0

      Sorry, as a group that uses Postgresql for some reasonable size databases (>500GB), this is really a bad problem with Postgresql that the developers for some reason are loathe to fix. A vacuum blows up disk caching, when what is really needed is an incremental vacuum that runs at low priority and designed not to kill performance.

      Postgresql currently does have a hack to insert some wait time which slows down vacuum allow normal queries to proceed (and to hopefully keep the disk cache mostly filled with useful tables), but it is fundamentally a hack. The cleanup code should be tracking old transactions, and cleaning them up directly.

    24. Re:Postgres by VGPowerlord · · Score: 1

      I take it that MSSQL doesn't implement SELECT... FOR UPDATE like Oracle, Postgres, and MySQL's InnoDB?

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    25. Re:Postgres by mlwmohawk · · Score: 1

      The knowledge that MySQL craps out when you hit it with too much traffic has nothing to do with computer science, it is a quirk of one very specific piece of software.

      And how would one properly evaluate the software, or anything for that matter, if they did not understand the basic principles of what they were supposed to accomplish. Calling scalability and lock contention "quirks" is rediculous.

      Having only dealt a tiny bit with MySQL, I did not know up until reading the comments on this article that it handled this stuff so badly - I understand the nature of the problems involved, but I assumed that they were dealt with.

      That is a poor excuse and if you were caught with your pants down like that in a mission critical environment, you'd be fired.

    26. Re:Postgres by JustNiz · · Score: 1

      Thankyou, that question was exactly my original point except I probably didn't make it clear enough in the original post.

    27. Re:Postgres by vidarh · · Score: 1
      What happens when you've discovered that your first estimate was wrong?

      ALTER TABLE foo ENGINE=InnoDB;

      Thing is for many types of applications transactions are rarely needed, and performance is more important than integrity. People use MySQL because it offers choice and flexibility (particularly with pluggable storage engines), and because finding people with reasonable MySQL skills is easy. People don't pick MySQL because of some idea that it is "perfect" because it's far from it.

      For me, the reason I've never spent much time on Postgres is that I know MySQL well enough and haven't needed to look for alternatives and the perceived potential gain from what I have seen is too small to be worth the investment.

    28. Re:Postgres by mlwmohawk · · Score: 1

      ALTER TABLE foo ENGINE=InnoDB;

      Fine, and how long does that take? 60M+ records?

      Thing is for many types of applications transactions are rarely needed,

      This is fundimentally in error. The only reason why you may think you don't need transactions is because you don't understand them. In addition, it isn't just "transactions" per se' but MVCC, or multi-version concurrency. You NEED this to keep other processes from blocking in high volume.

      For me, the reason I've never spent much time on Postgres is that I know MySQL well enough and haven't needed to look for alternatives and the perceived potential gain from what I have seen is too small to be worth the investment.

      Sorry, this is going to sound like an insult, it may be, however it is not meant as one, but it is very often true. MySQL proponents always seem to argue that ignorance is better than knowledge. If you don't know the benefits, you can't really guage the worth of the investment.

      No one who really knows databases chose MySQL, everyone that argues *for* MySQL admit that they don't know databases. Why do you think that is?

    29. Re:Postgres by vadim_t · · Score: 2, Informative

      It does, but that's really a different matter.

      Under MSSQL, there's no way of reading stuff from a table and not having the possibility of blocking something else or getting blocked. It's a trivial mistake to make, open the Enterprise Manager, load a big view or table and leave it open. The darn thing will keep a lock on the table unless you scroll down to the bottom of the result list.

      You can use the WITH(NOLOCK) hint, but that's crap, as now you get uncommitted data in your SELECT.

    30. Re:Postgres by Anonymous Coward · · Score: 0

      The row is left in place until it is no longer visible from any active transaction. When vacuum runs, it looks at all the rows to see which are still visible and marks as deleted (ready to be overwritten by new rows or versions) those which can not be seen by any active transaction.

      Runnning vacuum does not lock anything, and can be configured to happen automatically or manually when it suits (e.g. after a large set of updates such as a bulk load or reload)

      If told to, it will also analyse the data and update statistics for query planning at the same time.

    31. Re:Postgres by LurkerXXX · · Score: 1

      Huh? I open Enterprise Manager all the time with big views or tables. Others have zero problems reading, inserting, and updating into the table while I'm viewing it. No scrolling down to the bottom needed.

  35. Need a 'series' column by lawpoop · · Score: 1

    I make a living doing LAMP (that's MySQL/PHP) development. I haven't had any data problems with MySQL using version 4.1 to 5.0. Admitedly, I'm not doing fortune 500 work, but I making decent use of the relational features. I looked at Postgres around 2002, but couldn't get past the install and creation of users. I haven't run into a webhost that supports it yet. Basically I have no incentive to really dig into it yet. However, I have found a feature that I would like to see in MySQL.

    I have some tables that need to be arbitratily sort by the user. The sorting isn't universal throughout the table, but rather within a foreign key value. So it would look like this:

    cat_id | sort_order
    1 1
    1 2
    1 3
    2 1
    2 2
    2 3

    It's a big PITA to keep this column properly serialized with the PHP when you want to insert a new value in the middle, or move the values around. I have a restriction to prevent duplicate sort_order keys within the cat_id. I found a serial column type in Postgres. I haven't used it, but it might automagically do that crap I have to take care of in the code.

    --
    Computers are useless. They can only give you answers.
    -- Pablo Picasso
    1. Re:Need a 'series' column by vadim_t · · Score: 1

      The serial type in postgresql is the same as AUTO_INCREMENT in mysql

    2. Re:Need a 'series' column by Anonymous Coward · · Score: 0

      Alternatively you can use a SEQUENCE, the way it probably should be done.

  36. Mod parent up funny! by Anonymous Coward · · Score: 0

    This has got to be the most misguided, unrealistic "complaint" about ACID that I've ever seen. I'm sure your warnings attempting to sow doubt in database admins will go completely unheeded.

  37. Say it ain't so by Von+Rex · · Score: 2, Funny

    Are you saying a Slashdot editor didn't bother to fully read the article and just made up a sensational and misleading headline in order to troll for mouse-clicks?

    I don't believe you.

    1. Re:Say it ain't so by Overly+Critical+Guy · · Score: 1

      You did notice that Zonk posted this, right? That pretty much explains everything.

      For some reason, Slashdot always employs one Dumb Editor (tm) that everybody hates. Before Zonk, it was Michael. Before Michael, it was Katz.

      --
      "Sufferin' succotash."
  38. Re:There ARE other scriping languages besides PHP by masklinn · · Score: 0

    PHP is in fact pretty good as languages go.

    You're joking right?

    PHP is probably one of the crappiest languages alive bar Coldfusion.

    --
    "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
  39. You were lucky! by Anonymous Coward · · Score: 0

    In my day, we had to tatoo our data on our arms with a poison needle, then run our arms through an automated mangler to read it!

  40. Re:There ARE other scriping languages besides PHP by Anonymous Coward · · Score: 2, Funny

    I've been writing Perl for 6 years ....

    Anyone else misread this as "I've been WAITING for Perl 6 for years"?

  41. And in this regard by Mateo_LeFou · · Score: 1

    "It seems the Slashdot editors and contributors get their kicks by watching the comment count shoot through the roof. The only way to do that is to misconstrue the truth to get people infuriated about nothing. Unfortunately articles like these distract from those that warrant relevent discussions." And in this regard /. comes to resemble ordinary media outlets more and more. It's sad.

    --
    My turnips listen for the soft cry of your love
  42. Summary ignores best PostgreSQL mailinglist reply! by Strolls · · Score: 1
    That summary was dreadful, even by Slashdot standards. It completely ignored the reply in which this video demonstrates PostgreSQL performance relative to MySQL.

    Stroller.

  43. Re:There ARE other scriping languages besides PHP by rk · · Score: 1

    PHP5 is actually a halfway decent language... the problem is many web hosts don't have it installed yet and there's a huge body of legacy PHP code that doesn't take advantage of it.

    But you'd probaby still hate it, since you're one of those Smalltalk bigots. :-)

  44. MySQL's problem by Doctor+Memory · · Score: 3, Insightful
    the eternal problem with MySQL
    I think the eternal problem with MySQL is that everyone thinks that just because "SQL" is in the name it's a relational database. It's not. Sure, it's got tables and you can join tables together and use SQL queries, but it wasn't originally designed to do the things that a relational database must do. It was designed to be a quick, easy-to-use database that made developer's lives easier. And from that standpoint, it does well.

    FWIW, the commercial database UNIFY used to be pretty much the same thing back in the mid-80s. They had a wicked-fast ISAM database, and then they wrapped that all up in an SQL wrapper. They were a little more concientious, though, so you had guaranteed atomic transactions and rollback capability and more complete SQL support (e.g., nested/correlated subqueries), so it was truly relational (as the term is generally used). Horrible syntax-based optimizer, though (actually, I'm not even convinced it was an optimizer, it was probably just the way their SQL parser interpreted the query).
    --
    Just junk food for thought...
    1. Re:MySQL's problem by DragonWriter · · Score: 1
      I think the eternal problem with MySQL is that everyone thinks that just because "SQL" is in the name it's a relational database. It's not. Sure, it's got tables and you can join tables together and use SQL queries, but it wasn't originally designed to do the things that a relational database must do.
      Yeah, but then neither was SQL.
    2. Re:MySQL's problem by stonecypher · · Score: 1

      I think the eternal problem with MySQL is that everyone thinks that just because "SQL" is in the name it's a relational database. It's not.

      MyISAM maybe. Welcome to 2003. SAP neé InnoDB is a fine database.

      --
      StoneCypher is Full of BS
  45. and php is not broken? by paulpach · · Score: 2
    This guy has some b*lls, I have had the displeasure of using php for a couple of years.

    Here is a good summary of some of my complaints. But wait, there is more:

    As a programming language, php is extremelly poor. Off the top of my head:

    1. Very poor object oriented language. Not everything is an object, no multiple inheritance, use destructors and you get segfaults, etc... They improved a lot with v5 but still.
    2. No higher order functions. As opposed to Python, Perl, Ruby, and hundred others.
    3. No closures
    4. No operator overloading
    5. No aspect oriented constructs, metaclasses, decorators, nada

    and then there is the issue of all the weird behaviours it has

    1. consider this code:
      $x = NULL;
      $x->a = 10;
      What do you expect to happen? well, an exception obviously. NOT, php guesses you really meant to create an object, assign it to $x and that the object has an attribute a. It does not even issue a warning in the logs. Makes it really fun to debug some programs.
    2. References are just weird. And they are so different from version 4.0 to version 5.0 that it made it imposible to upgrade for an existing project
    3. arrays are passed by value, but objects are passed by reference, WTF?
    4. variables are case sensitive, but methods are not. WTF?

    The language itself seems to promote what Rasmus calls "broken" code. Magic quotes are just an open invitation for SQL Injection, and XSS vulnerabilities.

    For fck sake, the php tutorial teaches how to write cross site script vulnerable code which is what Rasmus is complaining about. WTF?????

    P.S. Forgive my grammar, english is my second language

    1. Re:and php is not broken? by Anonymous Coward · · Score: 0

      "Forgive my grammar, english is my second language"

      we can tell because you misspelt "fuck"

    2. Re:and php is not broken? by Anonymous Coward · · Score: 0
      What do you expect to happen? well, an exception obviously. NOT, php guesses you really meant to create an object, assign it to $x and that the object has an attribute a. It does not even issue a warning in the logs. Makes it really fun to debug some programs.
      Yes, OBVIOUSLY an exception because PHP is built on exceptions, isn't it? Anyway, you are lying, PHP does produce an error:
      "Strict Standards: Creating default object from empty value in .... code on line 2"
    3. Re:and php is not broken? by Anonymous Coward · · Score: 0

      I don't understand your language issues.

      1. Many OO languages don't make everything an object. Those that do are generally criticized for being for OO purists only. No one outside the Java world believes in "OO as the one true paradigm" any more
      2. Many languages don't have higher-order functions
      3. Many languages lack closures
      4. Operator overloading is actually quite rare, and the best current advice is not to use it outside of numerical library code
      5. Aspect orientation is not even a mainstream development paradigm

      You seem to be holding PHP up to an impossible standard. I can't think of a single language that has all five of the things you complain are lacking in PHP.

    4. Re:and php is not broken? by stonecypher · · Score: 1

      Java programmer?

      Very poor object oriented language. Not everything is an object, no multiple inheritance, use destructors and you get segfaults, etc... They improved a lot with v5 but still.

      Not everything should be an object. Welcome to the real world; most of us don't want to be forced into things like that. Multiple inheritance is moot because this is an interface inheritance language. Also, you don't get destructors in segfaults unless your code is crap. Makes one wonder why you think PHP is poor, if you can't even pull off simple usage.

      What do you expect to happen? well, an exception obviously. NOT, php guesses you really meant to create an object, assign it to $x and that the object has an attribute a. It does not even issue a warning in the logs. Makes it really fun to debug some programs.

      1) You can make that issue a warning, if you'd bother to read the manual.
      2) It's not PHP's fault that you don't understand PHP.
      3) It's funny how people will say Lanugage X is bad for having Feature 1, but other people will say that Language Y is bad for not having Feature 1. Here's a hint: we don't all want the same things you do. Don't confuse a language being not what you personally want for a language being bad.

      References are just weird. And they are so different from version 4.0 to version 5.0 that it made it imposible to upgrade for an existing project

      References aren't weird, and their differences between 4 and 5 aren't honestly that big. Most of my PHP/FI code still works in 6 Alpha. Exactly one of my projects needed changes to account for how references now work.

      arrays are passed by value, but objects are passed by reference, WTF?

      Read the manual. It explains why. (Hint: it's because there's no such thing as a UDT.)

      For fck sake, the php tutorial teaches how to write cross site script vulnerable code which is what Rasmus is complaining about.

      Wow, a link that points to nothing at all, and a lack of an explanation. Gee, an introductory tutorial isn't focussed on security. Maybe that's because they're teaching the language first?

      I'd like to know what this vulnerability is.

      --
      StoneCypher is Full of BS
    5. Re:and php is not broken? by paulpach · · Score: 1
      Wow, a link that points to nothing at all, and a lack of an explanation. Gee, an introductory tutorial isn't focussed on security. Maybe that's because they're teaching the language first?
      Fair enough, here is the explanation:

      From the Dealing with forms section in the tutorial:

      Hi <?php echo $_POST['name']; ?>.
      You are <?php echo $_POST['age']; ?> years old.

      They are teaching to just echo the variable that the user might enter. A newbie will follow this pattern in future projects since that is what he is taught. Asume for a second that the name can be entered by any person, and a site's administrator reads this on a page with code looking like the above.

      If a person enters "John doe" for the name, no problem, but if an attacker enters:

      <script>//some trivial javascript to send all cookies to attacker's site</script>
      presto, the attacker can easily steal the session id and maybe something else from the site's administrator. What the tutorial should say instead, if it was not broken according to Rasmus definition is:
      Hi <?php echo htmlentities($_POST['name']); ?>.
      You are <?php echo htmlentities($_POST['age']); ?> years old.
      either that, or filter out the variable on input (htmlentities is cleaner).

      You can read up a lot more about XSS in wikipedia. The tutorial is vulnerable to what they call type 2.

  46. Huh? by 93+Escort+Wagon · · Score: 5, Funny

    "just like you can get better performance from a wheel-less Yugo if you slide it down a luge track."

    I am sick and tired of seeing these sweeping, baseless statements on Slashdot. The body of a Yugo is much too wide to sit flat on the ice of a luge track.

    Editors, please start doing some fact checking before posting this stuff.

    --
    #DeleteChrome
    1. Re:Huh? by theBeak · · Score: 1

      au contraire! It is perhaps YOU who should fact check! EVERYONE knows the accepted width of a luge track is 3m, and that the width of a Yugo is little more than 1.5m. And sitting flat would only INCREASE friction. The somewhat high-and-wide stance of a Yugo in a luge track would provide a bit more thrill to the participants, don't you think? WTF are they teaching you kids in school these days? ANYTHING practical at all?!!?!???

    2. Re:Huh? by darrylo · · Score: 1

      So get a couple of friends, and flip it upside down. Yeah, the roof isn't much smaller, but it might fit on your track. :-)

    3. Re:Huh? by digitalcowboy · · Score: 1

      Yeah. OK. I'm sure there's no bias on this subject coming from a 93 Escort Wagon!

      You'll excuse me if I look to a more objective source for facts concerning the luge capabilities of cheap, sub-compact cars.

  47. mysql not faster by MagicMerlin · · Score: 1

    mysql is *not faster than postgresql, even with myisam tables. postgresql has a much smarter query analyzer and on a query to query level is on par with mysql *if* you prepare the statement first. this wasn't true in the 7.x days, but it is true today.

    1. Re:mysql not faster by Anonymous Coward · · Score: 0

      How do you reliably prepare a query and use it on successive web pages, exactly? Been trying to get that working.

  48. Re:There ARE other scriping languages besides PHP by masklinn · · Score: 1

    PHP5 is actually a halfway decent language...

    Not really, it just piles new debatable stuff on top of the old crap. The fact that you can finally have a somewhat useable OO model does not make up for everything else that's wrong in PHP. Especially since the aforementioned model has been ripped straight from Java (statically explicitely strongly typed language) and hacked into PHP (dynamically weakly implicitely typed language).

    But you'd probaby still hate it, since you're one of those Smalltalk bigots. :-)

    I actually haven't started studying Smalltalk yet (I'm currently working my way through some Erlang and Haskell right now, along with discovering the Django python framework) ;)

    But yeah I still hate PHP5.

    --
    "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
  49. He did *NOT* slam PostgreSQL by Anonymous Coward · · Score: 0

    What he actually said was:'If you can fit your problem into what MySQL can handle it's very fast. You can gain quite a bit of performance.'

    Everybody who knows anything about MySQL and PostgreSQL knows that. It is completely non-controversial. I would expect the PostgreSQL development team to agree with it.

    He implies that in some situations you cannot fit your requirements into what MySQL can handle. Then you need something else, like PostgreSQL.

    There's no story here.

    1. Re:He did *NOT* slam PostgreSQL by Rasmus · · Score: 3, Interesting

      Exactly. But it makes a much more interesting /. story to take an imcomplete account of a talk and further mangle it.

    2. Re:He did *NOT* slam PostgreSQL by leifbk · · Score: 1

      After initially reading about the article on the PostgreSQL mailing list and getting myself really worked up, I was deliberately skewing the highlights in my submission of the story to /. to make it "interesting" enough to get a good discussion. From your postings in this thread, I take it that the article itself seems to have been written by someone who listened with half an ear to your speech. I hope that you will take issue with the author as well as the editors at Internet News for publishing such a sloppy article in the first place.

      --
      I used to be a sceptic. These days, I'm not so certain.
  50. Summary of article by bonch · · Score: 3, Funny

    "PostgreSQL sucks." - From the guy who brought us magic quotes

    1. Re:Summary of article by kimvette · · Score: 1

      I'd consider that insightful, FWIW, If you think it's flamebait, you've been lucky and haven't been stung by magic quotes yet. Key word: yet. Magic Quotes is a great idea, but there are cases where it'll totally screw you up.

      --
      The Christian Right is Neither (Christian nor right). See: Matthew 23, Matthew 25, Ezekiel 16:48-50
    2. Re:Summary of article by GrumpySimon · · Score: 1

      Really what\'s everyone\'s problem with magic quotes anyway?! It\'s great!

    3. Re:Summary of article by marcello_dl · · Score: 1

      Dunno about magic quotes or even PHP. But, one guy who says that you can code equivalent Postgresql functionality using PHP is thinking everybody else has his coding skills. Sure it's possible, but it's better to leave data manipulation to a database, it's better design to do so. Does the guy really expect the average programmer to correctly implement advanced db features in his apps and beat the performance of native postgresql code? And even if he can, is it really worthy to increase complexity and coupling of the app, when hardware performance gets two digit increase by the time the app is finished? It might be possible for somebody like him, working at yahoo, where taking linefeeds out of a web page saves you a couple servers for the reduced bandwidth. But what about the majority of sites and people? I'd start with Postgres, and try out others if performance is not there even after trying tweaking params for performance. And throw away the app language/framework if migrating to a different db is too difficult :D

      --
      ---- MISSING MISCELLANEOUS DATA SEGMENT --- [sigdash] trolololol
  51. signed by Anonymous Coward · · Score: 0

    /approved

  52. Poor Rasmus by hypoxide · · Score: 1

    You certainly are taking some heat here, sir.

    Regardless, thanks for inventing PHP. 3

    --
    Anything can, could, and will happen.
  53. ACID by consumer · · Score: 1

    Sorry to break it to that PostgreSQL fan, but MySQL has had ACID transactions for years now, and it's still faster than PostgreSQL for average web app queries. Time to stop making excuses based on half-truths about ancient versions of MySQL and just acknowledge that MySQL is fast.

    1. Re:ACID by mlwmohawk · · Score: 1

      Sorry to break it to that PostgreSQL fan, but MySQL has had ACID transactions for years now, and it's still faster than PostgreSQL for average web app queries. Time to stop making excuses based on half-truths about ancient versions of MySQL and just acknowledge that MySQL is fast. I get a kick out of this. Yes MySQL has had "ACID" with innodb, but innodb table are much slower than PostgreSQL. When you see benchmarks that show MySQL faster than other real databases, you can be pretty sure they are not using innodb tables.

    2. Re:ACID by consumer · · Score: 1

      Nope. InnoDB tables are faster than PostgreSQL for simple queries.

    3. Re:ACID by mlwmohawk · · Score: 1

      Nope. InnoDB tables are faster than PostgreSQL for simple queries.

      Got any supporting benchmarks? URL?
      What's a "simple query?"

    4. Re:ACID by stonecypher · · Score: 1

      Sorry, consumer, but it's time you had a bit of your own medicine. MyISAM is fast. InnoDB is not. MyISAM isn't ACID. InnoDB is. The speed advantage of InnoDB over Postgres is modest at best. Don't get me wrong, I use MySQL too. But, don't complain about other people making excuses on half truths until you know you're personally working from fact.

      --
      StoneCypher is Full of BS
  54. Re:There ARE other scriping languages besides PHP by finnif · · Score: 3, Insightful

    I've been writing Perl for 6 years now and I've yet to find a more versatile language.

    I've been writing in Perl for 13 years and detest supporting the crap code written by people who think it's applicable to every problem domain.

  55. One word: by Si · · Score: 4, Insightful

    SQLite.

    --


    Why is it that many people who claim to support standards have such atrocious spelling and grammar?
    1. Re:One word: by h3 · · Score: 0

      Seriously.

      This is something I've been mulling over. I use Postgres for important stuff (stuff I get paid for), and because I like it.

      For less important stuff (personal small projects), I use SQLite. It's speedy and I like it. And, it comes standard with PHP5, so once webhosts upgrade from PHP4, everyone will have it[1]!

      I really don't see a place for MySQL in my development. SQLite, by most measures, will spank it in terms of performance for the simple cases, and I don't think anyone will argue that Postgres is in another league as far as data integrity and advanced features.

      I developed an open-source project that is somewhat compatible with all three. Initial development was in SQLite but I switched to using a database abstraction layer (PEAR::DB) in the course of about an hour. I was really pleased to see how smoothly this worked with Postgres. MySQL, was annoying. It's like some bastard stepchild and I had to leave some features out because it doesn't support some fundamental features (views come to mind).

      It's depressing really. Like Microsoft, MySQL "won" in the sense that they own the webhosted space so the inertia will keep them going for a long time.

      [1] This is meant as a joke- they are not upgrading. PHP5 hosts are rare.

    2. Re:One word: by Anonymous Coward · · Score: 0

      In my experience, SQLite is wonderful for small, simple projects, but once you get into large tables (>1m rows), or want to do something like a text search, SQLite's performance starts seriously degrading. Full table scans on a table with 3 million rows due to the lack of any kind of text field indexing is painful, to say the least.

    3. Re:One word: by Tablizer · · Score: 1

      I use SQLite. It's speedy and I like it. And, it comes standard with PHP5

      I've had difficulty getting SqLite to install properly on Windows in PHP5 and noticed in help files that others have also. (I know, Windows sucks, but that is what biz use.)

      But SqLite as a light-duty DB with PostGre as the heavy duty one could indeed make a great set of tools. Projects that max out SqLite could switch to PostGre.

  56. This is not just a two way debate by ChrisA90278 · · Score: 1

    First off it s surprizing how many people, even trainned software engineers don't understand SQL databases. I'd bet that most people writting software today don't know what "normal form" means As I see it a dfesigner has three options not two. Yes you can go faster if you use a stripped down database that lacks important features be coding those features into your aplication. But you can go even faster by not using a data base at all and writing directly to the file system. For simple applications where you only have a few thousand items to track and ONLY your one applacation needs to access that data a file works fine. But when you have many, many tables and each is large and the tables are mostly related to each other and (this is the key) you have many applacations written by diferent organizations that all need to access the data at the same time then yu have no bussines to be using MySQL. Most people however write small, simple software. certainly if you are using PHP you are just backing up a web site. I wonder what his vews on Oracle are?

  57. Can we say owned? by Anonymous Coward · · Score: 0

    This article delivers!

    And is chuck norris approved

  58. Re:There ARE other scriping languages besides PHP by DragonWriter · · Score: 1

    "Good" and "bad" languages are highly subjective, not some kind of universal objective truth. If you like a language that clearly embraces any particular model of programming, PHPs kitchen-sink approach won't have much appeal.

    For large projects, I'd think that approach would also make it very hard to maintain compared to languages with a "cleaner" design, but I'm more of a small-project hobbyist, so I don't really know how big of a difference it makes in practice.

  59. I like Drupal so I will try and comment... by kahei · · Score: 1

    I'm personally curious as to why drupal is, in some ways, such a mess.

    Because it's in PHP. If all that effort had been in a scalable language promoting encapsulation and well-defined interfaces, Drupal would rule the world. Even so, I think of it as a good mess that's messy according to rules that you can figure out in the end.

    All my problems began when I installed the categories module, but now I still have them when it's uninstalled.

    The category module has MANY problems and much of what it does you can do with the far more stable and friendly Views module. Unfortunately, Drupal modules typically do nothing when uninstalled -- in other words, nothing is ever really uninstalled, and the DB tables, nodes etc that Category created for you are still present. IMHO the best approach is to maintain a separate Drupal to test modules.

    But what's worse is that I posted message about this problem, and then bumped it, and have no replies in two days.

    Categories is not a Drupal core module. Feedback on core modules or major modules is often extremely fast and effective, as you can tell by looking at the message histories on the site. However, Categories is more of an 'aspiring Core module' and you shouldn't judge the Drupal community as a whole by the response time on that particular project.

    In sum, Categories really represents the 'wild west' of Drupal. Drupal does have some real problems with static tree-like sites, which Categories tries to address, but I wouldn't say that most of Categories is even beta-quality. The real problem is that outside the Core modules, there's no rating of drupal modules -- even though some (Views and CCK to name but two) are extremely powerful almost a necessity.

    A secondary problem is that because PHP makes it so hard to define an interface, some modules react badly with each other -- this is especially true of modules that have a Drupal 4.6 way of thinking. Like I said in my first post, I wouldn't think of Drupal as heavy duty scalable expandable software. But once you've learned which parts of town to avoid, I really think it's a very flexible and high-productivity small to medium scall CMS.

    --
    Whence? Hence. Whither? Thither.
    1. Re:I like Drupal so I will try and comment... by drinkypoo · · Score: 1

      Do you know of any tools/howtos on migrating drupal content from one drupal to another manually? The export plugin, which doesn't handle all of my chosen content types anyway, is one of the many modules producing blank pages and no errors.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    2. Re:I like Drupal so I will try and comment... by kahei · · Score: 1

      mysqldump :)

      --
      Whence? Hence. Whither? Thither.
    3. Re:I like Drupal so I will try and comment... by Anonymous Coward · · Score: 0

      You people need to take a compiler course. oop concepts are just that concepts, sure there's some languages that provide special features and rules to promote the method but you can do oop with a procedural langauge.

  60. Re:There ARE other scriping languages besides PHP by rk · · Score: 1

    "Not really, it just piles new debatable stuff on top of the old crap. "

    No argument there, but you just can't deprecate everything overnight either.

    "Especially since the aforementioned model has been ripped straight from Java"

    Yeah, I'd like to see PHP's object model more closely emulate Python's. But take that with a grain of salt: I'm one of those Python bigots. :-)

    I think I can be a little more charitable towards PHP, because I started working in IT in an era where it was called DP, and I've seen the COBOL and RPG elephants. *shudder* PHP starts to look really good after you've worked with those eldritch horrors. :-)

  61. lol by Anonymous Coward · · Score: 0

    Like the creator of PHP is in any position to criticize pg, or anything.

  62. Mod Post -1 Troll by RaisinBread · · Score: 3, Insightful

    Isn't this flamewar old enough for people to start ignoring it? Holy cow: the mySQL vs. postgres argument has been hashed and rehashed so long... isn't about time we realized that neither is a clear all-encompassing winner over the other?

    1. Re:Mod Post -1 Troll by mlwmohawk · · Score: 2, Funny

      That's just the thing. MySQL loses on all technical merits, yet the pro-mysql mob refuse to be reasonable. :-)

  63. What is this Fox News? by pfrCalif · · Score: 1
    This is among the most mornic slashdot stories I've ever heard. TFA is a little inflammatory, and Mr. Lerdorf is clearly giving a half tongue in cheek conference talk, but why is the story headed 'PostgreSQL Slammed by PHP'? From the article:
    One performance enhancement that Lerdorf suggested based on code analysis was to use MySQL instead of PostgreSQL for the database. "If you can fit your problem into what MySQL can handle it's very fast," Lerdorf said. "You can gain quite a bit of performance."
    If MySQL help's speed up the code, how is that a 'slam' (My translation: insult)? Is the 'unimpressed' PostgreSQL responding to the performance difference allegation? Or is the "MySQL is not a real database" discussion the way they are headed? Wow this is bad.
    1. Re:What is this Fox News? by Anonymous Coward · · Score: 0

      Yes it is. In other news, Robert Wexler has been found promoting cocaine, claiming that it's a "fun thing to do".

  64. Crap! by killmenow · · Score: 1

    Now that you've gone and made your rational, lucid post...I can't just invoke wit and dismiss PHP (and you in a roundabout way) as so many other quick posters are doing. You do realize you're ruining a perfectly good /. flamewar in the making here, don't you?

    Ahh well. C'est la vie...oh, and BTW, it's always a slow day on /.

  65. Re:There ARE other scriping languages besides PHP by rk · · Score: 1

    ""Good" and "bad" languages are highly subjective, not some kind of universal objective truth. If you like a language that clearly embraces any particular model of programming, PHPs kitchen-sink approach won't have much appeal."

    You speak the truth. I believe that when we start talking about languages in this context, we should all be reading an implied "in my opinion" in front of it. That's why I poked gentle fun at his sig. This is all in the area of developer/design preferences.

    Except for COBOL. That language objectively sucks. ;-)

  66. Thanks by Mateo_LeFou · · Score: 1

    Thanks for coming by to clear things up. On behalf of at least myself, I'd like to apologize for all the badly-informed sneering in this thread. It's usually bad, but not this bad. And thanks for PHP.

    --
    My turnips listen for the soft cry of your love
  67. Re:There ARE other scriping languages besides PHP by plague3106 · · Score: 1

    Great. Now we can have more websites failing because they are built on scripting languages.

    Thanks, did that already. I'll stick with jsp or Asp.net..

  68. Fundimental lack of understanding of databases by mlwmohawk · · Score: 1

    With all due respect, Rasmus needs schooling when it comes to databases, and a few other things for that matter. If he is interested in a serious debate/discussion, I have his email address and he should let me know, I'll contact him. It's only ignorance if you "ignore" what you don't know.

    The problem with MySQL is exactly what he said, that if MySQL doesn't do it, you can do it in PHP. Well, that is just flat out stupid. Dumb. Moronic. A database's job is to deal with data. How many times have I done something easy on PostgreSQL, that MySQL would require a query, PHP work, second query, PHP work, third query, I can't count.

    PostgreSQL is not perfect, and it does have its issues, but it has been my experience that, when used correctly, it out performs the likes of MySQL. Yea, sure, when there is little web traffic, MySQL will do better than PostgreSQL with simple queries, but when you have any traffic and/or any non-simplistic queries, PostgreSQL moves in front quickly.

    1. Re:Fundimental lack of understanding of databases by Rasmus · · Score: 1

      For the 37000th time. I never said a word about emulating any PostgreSQL features in PHP. The emulation comment was completely MySQL-related to get around a limitation that when you use prepared statements MySQL doesn't use the query cache. If you application can benefit from the query cache, then PHP has an option to emulate prepare/execute in PDO. You are reading a half-baked second-hand account of a talk I gave.

    2. Re:Fundimental lack of understanding of databases by mlwmohawk · · Score: 1

      For the 37000th time. I never said a word about emulating any PostgreSQL features in PHP. The emulation comment was completely MySQL-related to get around a limitation that when you use prepared statements MySQL doesn't use the query cache. If you application can benefit from the query cache, then PHP has an option to emulate prepare/execute in PDO. You are reading a half-baked second-hand account of a talk I gave.

      Well, I appologize if I took too litterally a bad report of what you said. In my defense, I responded, I believe, before you clarified.

      I really would, however, like to see less MySQL focus in PHP. I believe that more openness and a more "political" push to be more balanced would make for better quality applications built upon PHP.

  69. Re:There ARE other scriping languages besides PHP by masklinn · · Score: 1

    I think I can be a little more charitable towards PHP, because I started working in IT in an era where it was called DP, and I've seen the COBOL and RPG elephants. *shudder* PHP starts to look really good after you've worked with those eldritch horrors. :-)

    Oh lord. I do understand much better how you can accept PHP after that indeed.

    --
    "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
  70. The good old days! by fm6 · · Score: 1

    Dude, Hollerith cards are for programs. You keep your data on a 9-track tape. That way you know the computer is doing something by the fact that the tape reels are moving back and forth.

    This is an old Hollywood convention, and I was very amused to see it revived on Lost. Of course, I have to suspend my disbelief in order to overlook the fact that these tape drives were still working decades after being installed in "the hatch". And also the fact that they were connected to an Apple II!

  71. Magic Quotes by Anonymous Coward · · Score: 0

    This coming from the guy who's solution to SQL injection was... Magic Quotes, on by default.

    Good job. Lets,
      a) Let inexperienced users pretend there is no such thing as SQL injection, or indeed the idea of caring about user input at all, plus pepper lots of PHP generated pages in spurious backslashes.
    and,
      b) Piss off every experienced developer by making them wrap all their code in Magic Quote detection and associated junk.

    I'm sorry, but the person behind the direction of the abominable PHP language and execution environment is *not* qualified to be making judgements about web security or good coding practice.

    I hear PHP5 actually has a proper database class now with placeholders, like Perl and every other language has done for *years*?
    I bet everyone still uses mysql_*()...

  72. I hate to do it but - MOD PARENT UP by kingtonm · · Score: 1

    ...please, in fact, I'd like to know why it was modded down

  73. Depends what you are doing... by alexhmit01 · · Score: 4, Insightful

    PHP through 4.1 was an AWESOME prototyping language... what it was designed for. Back then, you could POST or GET a form, and the variables were automatically filled in. This was a huge security whole, and therefore plugged, which has made it less useful in some ways, but more production friendly in others.

    However, my old partner when to a PHP conference, and was STUNNED that the recommended course of action was:
    1. Use PHP to prototype
    2. Move all business login into C or C++
    3. Call the business logic from PHP wrapping the C/C++ calls

    While that may be more "correct," that would have massively increased development time.

    Our current cycle is like this:
    1. Prototype in PHP and PostgreSQL in a test database, treating it like MySQL or Access (a retarded database)
    2. Move all validation code into the database with pl/pgSQL, using triggers, etc
    3. Performance tune by creating (using triggers) optimized tables for the live site.
    4. Deploy

    This gets us a lightening fast, reliable system. Unfortunately, for legacy reasons, we have so much PHP code that we've written that migrating to something else (including PHP 5) is hard to justify until we have the budget to get the extra staff just to migrate the system.

    It's more work on the DB side, but it's well worth it.

    One of the performance tunes we've considered: pl/php, which last time we evaluated it, wasn't quite ready for prime time. Our idea: after tuning your database, move all your database access into the database.

    Essentially, for each "page type" on a dynamic site, create a php function that gathers ALL the data you need and puts it into an array. Then, call the Database PHP function getPageType("values to be passed"). The server side PHP function will do all the queries you need, serialize the array, and return it as a TEXT value. Your web page deserializes and displays.

    The reason for this is that you have several delays and resource hogs:
    1. unoptimized queries: before you move things to stored procedures, test your SQL with explain. Add indexes as needed. If you look up on two or three values, create an index on those values... basic stuff, but will get you massive speed-ups.
    2. database connections, to keep this down, put everything on the server into one database and use schemas for access, now you can use persistent connections with a "web" user that connects in persistently and switches as needed (or make your getPage functions accessible to the web user... SECURITY definer, grant execute to the web user).
    3. back-and-forth connections: the best way to kill performance, have a PHP script that calls the database, gets some data, calculates on it, and queries again... the fewer queries to the database a page, the better, less overhead. If you need to do back-and-forth activity, write a stored procedure, then there is a single database call. PostgreSQL lets you write stored procedures in SQL, so there is no excuse not to do it.

    If you are doing a project of any magnitude, (i.e. 2-3 programmers on it), then one of you should learn to play DBA and optimize the database. If you do that, PostgreSQL is a fast moving beast.

    Most performance competitions are MySQL users testing PostgreSQL. However, if you use PostgreSQL like MySQL, it's dog slow. MySQL is a "retarded" database with almost no overhead, so querying the database 15-20 times on a page is harmless. PostgreSQL requires database administration. Once you set up your database right, and tune the server settings (increase buffers, allocate more sort memory, etc.) it screams, but you have to treat it like a real DB.

    If you are just throwing your thoughts up on the web, it's not worth it, but if you are doing a real "small" project, where the license for Oracle, DB2, or even MS SQL Server would be extravagant, PostgreSQL is a great option. (The problem with the real databases isn't just the price tag, it's that they are more powerful IF configured right, so you end up needing a 6-figure DBA, instead of a book on database design and about 12 hours to get used to writing triggers).

    Alex

    1. Re:Depends what you are doing... by Chazmyrr · · Score: 1

      If you are doing a real "small" project, PostgreSQL is a great option, but I'd hardly call SQL Server licensing extravagant. SQL Server Express is free and has all of the features you're likely to use on a small project. If you need to use more than 1 CPU or 1GB RAM for your database, $750 for the Workgroup edition seems pretty reasonable. You don't need a 6-figure DBA either. You should have someone that understands the trade-off between normalization vs. performance and knows how to read query execution plans.

    2. Re:Depends what you are doing... by Anne+Thwacks · · Score: 1

      SQL Server Express is free which is at least twice as much as it is worth. Why use SQLServer when you could use PostgreSQL?
      a) Microsoft has bribed you?
      b) Bill Gates has a shotgun to your head?
      c) You have no experience of a real SQL product?
      Free is WAY overpriced, even for the workgroup edition, especially if you want valid data involving dates.

      --
      Sent from my ASR33 using ASCII
    3. Re:Depends what you are doing... by blueskies · · Score: 2, Insightful

      Does it run under Linux like the rest of my core infrastructure?

    4. Re:Depends what you are doing... by Anonymous Coward · · Score: 0

      In summary:

      If you are an idiot use PHP and MySQL cause 15-20 queries a page won't cost you. But if you are not an idiot you might want to use something else.

  74. Re:There ARE other scriping languages besides PHP by SCHecklerX · · Score: 1

    I never made the jump to trying PHP because perl already meets all of my needs. Specifically, check out embedded perl. Very powerful stuff: http://perl.apache.org/embperl/pod/doc/Embperl.htm

    I've been using html::embperl for about 6 years now, and it works great. It's trivial to modularize (just write your own supporting perl modules). And it takes advantage of mod_perl (pre-load your perl modules as part of the apache process. Good stuff!). Of course, you also have all of CPAN at your disposal this way too.

    embperl does some nice escaping and such by default, adding some security benefits.

  75. XSS wtf? by paulpach · · Score: 2, Funny

    Excuse me Rasmus, but aren't you teaching how to write XSS vulnerable code in your php tutorial?

  76. Vacuum is a mess by alexhmit01 · · Score: 1

    One of the problems with the old 7.x series vacuum, is that if you ever end up 1 record over the vacuum memory allocation, then it doesn't properly vacuum it. This means that you are going about your business, vacuum analyze every night, and all of a sudden, your database explodes and fills the hard drive, because old tuples are never cleared out. This is particularly a problem if you have "scrap tables" where the data is constantly deleted, updated, and reinserted... while this isn't reasonable for normalized data, sometiime we have "data cache" tables managed with triggers that store LOTS of data.

    If you catch it in time, no problem, but otherwise, you get real problems. Once you get big, you need to vacuum full to avoid this. That's all well and good, but vacuum full can leave the database unavailable while run... this is a problem for a web server database. We can use it on our internal machines no problems (run it Sunday morning, nobody is working then), but it's a problem.

    PostgreSQL 8 looks good, but I'm a little scared to migrate ALL the data that we have, and most importantly, screw up any messy optimizations that we've made that made sense on the PostgreSQL 7 engine but not the PostgreSQL 8 engine.

    Alex

  77. Re:There ARE other scriping languages besides PHP by tacocat · · Score: 1

    No argument there, but you just can't deprecate everything overnight either.

    Bullshit! I see Microsoft do it all the time...

  78. Re:There ARE other scriping languages besides PHP by ajs318 · · Score: 0, Redundant

    It's obvious just whose bastard son PHP is .....

    PHP takes care to keep things consistent, which is important for easing beginners in gently; Perl is not afraid to eschew consistency where it makes sense to do so. For instance, PHP's regex matching and substitution functions, derived from Perl, are incredibly tedious. In Perl, you're likely to be doing a lot of regex matches: the syntax is such that you just drop 'em in, and let the parser worry about them. No other language I've encountered lets you do that. Even in Python you have to jump through hoops to do what Perl makes simple, and Java seems to go all out to discourage you from bothering with regular expressions.

    Some things about Perl are a bit finicky, especially where they involve getting close to the metal. Take for instance the four-argument select function (the one for seeing which file descriptors are ready to present data, expecting data or have just done something they shouldn't, not the one you use for selecting a filehandle for output.) It expects its arguments to be bitmasks created with pack "i", $bits -- you can't just use, say, integers and have them automagically turned into bitmasks. While that sounds a bit un-Perl-like, you have to remember that there are 8999 integers represented by 4-byte strings (and so indistinguible from 32-bit bitmasks). What you really should do is create a wrapper function around select, which takes its parameters (and returns its results) in a more convenient form for the program you are writing.

    --
    Je fume. Tu fumes. Nous fûmes!
  79. ACID? by Matey-O · · Score: 1

    Analysis Console for Intrusion Detection? Does it run faster on postres?

    --
    "Draco dormiens nunquam titillandus."
    1. Re:ACID? by Kjella · · Score: 1

      Atomicity
      Consistency
      Isolation
      Durability

      If you need a relational database, you want these. If you want flatfiles with SQL syntax, you don't. You can read the details here>.

      --
      Live today, because you never know what tomorrow brings
  80. compared the article to the summary by nuzak · · Score: 1

    Hmm... I apologize for using the term "mealy-mouthed" and reassign the label to Leif Kristensen, the submitter of this article (and I'm still probably using the term wrong, oh well).

    I still hate the language, but slashdot running this article is ... eh, who am I kidding, it's typical. Some days I'm kind of sorry I legitimize slashdot by adding anything to it at all.

    --
    Done with slashdot, done with nerds, getting a life.
  81. MySQL doesn't scale by orthogonal · · Score: 5, Insightful
    I recently did a little consulting project for a company with a MySQL database. I was left unimpressed.

    Basically, they needed to aggregate data from about 56 million rows in table, and required a self-join as well. I got the consulting contract because this was taking at least six days to complete.

    Inputting the 56 million records took about a hour; this included creating three indices.

    So far so good. At that point, to make in run faster, I wanted to pre-calculate and deformalize the data the self-join would give. I'd already included columns for this denormalized data in the table, so it was pretty much
    update datatable a set a.denormed = (select max( b.foo ) from datatable b where a.customer_id = b.customer_id)


    A simple correlated subquery self-join in a update. Low and behold, MySQL doesn't allow this,. at all:
    "Currently, you cannot update a table and select from the same table in a subquery." (MySQL official documentation, 13.2.10)


    Ok, so instead of a subquery we can do a join, but that means we have to throw away the max() operation. Without the max predicate we're doing 1-to-Many joins on b where there is more than one row matching our criteria, and so we're potentially doing multiple updates (all but one of which gets "thrown away") to a row.

    Ok, so far so good.

    First time around, I included the demoralized column in an index, and of course the update changed the column values. If I dropped and re-created the index, MySQL took about four hours to re-index (four times the time it took to make the index when it BCP'd it in). But if I repaired the index, rather than dropping it, well, it never actually completed, becasue after two days I killed it. What the hell?

    Finally, to display the data, I needed to do some date manipulation, a lot of it repeated. In pg, I'd have written the code once, in a user defined function. In MySQL, that requires compiling a shared library, so instead I repeated these rather long calculations in a select. Tedious and error prone. (In MySQL's favor, the built-in date functions are a lot cleaner than T-SQL's.)

    Eventually I got a six-day or longer process down to three hours, but it wasn't pretty.

    So long story short: a business goes with MySQL because it's "fast". At a certain point, it ceases to scale, and you have to perform "heroic measures", denormalizing and pre-calculating. The index repair is a mess. You can't easily encapsulate code in functions or, prior to 5.0, views. It's no longer fast, and your mission critical business requires calling a consultant to optimize what was perfectly good code before the table size grew.
    1. Re:MySQL doesn't scale by kevin_conaway · · Score: 1
      First time around, I included the demoralized column in an index, and of course the update changed the column values. If I dropped and re-created the index, MySQL took about four hours to re-index (four times the time it took to make the index when it BCP'd it in). But if I repaired the index, rather than dropping it, well, it never actually completed, becasue after two days I killed it. What the hell?

      Geez, its just a silly column. Why did you have to treat it so badly?

    2. Re:MySQL doesn't scale by Just+Some+Guy · · Score: 1
      Basically, they needed to aggregate data from about 56 million rows in table, and required a self-join as well. I got the consulting contract because this was taking at least six days to complete.

      At that point:

      cursor.execute('select * from stupidtable')
      for row in cursor.fetchall(): dosomething(row)

      56 million rows is small enough that I wouldn't have waited for MySQL to chew through it.

      --
      Dewey, what part of this looks like authorities should be involved?
    3. Re:MySQL doesn't scale by DancesWithDupes · · Score: 1

      > First time around, I included the DEMORALIZED column in an index ...

      Wow, that mySQL REALLY doesn't know how to treat its data. The company didn't need a consultant, it needed a therapist!

    4. Re:MySQL doesn't scale by orthogonal · · Score: 1

      I'm not sure. The guy who hired me to consult explained that that was how he'd originally gone about it. Only after that took forever, did he write a self-join that took six days. But I didn't see his cursor code.

    5. Re:MySQL doesn't scale by archeopterix · · Score: 1
      I'm not sure. The guy who hired me to consult explained that that was how he'd originally gone about it. Only after that took forever, did he write a self-join that took six days. But I didn't see his cursor code.
      Well, if he just queried the table for each row, then blah. But there is a way to implement a join outside a database without O(n) queries - get both datasets (or, in case of self-join, the same dataset with 2 independent cursors) sorted on the join expression and merge on the fly, scrolling both cursors forward. It is a hack, and it shoud be only useful in special cases - if you are joining on an expression non-obvious to the query optimizer, if your db doesn't support indexes on expressions or if it just plain sucks.
    6. Re:MySQL doesn't scale by sneakerfish · · Score: 1

      I will have to agree that most companies hear that mysql is fast, so they go with it. After all we want a fast web site, so the database had better be fast. We can argue about bandwidth to the customer, or the app server, etc. being the ultimate bottleneck, but the promise of speed is sexy and sexy sells.

      But what is the cost? MyIsam has table level locking which bites when you have a long running query or batch update and another OLTP application which gets locked out until the batch job finishes. It also sucks when someone accidentally inserts a value greater than 2^32 into an INT column and mysql quietly truncates it without throwing an error. Same with inserting dates like '2000-02-31' or even '0000-13-44'. Ironically this is the type of data validation which Rasmus? was speaking about. I think this is why he was recommending validating data in the application code. If you don't validate it there

      The somewhat sketchy SQL support is another area of concern. There are workarounds here, but you end up jumping through some mysql specific hoops go get things working. I have had to do a lot of creating temporary tables to get around the crummy subselect support as you know. Don't get me started with repairing broken tables.

      What DOES work fairly well in Mysql is the replication. It really helps scalability to spread all those requests across several machines. That being said I did break replication by dropping a test database which did not exist on the slaves (why should they care if they cannot execute drop database on a database which does not exist. But then again, this is a trade off of of correctness and robustness at the expense of speed.

      Mysql is easy to set up in the first place, but it is difficult to maintain in a production environment. For example, things get really weird when you start mixing storage backends. Taking consistent backups and dealing with transactions and locking get hairy. The documentation is splintered with details about certain things like tuning parameters in many places and no clear way to get the entire story in one place. Maybe this is just my problem.

      I have been using Mysql for a long time and I was quite pleased. I came from an oracle background and the price performance could not be beat. At one time I wrote a great circle distance user defined function to do geospatial queries. For the longest time I did not miss foreign keys or transactions. I had all that logic in my application (for the good and bad of it). But then I needed real transactions and I wished my database threw an error when some nonsense data got inserted. Now days I am leaning towords using postgres.

      One final thing to note is that postgres is licensed under the BSD license. This means that if you are working on an appliance type application, you should consider using postgres and saving yourself a whole lot of licensing fees.

    7. Re:MySQL doesn't scale by orthogonal · · Score: 1

      Yes, sure, that'll work, and yes it's O(n) once the database has sorted it, and yes, I've used that algorithm in cases when I didn't have a database handy, as on embedded systems. But if you need to do that with an RDBMS, you need to be questioning why you're using that RDBMS.

    8. Re:MySQL doesn't scale by Etcetera · · Score: 1

      That being said I did break replication by dropping a test database which did not exist on the slaves (why should they care if they cannot execute drop database on a database which does not exist.

      Not going to argue too much with you, but this is a feature-not-a-bug. DROP TABLE returns an error if one or more of the tables don't exist. Errors cause replication halting. That's why DROP TABLE IF EXISTS is there.

      http://dev.mysql.com/doc/refman/5.0/en/drop-table. html

  82. Re:There ARE other scriping languages besides PHP by Phillup · · Score: 1

    I've been writing in Perl for 13 years and detest supporting the crap code written by people who think it's applicable to every problem domain.

    Hell, I detest supporting code *I* wrote even three years ago.

    Not because the language is bad, but because the language is so rich that I learn more and better ways to do stuff all the time.

    Some times it is really hard not to rewrite something simply because the old way I did it seemed so... uninformed.

    And, yeah... every problem I solve is done so with Perl.

    Thing is, I don't solve problems that shouldn't be solved with Perl... I pass those off to someone else.

    As someone once said: The trick is to use Perl's strengths, not it's weaknessess.

    --

    --Phillip

    Can you say BIRTH TAX
  83. Con. text. by Anonymous Coward · · Score: 0

    Hooray for taking shit out of context and blowing it up to pachydermal proportions.

  84. Re:There ARE other scriping languages besides PHP by mystik · · Score: 1

    We too have used Emberl 1.3.x for 6 years, and we keep find all sorts of bugs with it. It has a heavy .xs layer, and have had many problems with Seg Faults. We're stuck with it for now because of legacy, but we're planning a move in the near future to Tempate Toolkit,

    I'd strongly suggest
    • Mason - Mason's syntax almost looks like php's <% %>, but it's perl.
    • Template Toolkit - Another great templating language, it encourages you to seperate your code from your template, which is a good thing.
    --
    Why aren't you encrypting your e-mail?
  85. If you think I'm an elitist? by LWATCDR · · Score: 1

    Nope I have thrown together data structures that I was forced to live with later :(
    PERL! code in c like a real man!
    Just kidding. Yes programing is been reduced in many cases to looking up the function. PHP is handy for quick projects. I am working with a CMS written in PHP not because I like PHP but because the CMS is so good. I had to drop a really nice CMS that was written in Python from consideration because it didn't use MySQL or Postgres but it's own database. One really nice thing about using MySQL, Postgres, or SQLite is simply the ease of access in a variety of languages. I can write a utility in PHP, Python, Perl, Ruby, or C that can easily pull data out of and push data into a SQL database.
    Have a choice of good tools is great. PHP is a good tool. It just isn't a great one.

    --
    See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    1. Re:If you think I'm an elitist? by Anonymous Coward · · Score: 0

      BTW, you can use a RDBMS back-end for Zope (that's the CMS I think you're referring too; it's the DB for plone).

    2. Re:If you think I'm an elitist? by LWATCDR · · Score: 1

      I did not know that. How well supported is it. I may load that up on the test server next to see if it can replace drupal

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
  86. Stupid idiot searching for a flame war by C_Kode · · Score: 1

    I don't think he really SLAMMED PostgreSQL. This guy is just like the media. He is looking for controversy. A lot of what he said is true to a point and he didn't say "Don't use PostgreSQL". He said that general purpose MySQL is in fact faster than PostgreSQL and I be damned. For the most part IT IS!

    Look at this response: Turn fsync off and try again. Don't expect your data to stay consistant
    tho.
    Yep, then their is a big BUT. MySQL is fast. If you don't need PostgreSQL, but need the fastest possible speed. MySQL is a good choice. If you can emulate a feature with PHP and it be much faster than using PostgreSQL over MySQL. BINGO! You don't HAVE to use PostgreSQL, but you DO NEED to use the best tool for the job.

    1. Re:Stupid idiot searching for a flame war by Anonymous Coward · · Score: 0

      >> This guy is just like the media.

      Yeah. He's a fascist asshole spreading propagnda and disinformation in order support a system that has done nothing but harm to the human race. Anyone who uses PHP or MySQL outside of their junior high school special education class ought to be shot in the face for impersonating a software development professional and criminal incompetence.

    2. Re:Stupid idiot searching for a flame war by C_Kode · · Score: 1

      Anyone who uses PHP or MySQL outside of their junior high school special education class ought to be shot in the face for impersonating a software development professional and criminal incompetence.

      That or you should.

    3. Re:Stupid idiot searching for a flame war by stonecypher · · Score: 1

      This guy is just like the media. He is looking for controversy.

      Actually, he never said any of this. The media said it. It's not that he's like the media. It's that it's the media you're listening to. Insert Chris Rock joke about looking over one's shoulder at the MAC machine here.

      --
      StoneCypher is Full of BS
  87. SQL sucks by Sloppy · · Score: 2, Insightful

    Sarcasm or not, I half agree with that.

    Today's problem isn't that databases are bad, it's that we use a textual language to interface with databases, and it blurs the line between data and code.

    SQL sucks.

    --
    As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
    1. Re:SQL sucks by Bastian · · Score: 1

      While I have to agree that SQL can be an annoying language, I have to wonder what you have against a textual querying language.

      The only real alternative to text that I can think of would be some sort of drag-and-drop system for creating queries with flowcharts or something like that. But there are two big hits against that idea. First, it wouldn't work well with any major programming languages, all of which are textual. Second, I've done some work with that kind of scheme for writing programs - I've even created my own mini graphical programming language - and so far I have yet to meet one that isn't either extremely limited or hard to work with. Which isn't to say that a decent graphical language is impossible, just that the state of the art isn't nearly up to snuff yet.

    2. Re:SQL sucks by julesh · · Score: 1

      Yeah, but so far the only alternative to a textual query language I've ever seen is ADO.net.

  88. Re:There ARE other scriping languages besides PHP by Anonymous Coward · · Score: 0

    PHP takes care to keep things consistent

    You could have fooled me. PHP has one of the least consistent libraries of any programming language ever created.

  89. Re:There ARE other scriping languages besides PHP by VGPowerlord · · Score: 2, Informative
    No, this myth comes from the PHP manual, which says
    PHP succeeds an older product, named PHP/FI. PHP/FI was created by Rasmus Lerdorf in 1995, initially as a simple set of Perl scripts for tracking accesses to his online resume.
    --
    GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
  90. Re:There ARE other scriping languages besides PHP by pabs · · Score: 1

    10 years and ditto.

    --

    Odds of being killed by lightning and winning the lottery in the same day: 1 in 2^55

  91. Re:There ARE other scriping languages besides PHP by Foofoobar · · Score: 1

    Yes he did... and thats why he created another language. *buh dum dum*

    I'll be here all week. :)

    --
    This is my sig. There are many like it but this one is mine.
  92. Slammed? I think not. by sherriw · · Score: 2, Insightful

    RTFA geez. The artitcle was not about postreSQL, it merely mentioned it. He didn't slam it at all or even state that you shouldn't use it. Simply said that if desired you may be able to avoid using it and emulate missing features of mySQL using php. He was illustrating the capabilities of php, not slamming postreSQL. By the way, many hosting providers provide mySQL but not postgreSQL so it may be useful to work around not having it.

    Where did the title for this slashdot post come from? The couple sentences that mentioned postreSQL? What about the rest of the article? Stop being drama-queens. Slashdot needs more serious posts- not this flame-inducing crap.

  93. PostgreSQL is faster than MySQL by cecom · · Score: 1

    In my tests PostgreSQL is consistently faster than MySQL and scales much better for multiple CPUs (which matters a lot!!!). Also see this indipendant article: http://tweakers.net/reviews/646/10 - you will notice that not only PostgreSQL is faster than MySQL to begin with, but it gets even faster with HypterThreading and so on.

    In my professional opinion there are absolutely no reasons to ever choose MySQL over PostgreSQL. The latter is completely free (as opposed to dual licensed), much more powerful, more standard compliant, faster, and better documented.

    1. Re:PostgreSQL is faster than MySQL by stonecypher · · Score: 1

      Given that essentially everyone else's tests say the opposite, I think it would be appropriate for you to make yours public. As far as the hyperthreading, maybe that's because they're not using the hyperthreaded build? Who can tell? They don't give adequate data on their testing rig. We can't even tell if those two databases were built in the same compiler.

      In the future, if you want to talk about your tests, either let us see them, or please spend your time walking. My tests show you're a twelve foot tall green woman with sticks for hair. Tests can show anything until the rest of the people on the web can say "well, there's your error, you're testing a children's book instead of the other slashdot user."

      --
      StoneCypher is Full of BS
  94. Validating Input vs. Inexperienced Developers by billstewart · · Score: 3, Interesting
    "You don't know that you have to filter user input," Lerdorf exclaimed.
    Lerdorf advised PHP developers that nothing that comes across the wire is to be trusted.

    It shouldn't be necessary to say that, but unfortunately it is. When I took Computer Science 100 in college 30+ years ago, the first lesson about inputting data was that you have to validate it before using it, because it's guaranteed that your program *will* be given bad data sometimes, and will occasionally be given maliciously bad data, and part of the grading process on programs was to run them on the professor's data set, which was malicious, especially at testing off-by-one errors and other boundary conditions. But enough other people didn't get that as part of their education, either in school or learning it the hard way in practice - sigh.

    --

    Bill Stewart
    New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
    1. Re:Validating Input vs. Inexperienced Developers by Anonymous Coward · · Score: 0

      Too true, and PHP is a shining example of how to miss an opportunity to make sure it's done automatically. And the amusing thing is, the rationale is that it avoids doubly-encoded data. You know what, doubly-encoded data is safe. Zeroly-encoded data is not.

      In practice, a large part of why the web is broken is due to honking great design flaws such as these in PHP. That and "everything's a global".

    2. Re:Validating Input vs. Inexperienced Developers by beebware · · Score: 1

      I think it's because it's so boring/time consuming to check data. To be really secure, you can't trust anything - user input, database data, file data - it's all got be validated. And in these days of XSS attacks, you can't provide any potential dangerous data to the end user as it could be used to exploit the application (so strip out any dangerous angle brackers, don't forget that UNICODE etc poses its own risks etc). I know the billing system I'm writing at the moment is mainly "is this data sane?" tests at every chance "just in case" (as if the admin messes up the smarty templates, I can't afford for that to somehow, 3 pages later, allow another user access to another users data). It's hellish, but it's got to be done and if I had a fixed timescale to do it in, I doubt my boss would approve of the time needed to code in the validation routine(s).

    3. Re:Validating Input vs. Inexperienced Developers by jonadab · · Score: 1

      This is where Perl's taint checking comes in really handy. It does not solve all problems, but, used properly, it can sure help catch some common ones.

      --
      Cut that out, or I will ship you to Norilsk in a box.
  95. HaHa! by TheCabal · · Score: 1

    This always makes me giggle.

    This holds especially true on Slashdot, but still applies to other discussion groups... whenever someone mentions Technology X, and talks about it in other then glowing praise, it's always considered to be an attack on said Technology. There is only one exception to this rule, and that is when it comes to anything Microsoft, in which it automatically sucks. Hooray beer^H^H^H^H GroupThink!

    1. Re:HaHa! by stonecypher · · Score: 1

      ... beer think?

      --
      StoneCypher is Full of BS
  96. Favourite Comment by Bob+Uhl · · Score: 2, Insightful
    My favourite comment is this one:

    PHP makes "wrong things" easy, and "right things" hard.

    Evidence: "addslashes", "register_globals" and "magic quotes".

    More evidence: PHP Nuke, phpBB, PDO vs PEAR DB.

    Taking his advice on software is like taking a coprophagist's advice on fine dining.

    Couldn't be more correct. I've done a little PHP hacking when I'd no other choice--it's to be avoided when possible. For what it was meant for initially, it's not too shabby, but as a general solution it's...lacking.

    It's not really surprising that the author of PHP would think that the things PostgreSQL buys you aren't worth it. You know, little things like integrity, reliability and stability. Who needs those? Not anyone writing in PHP, certainly.

  97. Can this guy by MemoryDragon · · Score: 1

    Kill off php please and shut up. PHP has the history of being one of the lousiest worst designed languages ever, with slowly catching up to modern standards. I have to deal with that absymality of a language every day, and curse it every day....

  98. Re:There ARE other scriping languages besides PHP by Tumbleweed · · Score: 1

    Oh, man, a _Perl_ programmer talking about the _elegance_ of another language.

  99. It seems strange. by funwithBSD · · Score: 1

    Why would you recommend coding to a specific database and not code to SQL and not worry what you have on the back end?

    Binding yourself to a particular technology to get more speed is just wrong. Write code that is generic to the back end and get your speed inside your code, not the database choice.

    The database should optimized by the DBA by adding views/indexes/optimized SQL or more hardware to get the speed.

    --
    Never answer an anonymous letter. - Yogi Berra
    1. Re:It seems strange. by VGPowerlord · · Score: 1

      Why would you recommend coding to a specific database and not code to SQL and not worry what you have on the back end?

      Binding yourself to a particular technology to get more speed is just wrong. Write code that is generic to the back end and get your speed inside your code, not the database choice.

      The database should optimized by the DBA by adding views/indexes/optimized SQL or more hardware to get the speed.


      Please explain how an application can have both generic and optimized SQL.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    2. Re:It seems strange. by funwithBSD · · Score: 1

      The SQL optimization is not in the code, it is in the database. Oracle and DB2 can analyze the incoming SQL and can recommend optimized SQL or recommend changes to the tables for the statements depending on which is possible. If you don't have access to the code, then you will need to change the Database as a DBA.

      That said, some of our in house datamining code will use several different ways of formatting SQL statements that do the same thing and then choose the one that is most effiencent. I am not an SQL expert, I just listen to the ones we have.

      One thing I can say from a systems view of what some programmers do with SQL: Don't do the trimming of the data at your code, do it in the SQL statement. Don't ask for 100 lines when you need 10 and then use a loop to toss out the extra stuff.

      --
      Never answer an anonymous letter. - Yogi Berra
  100. This article would be a whole heck of a lot better by XO · · Score: 1

    ...if it actually said something. It tells of what he talked about. What we really need is a much better article, or a transcript of the actual speech, considering that it sounds like he had many useful and interesting things to say, but they aren't being said to anyone unless you got to go to the conference.

    --
    "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
  101. Re:There ARE other scriping languages besides PHP by localnot · · Score: 1

    The original released version was C. The language itself copied some PERL functionality.

  102. Re:database usually more robust than apps that use by leifbk · · Score: 2, Funny

    Play around with ACID, and you're liable to take a header out the window !!

    Dude, that's another kind of ACID. It's database ACID (Atomicity, Consistency, Isolation, and Durability), not the stuff that people got high on in the sixties. Concerning the latter, there actually have been unsubstantiated rumors about people who imagined they could fly and took a dive through the window.

    --
    I used to be a sceptic. These days, I'm not so certain.
  103. Slashdot by DesertBlade · · Score: 1

    Doesn't Slashdot use MySQL still??
    http://www.mysql.com/news-and-events/success-stori es/slashdot.html/ and http://slashdot.org/faq/tech.shtml#te050/ look for (MYSQL).

    If it is good enough for SlashDot then it is good enough for me.

    --
    Half of writing history is hiding the truth.
    1. Re:Slashdot by Anonymous Coward · · Score: 1, Interesting
      Yes, slashdot uses MySQL. But a couple months ago, the entire site was down for 6 hours so they could add a new field to the comments table. When I added a new field to a Postgresql table (1.5 billion rows), it took 15 minutes, and the table was still usable while it was happening.

      Since most everything you see is cached, it's more accurate to say they're using flat files.

  104. Zend's ZActiveRecord Boondoggle by SimHacker · · Score: 4, Insightful

    The creators of PHP are morons, and their support company Zend is dishonest and incompetent. The ZActiveRecord boondoggle demonstrates exactly what I mean: They can't program their way out of a paper bag, an don't even understand the limitations of the very language that they haphazardly "designed".

    It makes me laugh that Lerdorf would slam Postgres, because the PHP designers have no understanding of object oriented programming or databases: instead they invent half baked cargo-cult designs, which are naive reactions to other systems they don't understand: they try to ape their surface features without understanding the reasons behind the way they're designed.

    PHP references were thrown in as a band-aid to work around the horrible design flaw that arrays and objects were foolishly DEEP COPIED by default. If you pass or return an array from function to function, its contents are DEEP COPIED, which is EXTREMELY inefficient and leads to all kinds of horrible bugs because it's the last thing a sane programmer would expect. So instead of fixing the design flaw in PHP, they add "references" that LOOK and SOUND like C++ references, but actually are completely different, again misleading programmers into thinking they understand what's going on, but working totally differently than a sane person would expect. PHP references are actually half baked symbol table references. The sloppy implementation caused many bugs that CORE DUMP PHP! PHP references were so poorly thought out and badly designed, that there were many edge conditions that they hadn't considered, that simply didn't work together, caused memory leaks and core dumps, and had useless and confusing semantics: callers passing references, functions declaring that they take references, functions returning references, etc. Compare that to C++'s simple and consistent definition of references in term of pointers. The only way to make a PHP reference to an object is to put it in a variable -- you can't make a reference to a field of an object or the return value of a function without storing it in a temporary variable -- totally unlike C++, and totally stupid.

    PHP's object oriented programming system is a half-baked imitation of C++'s object model, haphazardly designed by charlitans who had no clue about the fundamentals of object oriented programming, elegant language design or efficient implementation. First of all, if you're going to try to imitate an existing design without understanding it, then for god's sake, at least imitate a language whose object system doesn't suck, and a language that has similar semantics to the language you're trying to kludge. C++ is a static compiled language, and its object system deeply reflects that fact. (That is to say, there's very little reflection beyond RTTI, because the compiler throws all the interesting stuff away! And C++'s oop design had to make many horrible compromises because the C++ object system was designed to map directly into C semantics [since the original C++ compiler compiled C++ into C.]) Most of those C++ design decisions make absolutely no sense for a dynamic interpreted language like PHP. (Many of them made very little sense for C++ itself, but even less sense in the context off PHP.)

    One prime example of how PHP screwed up its object system, is that they blew it on static methods, in a way that makes it impossible to properly implement an ActiveRecord-like ORM (among other us

    --
    Take a look and feel free: http://www.PieMenu.com
    1. Re:Zend's ZActiveRecord Boondoggle by Dr.+Dysphora · · Score: 1

      Geez, this only got rated a "3" when it should be a 6!?
      As a long-time Perl teacher, my students are always coming
      back to me in awe and wonderment wondering why anyone with
      good Perl knowledge would use a language, PHP, which is
      "Severely Underpowered Perl for Dummies"??

      I've been teaching Perl and Advanced Perl for 10 years and
      the whole PHP phenomenon mystifies me. I suspect that the
      prosaic truth is that a large proportion of PHP'ers are
      overwhelmed by Perl because they're not really adept
      programmers while accomplished Perl programmers just find
      PHP infuriatingly limiting.

      Gee, let's keep creating dumbed down, "knock-off" languages
      so we can go lower and lower and lower on the IQ scale until
      people with an IQ of 80 can be "programmers".

    2. Re:Zend's ZActiveRecord Boondoggle by VGPowerlord · · Score: 1

      As a long-time Perl teacher, my students are always coming
      back to me in awe and wonderment wondering why anyone with
      good Perl knowledge would use a language, PHP, which is
      "Severely Underpowered Perl for Dummies"??


      Perl's performance for CGI is bad without some sort way of increasing its speed. The major options for this are:
      - Apache and mod_perl - This can work transparently, but if you look at it funny, it breaks.
      - FastCGI - which isn't transparent by any stretch of the imagination.
      - SpeedCGI - Same problem as FastCGI.
      - PPerl - which isn't necessarily written for use in CGI.
      - Rolling a custom http server using HTTP::Daemon or Socket. Which is a really bad idea.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    3. Re:Zend's ZActiveRecord Boondoggle by Etcetera · · Score: 1

      Perl's performance for CGI is bad without some sort way of increasing its speed. The major options for this are:
      - Apache and mod_perl - This can work transparently, but if you look at it funny, it breaks.


      Agreed... hate it.

      - FastCGI - which isn't transparent by any stretch of the imagination.

      I'll take your word on this one -- I've never used it.

      - SpeedyCGI - Same problem as FastCGI.

      Have to disagree with you on this. As long as your code is already use strict compliant, you shouldn't have to make any changes at all to get things running under SpeedyCGI. I've used it in quite a number of locations, both in a CGI context and for regular sysadmin and mail server duties, without any sort of mind-bending issues (except for if I was doing heavy shell file descriptor magic, since it moves things around when doing its pipe). Strongly recommended.

      - PPerl - which isn't necessarily written for use in CGI.

      True. See above. PPerl is an interesting choice if you *do* in fact need to do some heavy shell file descriptor magic (see http://smtpd.develooper.com/). I've kept with SpeedyCGI for other reasons though.

      - Rolling a custom http server using HTTP::Daemon or Socket. Which is a really bad idea.

      Not if you enjoy pain. =)

  105. Re:There ARE other scriping languages besides PHP by madprof · · Score: 1

    PHP is backward - Template Toolkit is the way to go.

  106. speed up your database layer by brennz · · Score: 2, Funny

    Switch out your Postgresql database for a Mysql database running on speedy ISAM tables.

    VROOOOOOOOOMMMMMMMMMMMMMMM!

    Is that the sound of your database speeding up, or your data integrity disappearing?

    Only Rasmus Lerdorf really knows...

  107. Re: False Arguments by mlwmohawk · · Score: 1

    This is such a false argument.

    In many ways, *all* data should be in a database. Any data that is not in a database seeks the functionality of a database. Think about searching for email contacts, or words in a word document. Have you ever realized that a spreadsheet is just a database?

    Sure, it is impractical for the world to expect everyone to use a uniform data store, but it would make using, moving, interpreting, searching, etc. data easier.

    In a web environment, you would almost NEVER use a flat file. Certainly not without serious locking considerations. In PHP for instance, sessions have to use flock to keep things like frames from causing phantom writes and lost data,

    MySQL has no technical merrits over somethig like PostgreSQL or Oracle, while Oracle does cost money, PostgreSQL is also free.

  108. Re:There ARE other scriping languages besides PHP by Anonymous Coward · · Score: 0

    There is already a wrapper function. Its name: IO::Select.
    It is part of the CORE since Perl 5.00307.

  109. Re:There ARE other scriping languages besides PHP by Anonymous Coward · · Score: 0
    What you really should do is create a wrapper function around select, which takes its parameters (and returns its results) in a more convenient form for the program you are writing.


    And maybe you could call this magical function IO::Select, and include it in the perl core distribution.
  110. Huh by glwtta · · Score: 1

    So he wants me to make up for all the features missing from MySQL by using PHP?

    I think I just threw up in my mouth a little.

    (helpful hint for mods: this might be considered flaimbait)

    --
    sic transit gloria mundi
  111. Not a great idea at all. by TheLink · · Score: 4, Insightful

    "magic quotes" was, is and will forever be a terrible idea.

    It is one of the many PHP misfeatures that make it easy for programmers to do the WRONG THING.

    The correct way to do things is to filter/quote inputs to your program accordingly so that your program can handle them correctly.

    Then you filter/quote outputs from your program to other programs accordingly so that those programs can handle the outputs correctly.

    If you don't do that you will end up with corrupted or misinterpreted data or worse.

    The correct filtering/quoting for an Oracle database is different from that for MySQL, and is different for a web browser, and for syslog.

    Magic quotes combines all the quoting with one "easy" "fix", and because of this sort of wrong-minded thinking, plenty of sites are littered with spurious backslashes in their content.

    There are plenty of other things PHP does wrong, and a lot of those are PHPisms - the things that make PHP PHP. By the time they fix those, PHP ends up not like PHP. Go look at the "backtracking" changes from PHP3 to PHP5.

    You might as well skip all that crap and go with some other programming language - like python, perl, ruby.

    BTW the same goes for MySQL, look at the changes from MySQL3 to MySQL5. MySQL3 = "Oh you don't really need transactions at all". MySQL4, "use transactions if you don't need speed". MySQL5 "oh yeah quietly corrupting data by default is a bad idea after all".

    With PHP/MySQL 3 to 5, if you leave the defaults on, lots of things break, because the old way of doing things was a bad idea e.g. register_globals=on.

    With Postgresql, the direction and principles have remained pretty much the same over the years- just getting better and better. So if you have written a program for postgresql 6.5, you can pretty much upgrade to 8.1 and your app will usually work by _default_ and work faster too.

    --
  112. Re: False Arguments by 14CharUsername · · Score: 1

    When all you've got is a hammer all your problems start looking like nails. When you're a DBA you think all data should be stored in a database.

    And MS tried to put everything in a database with WinFS. Problem was it too complicated.

    In a web environment, you would almost NEVER use a flat file.

    So you've never seen a .html file before? What do you think those contain? What about a .php file? .css? .jpg? These are all files that contain data. The contents of all of these files could easily be placed in a database. So why don't we? Because it's much easier to use files for these things. And then there's performance reasons.

    And these are the same reasons to use MySQL. Easier to maintain. Better performance.

    And simpler design and better performance aren't techincal merits?

  113. Mod parent up: Then explain magic_quotes_gpc! by SimHacker · · Score: 1

    Slamb, thanks for asking that question, which was also on my mind. I'd certainly like to know how anyone could have ever conceived of something as dangerous as magic_quotes_gpc and register_globals in the first place, let alone why have they taken so long to remove those flaws?

    Those horrible mistakes by PHP's designers are directly responsible for many of the security holes and bugs in millions of PHP programs, because PHP is designed to PRETEND to solve security problems, while failing to actually provide any security. So it's pretty hypocritical to blame the sloppy developers, when you're the one who actually invented those horrible flaws in the first place, and took so long to recognize them as such and remove them.

    Thanks a lot for finally removing the foolish flaws that encouraged bad practices, and resulted in many security holes, crashed servers, service interruptions, loss of time, loss of money, and exposure private data, but I'll take a pass on the lecture about the consequences of sloppy programming from the designer of PHP.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
    1. Re:Mod parent up: Then explain magic_quotes_gpc! by Anonymous Coward · · Score: 0

      Were you even around when the web was won? Do you remember HTML 2.0 and CGI scripts written in shell script? Guess not, cause then you'd remember what a godsend PHP actually is instead of laying ridiculous criticism at one of the key technologies that has brought teh interweb to us all.

      Children don't learn to walk without stumbling along the way. This is the way of all development. Things break, holes are found and fixed, etc.

    2. Re:Mod parent up: Then explain magic_quotes_gpc! by SimHacker · · Score: 1

      The real question is: Will you still be around when the web's finally won? If you had any perspective, you would realize what an abomination PHP is, and know that we're a long way from realizing the full potential from the web. There's no reason for you to be repeating the mistakes of the past by using PHP, which there are so many better solutions available. How long have you been around, to accuse me of being a newbie?

      I've been developing hypermedia browsers and distributed user interfaces ("AJAX") since 1988. I wrote my first hypermedia browser in PostScript, Forth and C, for the NeWS window system, in 1988, and it was called "HyperTIES":

      Designing to Facilitate Browsing: A Look Back at the Hyperties Workstation Browser.
      By Ben Shneiderman, Catherine Plaisant, Rodrigo Botafogo, Don Hopkins, William Weiland.
      http://www.donhopkins.com/drupal/node/102

      I also wrote a hypermedia authoring tool with UniPress Emacs in MockLisp (this article has many images and links to documentation and source code written in C, Forth, PostScript, MockLisp and HyperTIES markup language):

      HyperTIES Hypermedia Browser and Emacs Authoring Tool for NeWS
      http://www.donhopkins.com/drupal/node/101

      And I wrote my first web server in ScriptX and C, in 1995:

      ScriptX and the World Wide Web: "Link Globally, Interact Locally"
      http://www.donhopkins.com/drupal/node/118

      Here is the web server module documentation:
      http://www.google.com/search?q=cache:XgEgHkBwCBMJ: www.art.net/~hopkins/Don/lang/scriptx/web.html&hl= en&gl=us&ct=clnk&cd=1

      The HyperTIES markup language supported macros, conditionals, loops, variables, even user defined interactive widgets ("applets" scripted in PostScript), and we designed to be easy to understand, with a simple uniform syntax, low syntactic surface area, few exceptions to the rules, consistent naming conventions. In short, everything that PHP lacks. And that was in 1988.

      There is no excuse for PHP's horrible design. If you're not aware of its flaws, then you're not qualified to use it. So stop making excuses for it.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
  114. Re:There ARE other scriping languages besides PHP by chromatic · · Score: 1
    PHP takes care to keep things consistent...

    No, seriously, which language did you mean there?

  115. Q: Why do Yugos have rear window defrosters? by SimHacker · · Score: 1

    A: So they can warm your hands while you're pushing them.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  116. Car analogies in general by Beryllium+Sphere(tm) · · Score: 1

    They're old, tired, don't serve the purpose well and are really hard to get rid of.

    Kind of like a 1960s Pontiac.

  117. There's a surprise by Schraegstrichpunkt · · Score: 1

    PHP is one of the most poorly-designed languages ever created, and there's no evidence that its designers have really improved much (even some of PHP5's improved features have stupid defaults, for example). It doesn't surprise me that they wouldn't know a good design if they saw one.

  118. Sure, Rasmus by ErGalvao · · Score: 1
    Lerdorf noted that some features can be emulated in PHP itself


    Great! I'm very happy now. I'll code 3x more to emulate some things that a REAL RDBMS should do by itself...

    Rasmus should try a comediant career, since he lost any ability to make plausible arguments.
    --
    Er Galvão Abbott - IT Consultant and Developer
  119. Re:There ARE other scriping languages besides PHP by tehshen · · Score: 1
    PHP takes care to keep things consistent

    You have no idea what you're talking about, do you?

    Take a look at the string functions. We have str_replace and strtr. htmlentities and html_entity_decode. Inconsistent underscores. bin2hex and strtolower, they can't decide whether to use 2 or to. Why do some functions begin with "str" and others don't? I'm not using C.

    Oh, and I keep getting the arguments mixed up. explode and implode seem backwards. strstr is (haystack, needle); preg_match is (needle, haystack). Why?

    May I go on? I can go on.

    PHP is the opposite of consistent. Whenever I program PHP, I have to keep a window with the docs open, because I keep having to look up if it's stripslashes or strip_slashes or whatever. Terrible.
    --
    Guy asked me for a quarter for a cup of coffee. So I bit him.
  120. Re:There ARE other scriping languages besides PHP by Schraegstrichpunkt · · Score: 1

    Python more-or-less has namespaces. PHP still doesn't.

  121. You Sissies! by Anonymous Coward · · Score: 0

    You kids and your fancy flat files. Back in my day, we kept our data in huge honking boxes of punchcards, and we were grateful!


    Sissies! Real men still keep their data in boxes... just like we do.**

    **Yes, I wish I was kidding.
  122. Re: False Arguments by mlwmohawk · · Score: 1

    When all you've got is a hammer all your problems start looking like nails. When you're a DBA you think all data should be stored in a database.

    I'm not a DBA, I'm a software developer and consultant.

    So you've never seen a .html file before? What do you think those contain? What about a .php file? .css? .jpg? These are all files that contain data. The contents of all of these files could easily be placed in a database. So why don't we? Because it's much easier to use files for these things. And then there's performance reasons.

    Nice strawman, but program files and programatic content are fundimentally different than data.

    And these are the same reasons to use MySQL. Easier to maintain. Better performance.

    I have seen no evidence that MySQL is easier to maintain, nor is it faster on anything but the simplest queries.

  123. Re: False Arguments by JustNiz · · Score: 1

    >>>So you've never seen a .html file before? What do you think those contain? What about a .php file? .css? .jpg? These are all files that contain data. The contents of all of these files could easily be placed in a database. So why don't we?

    Because your performance goes to shit. Its the same problem Microsoft will hit when they introduce their DBFS or whatever its called.

  124. Re:There ARE other scriping languages besides PHP by howardd21 · · Score: 2, Insightful

    You mean like when they supported Windows 98 up until July 11, 2006?

    --
    no comment
  125. No by Plutonite · · Score: 1

    Because this post had nothing to with Microsoft or Duke Nukem.

  126. Must be a slow news day by Anonymous Coward · · Score: 0
    I'd be more responsive to what he had to say if PHP's SQL functions supported placeholders. The hoops that I have seen PHP code jump through to protect literals embedded in SQL statements are just ridiculous.

  127. No position... by Anonymous Coward · · Score: 0

    I don't think the creator of PHP is in any position to be slamming anyone. PHP is a mess and a security nightmare. And MySQL is a toy.

  128. An elegant alternative. by Horar · · Score: 1

    For a simple, fast and powerful alternative web technology that leverages PostgreSQL's innate technological superiority, please have a look at http://asmith.id.au/mod_libpq.html Put simply, this apache module allows you to bypass all the middleware baggage and build your web applications directly in your PostgreSQL database yielding tremendous advantages in speed and robustness. One well known example of this technology in action is http://freedb2.org/

  129. Re:There ARE other scriping languages besides PHP by multipartmixed · · Score: 1

    You know what's hilarious?

    I've been writing in C for 16 years now; other language strengths are Javascript and Bourne Shell variants. I work occasionally with PHP, and it's C-like enough that learning it has been easy. But although some things are just not done elegantly, at least one can say, "okay, this is how you do it in C+UNIX, I'll bet it's the same in PHP". And usually, that leads to a solution within minutes, which is pretty good as far as foreign languages go.

    --

    Do daemons dream of electric sleep()?
  130. The COBOL of scripting? by Christopher+B.+Brown · · Score: 1
    What PHP code I have read has been pretty consistent with a "COBOL-like" view of the world. The only PHP package I seriously "reviewed" was a library system where each possible form and each response thereof was expressed as a separate PHP file, all of them "templated" in the common COBOL fashion where it looked like the programmer had only ever written one program, and then copied it, over and over, once for each web page in the application. (I have worked with ex-COBOLers; duplicating the deck was a real common approach...)

    This of course suffers from the problem that if you decide that you need to change the background colour, you need to modify it in 83-odd .php files.

    Nothing about this implies that PHP programmers are forced into such ghastly habits, but I do tend to find habits repeated :-(.

    --
    If you're not part of the solution, you're part of the precipitate.
  131. unacceptable by Anonymous Coward · · Score: 0

    You ignorant idiots have now progressed to attacking php.net, which is now down. Are you proud of yourselves? Get out of the business if this is how you want to act.

  132. Re:There ARE other scriping languages besides PHP by Anonymous Coward · · Score: 0

    There are also folks who've been writing Perl 6 for years now.

  133. Are you crazy or what? by Nicolay77 · · Score: 1

    If I understood the parent post, the temporary copies of the records are never deleted. That's a coding error to me.

    He didn't mean about never using them, rather that at some moment, after the queries have run to completion, and all related transactions have finished the commit, and the temporary records are not needed anymore, then have those records deleted.

    And they should be deleted. I surely can't understand your rant.

    --
    We are Turing O-Machines. The Oracle is out there.
    1. Re:Are you crazy or what? by mlwmohawk · · Score: 1

      If I understood the parent post, the temporary copies of the records are never deleted. That's a coding error to me.

      He didn't mean about never using them, rather that at some moment, after the queries have run to completion, and all related transactions have finished the commit, and the temporary records are not needed anymore, then have those records deleted.

      No it is not that they are "never" deleted, it is that, for lack of a better analogy, they become unused, sort of like Java when objects go out of scope. The VACUUM process acts like a garbage collector for the system.

      VACUUM has a few modes, in itss most useful modes, it goes through a table and marks space as free to be reused as needed without blocking queries.

      Imediately removing rows, or "tuples," requires additional overhead at query time. All MVCC systems have to cope with removing rows that are no longer used. Just like Java has to run garbage collection.

      The benefit of MVCC is that [N] queries can be run at any one time and never block on contention unless a lock is explicitly needed.

      In the long run, MVCC can actually reduce the amount of work and/or latency in an active database where reading and writing concurrently occur.

    2. Re:Are you crazy or what? by Nicolay77 · · Score: 1

      Then, to follow your analogy with garbage collection, what that user wants is a system that does some static analysis to free as much as possible as soon as a stack frame is no longer in use.

      Java does this when automatically converts some heap variables to be stack variables.

      But for a system with a garbage collection resembling more this idea, there is the newLisp interpreter, which not only does the analysis and frees as much as possible in a call stack pop, but because of this approach, is faster than several other interpreters with a more conservative garbage collection system.

      However, maybe that's the point where the analogy breaks, because I can certainly see your argument in terms of performance, and the newLisp performance, and both use different approaches. Just because memory is ages faster than disk drives.

      --
      We are Turing O-Machines. The Oracle is out there.
  134. Computer Science is about... by Nicolay77 · · Score: 1

    Nothing to do with computer science???

    And then what is supposed computer science about? French fries?

    FYI: computer science is about algorithms, and guess what... software is algorithmic in nature!

    You can't separate a very specific piece of software from the underlying algorithms it has.

    However, (and I guess that's the point you tried to make) I believe I can blame more the underlying algorithms in the MySQL engine than the ones in the webpages that use that particular engine.

    --
    We are Turing O-Machines. The Oracle is out there.
    1. Re:Computer Science is about... by ClassMyAss · · Score: 1
      You can't separate a very specific piece of software from the underlying algorithms it has. However, (and I guess that's the point you tried to make) I believe I can blame more the underlying algorithms in the MySQL engine than the ones in the webpages that use that particular engine.
      Yes, I suppose I probably overstated when I said that computer science has nothing to do with specific software - of course a big part of being a good coder is understanding what tools are the best for your job. I think the main point I was trying to get across was just that you can't claim (as the uber-parent essentially did) that a coder would have been helped by more CS knowledge simply because he wrote some code that interfaced with a MySQL database. Yes, the truly thorough CS geek would dig into the source of MySQL and PostgreSQL to compare them, but let's be honest - this is a gargantuan task, and I think most employers would be more than a little pissed off if they gave the assignment "Make me a database to keep track of our customers" and the programmer spun wheels for three weeks sifting through the details of each algorithm in every SQL package out there to figure out which one has more efficient deadlock busting routines for their expected pattern of use. In any case, often the decision as to what engine to use does not lie remotely in the hands of the programmer - if your company has been using hundreds of thousands of lines of PHP connected up to a MySQL database for the past five years, chances are you'd need to break a hell of a lot of code and spend months to years to switch over to PostgreSQL, and I know what most bosses would say in response to that idea...

      To put it another way, if it's got "SQL" in the name, I fault the creators of the software rather than the users if it does less than the SQL label implies...

  135. Re:An analogy is used to explain, nothing more by mlwmohawk · · Score: 1

    The analogy, was just an example of how it worked, not a design spec. I also said "for lack of a better analogy." Often in engineering, one must explain concepts in general terms, and leave the specifics to further study.

    PostgreSQL's MVCC is analogus to Java's memory management, but not like it.

    There is an amount of work/time required to update a record. One must block writers during this time, or use some sort MVCC. If you have MVCC, there little or no blocking, but you have to clean up. If you don't have MVCC you have to block for writes and scale like crap. The work/time has to be done at some point, PostgreSQL uses MVCC and requires VACUUM to clean up periodically.

  136. I've received a lot more spam in my inbox... by knorthern+knight · · Score: 1

    ...from b0rk3n PHP webscripts than from PostgreSQL installations.

    --

    I'm not repeating myself
    I'm an X window user; I'm an ex-Windows user
  137. PHP IS unspeakably crap... by oSand · · Score: 1

    ...but there are libraries for that. e.g. ADODB

  138. Perl? by rp · · Score: 1

    PHP started as a Perl script written by Rasmus Lerdorf for his personal home page.

  139. Free Software Application Naming by John+Hasler · · Score: 1

    > Allowing programmers to name serious 'flagship' Linux applications is right
    > in line with letting marketing write them.

    I assume you are referring to Free Software applications. Who is going to "not allow", management? Who is going to do the naming instead, marketing?

    If you know of some "serious 'flagship' Linux applications" that are, in your opinion, misnamed, why don't you just fork them and give the better names?

    --
    Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
  140. Re:Hammering screws by zobier · · Score: 1

    Funny thing about that saying; I was watching my mate's dad put together a bookcase once, and he would hammer the screws in about 3/4 of the way and then tighten them conventionally. I thought it was a bit weird, but he seemed to think it was a perfectly adequate method of construction.

    BTW: He taught engineering at university.

    --
    Me lost me cookie at the disco.
  141. Where is my ZActiveRecord...? by SimHacker · · Score: 1

    Jason asks on his blog:

    Where is my ZActiveRecord...?

    Where is my Zend_DB_DataObject / ZActiveRecord? I just downloaded the alpha Zend Framework and there does not appear to be any reference to ZActiveRecord or any DB_DataObject thingy anywhere.

    Well, not entirely true, the news.txt file has one line that says "Removed defunct Zend_Db_DataObject" docs. I saw a reference elsewhere in an old blog that said there were some inherent problems with the design of ZActiveRecord with php 5.1... and it looks like they've removed the documentation from online too... those bastards!!!

    About face! Retreat! Whitewash web site!!!

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  142. Re:There ARE other scriping languages besides PHP by tacocat · · Score: 1

    I was thinking more in terms of their migration from different VB's and such.

    Deprecation is a necessary evil. Sometimes, and I'm sure both side of the Micorosft field would agree, it's a lot easier if you can do deprecation overnight.

  143. Re:There ARE other scriping languages besides PHP by howardd21 · · Score: 1

    I agree with that regarding VB...I am still trying to stop usinh strHungarianNamingConventions, and start using camelCase. :)

    --
    no comment
  144. Ya, but. ... by msimm · · Score: 1

    Its no fun if you make it sound all reasonable.

    *smacks fist into palm*

    --
    Quack, quack.
  145. because mysql is the paragon of speed? by clayne · · Score: 1

    I'll stick to BDB and C - not noveaux crap like PHP, thanks.

  146. Rasmus is backpeddling by rambot · · Score: 0

    If you want to see where Rasmus really stands, ask him how he feels about the idea of PHP ever supporting connection pooling as I did when he came to Portland. He got very anxious, irritated and flush in the face as he spouted off lots or fantasy scenarios that made no sense whatsoever.

    I said, all the bigger full featured RDBM's were built on the concept and it is fundamentally accepted as the way to scale out. Again he went off, getting more and more irritated.

    Just like the importance of supporting Unicode natively, and dozens of other things in PHP, connection pooling will be a distant after thought that will come a day late and a dollar short. My prediction is PHP10.