Why I Choose PostgreSQL Over MySQL/MariaDB
Nerval's Lobster writes For the past ten years, developers and tech pros have made a game of comparing MySQL and PostgreSQL, with the latter seen by many as technically superior. Those who support PostgreSQL argue that its standards support and ACID compliance outweighs MySQL's speed. But MySQL remains popular thanks to its inclusion in every Linux Web hosting package, meaning that a mind-boggling number of Web developers have used it. In a new article, developer David Bolton compares MySQL/MariaDB 5.7.6 (released March 9, 2015) with PostgreSQL 9.4.1 and thinks the latter remains superior on several fronts, including subqueries, JSON support, and better licensing and data integrity: "I think MySQL has done a great job of improving itself to keep relevant, but I have to confess to favoring PostgreSQL."
Best of all worlds. And guess what, in the grand scheme of things, the price is a drop in the bucket compared to salaries.
Who trusts MySQL with important data? No one who knows about PG. Good web frameworks like Django prefer PG, while crap ones like Drupal and other PHPtards prefer MySQL.
It's not Access
Let me quote, from the comments thread at a recent article by same submitter:
Another user, in the same thread, had speculated:
No, sir, you were utterly wrong. It came "Postgresql is better than Mysql".
And for many tasks, you don't need any of that. Have a look at SQLite3 (also, it's built into Python, which can be handy.)
Worried about stability? You can compile the SQLite3 source code right into your project. That way, your databases always match your shipping product, indefinitely, period.
It's not usable for everything -- only a decent subset of SQL is supported -- but you might be surprised at just how much is there, and working well.
I've fallen off your lawn, and I can't get up.
I come from a Sybase SQL Anywhere shop. It never ceases to amaze me how stuff that can be elegantly expressed in a couple of queries in Watcom-SQL typically takes four times as much code in MySQL's dialect. I love Sybase's support for the ANSI standards, subqueries, Java/.NET/C/PHP/Perl stored procedures when they are the right tool for the job (ever needed to resize raster images in an INSERT trigger coming from some third-party application?), and great drivers. I shouldn't have to spend 10 minutes trying to figure out why MySQL doesn't support the standard casting string concatenation operator by default (||), or why subqueries don't work like they ought, etc.
Having used Postgres, all of the worthwhile MySQL features are there, most of the SQLA features are there, and the pain level is much, much lower in Postgres than MySQL for someone coming from a full-featured commercial RDBMS.
What really sucks is all of the applications that are so coded around MySQLisms that they don't run on ANSI-compliant engines.
Isn't everyone all NoSQL nowadays or has that faded away?
I'm god, but it's a bit of a drag really...
One expression I remember seeing on the topic went something like: "I can make it as fast as you want as long as it does not have to actually work". The conversation was about filesystems comparing (the non-complying) async-mode with the safer (but slower) alternatives, that actually stood by the promise of fsync(2).
And another, more modern idea (only about 10 years old) quote is "Object/Relational Mapping is the Vietnam of Computer Science". Which, for the purposes of TFA, may be interpreted as something like "who cares for ACID compliance — we can deal with occasional data-corruption and inconsistencies — just make it fast in the usual case".
I rather doubt, we'll settle the question in this discussion...
In Soviet Washington the swamp drains you.
The MOST important reason for using Postgres is that it has object ids (OIDs). This allows true referential integrity. You can have a row point at another row and this reference stays the same REGARDLESS of whether you change the primary key of the referenced row. This allows true object orientation.
And I'm probably going to step on a lot of toes here, but people like me strongly prefer Postgres to MySQL. And by "people like me" I mean folks for whom their first real rdbms experience was theoretical or "commercial". I did both.
I used ingres in college to a small extent and then the Ingres commercial product for years after that. I have also used Sybase and Oracle professionally. PostgreSQL easily walks among the giants of that industry.
Every time this discussion comes up the MySQL side has to say "yeah, but..." about a thousand times. MySQL doesn't do ______ properly? "Yeah, but if you just install this other piece of software and change a couple of config files it *can* do it.' Well, con-fucking-gratulations!
The point is that PostgreSQL does exactly what it should do out of the box. I don't have to change a configuration file to make it ACID compliant, fast, correct, whatever. It just works and works correctly out of the box.
Every time someone tells me how easy MySQL is to set up they've betrayed their experience level in this realm.
I know a lot of you are going to mod me down - I don't care. But why not reply instead?
Do you have ESP?
In the beginning, Postgress set out with correctness as the primary goal. Whatever it did, it had to do it correctly. It started life on the slow and resource hungry side. MySQL set out to be fast and more or less correct in the common case. Back in the '90s that made a lot of sense for small servers.
In the decades since, servers have gotten bigger and Postgress got fast and efficient while still being correct. Why would I want to incur a performance penalty in the surrounding software to check behind the database to make sure it didn't just scrag my data?
no use cases in which we all go into armchair mode and have endless debates already hashed out a million times over.
Yes, this is slashdot.
I haven't -- I've seen cases where the filesystem corrupted itself (with or without the help of hardware failure, no idea), but I've used SQLite most extensively (seriously, I bet I'm close to having used every feature in the thing) in its various revisions for years, as have tens of thousands of my users consequent to my incorporation of same, and I've heard of, and experienced, exactly zero events of DB failure (and one of my most popular apps would have crapped itself and gone blind if such happened, so I'd surely have heard about it.)
Also, different app (SdrDx), but I use it the other way around here; I've got an SQLite DB on my website that tracks startups of the code as to version, revision, step, beta status, platform (windows, OSX), time, date and IP, as part of the handshake that lets the users know if there are any upgrades (in-app title bar notification, nothing invasive.) This lets me keep track, somewhat, how many people are using what version of the app. SdrDx is well over 15 thousand regular users, many more that aren't regular, and the DB is moderately busy as a result, again, no problems. The writes to this particular DB are pretty straightforward, but the queries I've written for it span a decent range of futzing about. No problems to date. Of course it's backed up, but no need for a backup as yet.
I'm also presently using it, again extensively, in an incomplete, but complete enough for my day to day use, DSLR application of mine, code compiled in, along the lines of Lightroom and Aperture, and again, zero DB failures of any kind. Oodles of DB activity for every image, every library op, every bit of auto-categorizing, library backup, tagging, annotating, posted-to recording, flagging, versioning, plug-in and plug-in settings recording, and so on.
So I'm going to go with... possible, but even slightly likely. Also, any DB can take a crap if the drive underneath it goes bad, or the OS (or some all too clever use of root privs) allows corruption of its storage. None of which should be construed as any kind of criticism of any DB engine subject to the same.
Also, did you report these purported corruption events to the author of SQLite? Sure hope you did. :/
I've fallen off your lawn, and I can't get up.
Nervals Lobster's last 15 posts have been links to news.dice.com, the parent company of Slashdot. They're nothing but ads.
[Add obligatory Slashdot's-going-to-hell-in-a-handbasket slam here.]
see http://www.postgresql.org/docs...
Just about every modern DB engine has something like it. If you are not even aware of it you should really learn more of your tool set.
putting the 'B' in LGBTQ+
200 comments and nobody has asked whether it's webscale or not. This place is going to the dogs already.
Confucius say, "Find worm in apple - bad. Find half a worm - worse."