Postgres is eating relational:
Even as NoSQL databases keep booming, the relational party is very far from over. But among the relational crowd, one database keeps growing in popularity at the expense of its more established peers. Yes, I'm talking about PostgreSQL. The real question isn't why developers like PostgreSQL. There are plenty of reasons. No, the real question is why developers like it so much right now.
The PostgreSQL renaissance is several years old now, something I've written about repeatedly. The reasons for its popularity? There are several, as consultant Tanel Poder neatly summarizes:
1. Rich set of features 2. Extremely extensible (extensions, hooks) 3. Open source 4. 'Permissive' open source license
[...] At any rate, no one questions how good PostgreSQL is nor the part it plays in the industry trend that favors general-purpose databases. This isn't exactly news. What is news is the rush to modernize—and PostgreSQL's role in it.
[...] So even if another database model might actually be better for their use case, the "easy button" is to go PostgreSQL. As ex-AWS engineer Dave Cuthbert notes, "Far more apps are using relational [databases] because it was the only hammer they had."
OK, so the guy likes Postgresql. But what relational database do you or your company use, and why was the choice made? Has it lived up to its promises, or have you found that some things don't quite work as well as they might? What would you recommend today?
(Score: 5, Interesting) by bloodnok on Thursday October 27 2022, @06:09PM (1 child)
To answer why now, I think it's better to ask why not before.
And I think the answer to this is simply fashion and inertia. When MySQL was the darling of developers, I was often told how easy and fast it was. I was using Oracle at the time and experimenting with Postgres. MySQL was certainly easy, but it was so full of gotchas that I couldn't take it seriously. Postgres in those days was not as fully featured as it is now, but it was still pretty damn fast, totally reliable, and although maybe not quite as easy as MySQL, was way easier to use than Oracle.
The problem then was that developers just believed that MySQL was good and didn't even consider Postgres. By the time Postgres 7 came out, there were very few use cases where MySQL (or even Oracle) was better, but still the perception persisted.
Developers thought it was fast, that it was good, and that it was cheap. They were wrong on all counts but the myth persisted.
It was only good if you ignored all those, well documented, gotchas.
It was only cheap if you didn't factor in the administration of regularly rebuilding indexes, dealing with failed backups and more.
And it was only fast if you ran exactly the same query multiple times, without the database being updated. Cached queries were very fast, but if that is your use case you should be asking yourself why you are running the same query all the time.
I once consulted for a MySQL house that was having performance problems. They were joining 2 largish tables with fairly simple outer joina. The joins simply would not use the right indexes and hundreds of full table scans were being performed. I could not get the queries to perform. Eventually in desperation I copied the data to my laptop and threw them into a brand new untuned Postgres instance. The queries ran over 100 times faster on my laptop than in MySQL on enterprise hardware. The second time the queries ran in MySQL, due to caching, they were blindingly fast, but since the Postgres versions on my laptop only took about 500msecs, the advantage was not huge and the cost of the first uncached queries was too much for the customer to bear. They switched to Postgres and never looked back. In doing so, they also reduced their administration overhead as they no longer had to rebuild indexes every few days.
It has taken Postgres years to overcome the inertia of developers who believed MySQL to be good. It wasn't a matter of fact, but of fashion and faith. Although I often blame PHP for MySQL's early popularity (if you thought PHP was good enough, why would you not thing the same of MySQL?), I now think it was just that developers are lazy and subject to the same blinkered attitudes that infects the rest of humanity. My own blinkered attitudes and laziness only properly kick in when I have some evidence that I really am going to find life easier with tool X rather than tool Y: I take my laziness very seriously.
__
The Major
(Score: 1) by GloomMower on Friday October 28 2022, @03:04PM
I agree. And it is hard, when you got someone in love with MySQL there is no real talking them out of it. Slowly PostgreSQL gets put in when finally there is no more talking that can be done.