5 ms·
I remember ages ago (a decade? or so?) I started working at a company using Postgres for a project, and one of the things my boss asked me to do was to set up r
by danudey 9y ago
I remember ages ago (a decade? or so?) I started working at a company using Postgres for a project, and one of the things my boss asked me to do was to set up replication for the database. We had it on all of our MySQL databases, and everyone knew (myself included) that Postgres was a more serious, enterprise-y, "real" database.
Well, I googled around and couldn't find anything conclusive, so I hopped into the / channel for postgres and asked about it. "Is there any straightforward replication solutions for Postgres?"
It was like the early days of open source all over again. The first thing they did was challenge my needs. "Why do you need replication in the first place?" "Replication isn't a panacea you know." "Postgres doesn't have the issues that MySQL does that makes replication necessary." "Replication doesn't work well in the first place."
A ton of people jumped into what had been a quiet channel to make sure I knew that replication, which postgres didn't have, was something I didn't need in the first place, most of which happened before they even knew why I was asking.
After sorting through all that, a few people suggested "solutions". "Just have a cronjob rsync your data directory over to another machine every minute, and if your first server dies then you can just start postgres on the second one." Other solutions were much more convoluted. Patch postgres, add this software, manage it all yourself. And through it all, they kept telling me that I didn't need replication anyway, "but if you INSIST…".
In comparison, the MySQL channel on freenode was staffed with MySQL employees and volunteers who were always happy to help you solve your problem while teaching you what you were missing and giving you resources you needed. They'd answer questions, help your configuration, and even fix your SQL queries for you, all without being condescending about it or making you feel like an idiot.
And that's why I gave up on Postgres: the community. Postgres's was ridiculously hostile and self-important, verging on insecure and defensive. MySQL's was helpful, friendly, and full of resources. To this day I still hear great things about postgres, and I know it does a lot of things better than MySQL, but whenever someone writes a self-superior blog post about it I always think back to how much easier my life was by using a database where I could ask questions of the community and get useful answers.
- cbsmith 9y agoMeh. It works both ways. There was a time if you asked for transactions on MySQL...
- leetrout 9y agoAnd I still don't have my DDL transactions... :) ;)
- astrodust 9y agoThis is a pretty huge deal in some uses cases. It makes undoing a bad migration trivial.
- pmarreck 9y agoManually cleaning up a bad migration fucking sucks. The best you can do is make migrations idempotent in both directions.
- pritambaral 9y agoMaking migrations idempotent in both directions — when you can — is generally a good idea anyway.
- cbsmith 9y agoYeah. I built out a whole framework to get around the DDL thing. Super annoying.
- icebraining 9y agoAs a Postgres fan, I do agree that the Postgres community has a more "RTFM attitude" than MySQL's. I personally don't have a problem with this, but I can understand that it might steer some people away.
- h1d 9y ago"You don't need it" attitude is much worse than RTFM one, especially when the manual actually has a solution.
- pgaddict 9y agoWell, yeah. Sorry to hear that your interactions with the community was not great. My experience is quite different - perhaps I was lucky, or maybe it's because I started contributing to the project, not sure. But I stuck with PostgreSQL for exactly the same reason why you left it - the community. I'm sure there are still people who respond in the "RTFM" or "Try rebooting it" style, but I doubt we're alone in that. One thing that is still generally disliked on the mailing lists are people treating it as unpaid production support ("Hey, I've started using your open source database, and not it failed and the production DB is down. Help me! Pronto!"). And I kinda share that opinion. Perhaps it's worth giving the community another try? There's loads of new people contributing to it, so hopefully a more diverse audience. Regarding the replication, before the built-in replication was added to PostgreSQL 9.0, the expectation was that replication will be implemented as a plugin, using some sort of internal API. That's kinda how PostgreSQL does stuff - it's extremely extensible (functions, data types, operators, indexes, ...) so the development community expected that to be the case for replication too. But the API never materialized, because no one knew how it should look, because no one attempted to implement a plugin using a non-existent API. Chicken-egg problem. That changed though, and nowadays the built-in replication is considered a great feature. Interestingly enough, the logical replication added gradually over the several recent releases (and particularly in PostgreSQL 10) is implemented using the API approach, and it worked nicely in this case. Of course, this does not make your past experience any better, but hopefully it illustrates that the development community learned from that.
- zeroxfe 9y agoI'm a Postgres fan too, and I remember this -- it really sucked. I loved Postgres, but setting up replication with it was basically duct-tape and string. Not to derail the thread too much, but this is exactly what's going on with Go and generics right now (and I'm a Go fan too.) "Why do you need generics?" "Generics don't solve all your problems" "Generics don't work well" "No language does generics perfectly".
- pmarreck 9y agoSo why is replication necessary?
- unixhero 9y agoI am not a DBA; But it's to ensure high availability.
- fgonzag 9y agoHA, Read load balancing for a simple master-slave setup.
- pmarreck 9y agoBack in my SQL Server days they had something called "log shipping" which is basically sending the transaction log over the wire to another machine where it is re-run. Does that still exist? EDIT: It turns out there is https://www.postgresql.org/docs/9.1/static/warm-standby.html https://www.postgresql.org/docs/9.1/static/warm-standby.html and this seems to accomplish the same goal without actually being replication, so what gives?
- tapoxi 9y agoI think warm standby is a relatively new feature for Postgres. As someone who's had to configure warm standby recently, it's fine, but it's not active-active, which infuriated a few Oracle DBA colleagues. The best way to do that at the moment is by using a proxy like PgPool II.
- rosser 9y agoAnd it was the community that drew me in. Very early in my database career, I was having massive performance problems with my postgres install. I sent a very sharply toned message to the postgres performance mailing list. Within hours of that message, I was trading stack traces with Tom Lane. He was under no obligation to help me; in fact, I was, in hindsight, kinda a dick about it. But he did. You probably can't buy support of that caliber, no matter how much money you throw at it. YM, as always, MV.
- pgaddict 9y agoSure you can. TL works for Crunchy Data [https://www.crunchydata.com/ https://www.crunchydata.com/] and I suppose he gets involved in solving customer issues.
- manigandham 9y ago> You probably can't buy support of that caliber, no matter how much money you throw at it. You're underestimating how good support can be. Postgres doesn't actually have a primary sponsoring company so good (and equivalent) talent is widely available from multiple vendors.
- h1d 9y agoYou switched to MySQL then?