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.'"
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.
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!
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
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?
Kindness is not to be found in anything but that it adds to its beauty...
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'.
:) 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.
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
Exactly. But it makes a much more interesting /. story to take an imcomplete account of a talk and further mangle it.
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
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.
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:
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
Read my blog.
A solution which forced us to regress to using Java or .Net is no solution at all BTW.
Rich.
libguestfs - tools for accessing and modifying virtual machine disk images
No, I've admitted that, several times, in this thread.
There are many ways to rank the functionality of things, not one correct way.
Which is, in fact, what a lot of web applications on LAMP infrastructure do.
"Superior as an RDBMS" is mostly a meaningless, or at least equivocal and ambiguous, category.
Sure, in the sense that "different" is not "equal".
"Inferior programming language" is meaningless.
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."
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?
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 isn't a matter of complicated. It is a matter of wrong.
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.
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.
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 */
Since most everything you see is cached, it's more accurate to say they're using flat files.
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:
To be fair, I have found some advantages:
Don't thank God, thank a doctor!