6 ms·
Continuously blown away with the quality and usefulness of Postgres. It is truly lightyears ahead of MySQL and I keep wondering wth took me so long to switch. K
by dvdplm 11y ago
Continuously blown away with the quality and usefulness of Postgres. It is truly lightyears ahead of MySQL and I keep wondering wth took me so long to switch. Kudos.
- eknkc 11y agoWhat I don't like about postgres is that it's really hard to have a decent replication / failover setup manually. Meanwhile, it seems like AWS RDS have more development on MySQL and their own MySQL compatible engine (aurora?). At least they have Postgres RDS though. Google Cloud does not offer any hosted Postgres solutions. Cloud SQL is all MySQL. I love Postgres but I really don't like maintaining rdbms installations. What is my best bet running pg on google cloud with ha and minimun hassle?
- brianwawok 11y agoUsually better off just running Google cloud SQL, because for many workloads the benefits of hosted FT outweigh the gains of Postgres over MySQL. Now if you need Postgres specific features... gets more tricky. Setting up FT is terribad.
- jhoechtl 11y agoWhat about a dockerized Postgres? https://hub.docker.com/_/postgres/ https://hub.docker.com/_/postgres/
- creshal 11y agoThrowing something into a container does not magically make it have replication nor failover.
- techdragon 11y agoIt actually makes your life harder.
- dcgoss 11y agoCould you elaborate on this? I was considering using containers for a PG installation but am reevaluating.
- X86BSD 11y agoWell on FreeBSD you can toss it into a jail with iocage and get snapshots, clones, easy HA with vrrp or CARP. Not replication per se. But for a lot of people that works just fine and is incredibly easy to automate and accomplish.
- geofft 11y agoHow does this get you HA (easy or otherwise) without application-level configuration? Does this involve something like lockstep execution between the two servers? I'd expect that if you run two Postgres servers, unaware of each other, at the same IP address you will rapidly get data corruption, but maybe I'm missing a step since you say this works fine for a lot of people.
- creshal 11y agoI'd guesstimate it involves shipping snapshots to a cold standby, since snapshotting/cloning is mentioned.
- takeda 11y agoWhat are you trying to solve by doing this? Are you planning to run other applications on the same host. Generally it's not a good idea to share host running database with other applications due to different workloads. If you would want to put multiple databases on one host, probably more efficient would be still to put all data in single instance. I could see this if it's a very small database, then this could work, but then wouldn't you be better off with using SQLite? In additions when you add containers to the mix you turn a single problem into many, some examples: - assuming you have multiple hosts, you need to figure out where you'll store persistent data (and you generally want a solution with high IOPS) - how you handle logging (where you store them?) - how the applications figure out where your database is (service discovery) - how you solve replication (and figure out which database is the master) - how you handle failover
- mostafah 11y agoHeroku has a decent offer: https://www.heroku.com/postgres https://www.heroku.com/postgres. Another option is intoGres: https://www.intogres.com https://www.intogres.com.
- brightball 11y agoHadn't heard of intoGres. Thanks for that.
- lobster_johnson 11y agoThose aren't for Google Cloud, though. Heroku is hosted on AWS, and intoGres has their own cloud. You don't want to incur the latency of talking to a database from a different cloud.
- BenoitP 11y agoOne can hope that this will get fixed over time. 9.4 introduced some flexibility over streaming out data changes from the Write Ahead Log, from [1]: > Add support for logical decoding of WAL data, to allow database changes to be streamed out in a customizable format. Also 9.5 added new metadata to it [2]: > Each WAL record now carries information about the modified relation and (s) in a standardized format. That makes it easier to write tools that need that information, like pg_rewind, prefetching the blocks to speed up recovery, etc. Hopefully we will see the ecosystem pick up on those changes. Percona made a killing in helping replication take place in MySQL. I don't see why this would not happen with postgres. I'm confident things will improve. [1] http://www.postgresql.org/docs/9.4/static/release-9-4.html http://www.postgresql.org/docs/9.4/static/release-9-4.html [2] http://michael.otacoo.com/postgresql-2/postgres-9-5-feature-highlight-new-wal-format/ http://michael.otacoo.com/postgresql-2/postgres-9-5-feature-...
- ninkendo 11y ago> Each WAL record now carries information about the modified relation and (s) in a standardized format. That makes it easier to write tools that need that information, like pg_rewind, prefetching the blocks to speed up recovery, etc. Maybe only tangentially related, but they also made enhancements to pg_receivexlog that make it acknowledge transactions over the wire. It may not seem like a big deal, but with those changes I was pretty trivially able to patch a version of pg_receivexlog that replicates WALs to HDFS and flushes them (instead of the local FS), so that you can essentially treat HDFS nodes as synchronous standbys. Incredibly useful for setups where your only non-ephemeral storage is HDFS, and the 16MB chunk boundary imposed by archive_command is too course-grained. I'd imagine similar things can be written for lots of other non-posix filesystems that support appending and flushing... Being able to replicate to something that's not just another plain old server is really useful (not to mention how much simpler it is than having to set up an entire other Postgres node just to synchronously ship logs.)
- brightball 11y agoAWS is investing more into MySQL because of market and the fact that MySQL is an interface to numerous database engines. It's significantly easier for them to built something like Aurora with MySQL compatibility because of that setup. Don't get me wrong here, PostgreSQL is light years better but that's the big "why".
- busterarm 11y agoWrite support for the SQL/MED standard was added in 9.3. Postgres now has a variety of foreign data wrappers available and can serve that exact same function.
- deleted 11y ago[deleted]
- eyepulp 11y agoWe dislike managing PG too, so we've been migrating to https://www.compose.io/postgresql/ https://www.compose.io/postgresql/ It's not for every situation, but they have replication and failover and downloadable daily backups with the option for SSH-only access. Been using them for about 6 months on some smaller DB projects, and haven't had any hiccups.
- lobster_johnson 11y agoCompose runs on AWS, though. OP was asking about Google Cloud.
- lololomg 11y agoThey say that they'll happily host 3TB databases, but the cost is too high for databases larger than a few GB. 1TB (with only 100GB of RAM) will set you back $150k a year! For comparison we pay our generic service provider about 20% of that to manage 2 redundant dedicated servers with 24/7 monitoring and support.
- daigoba66 11y ago> What I don't like about postgres is that it's really hard to have a decent replication / failover setup manually. This is one reason I personally have a hard time moving away from MSSQL (despite the obscene licensing). Clustering, replication, and failover of MSSQL on Windows is really quite powerful. Though not necessarily cheap or easy to setup and troubleshoot, it is wonderful when it works.
- lobster_johnson 11y agoThere's ElephantSQL (https://www.elephantsql.com https://www.elephantsql.com) and Aiven (https://aiven.io/postgresql.html https://aiven.io/postgresql.html). However, they are super expensive. Considerably more than running yourself, and considerably more than CloudSQL or RDS on AWS. Their plans are so small it seems that they're not really made for running anything big. Aiven's biggest plan is 3 nodes, each with 8 cores and up to 32GB RAM. Elephant's most expensive plan is 1 node with 4 cores and 15GB RAM. Not sure if you just buy multiple of these. They have replication support, but I don't see anything about pricing, and they don't have automatic failover.
- pjlegato 11y agoMy company, Databaase Labs (https://www.databaselabs.io/ https://www.databaselabs.io/), runs fully managed Postgres DBaaS and now has Google Cloud as a deploy target in beta. Mail me if you'd like to be in the beta - pjlegato@databaselabs.io.
- taneliv 11y agoSome ex-colleagues just started offering what you want, I think. I am sure they'd appreciate feedback even if it isn't: https://aiven.io https://aiven.io (disclaimer: haven't tried it myself for lack of a use case)
- deleted 11y ago[deleted]
- cookiecaper 11y agoI've managed some significant MySQL replication clusters for the last couple of years. They are a nightmare, frequently stopping for dumb errors and/or falling completely out of sync. It's only manageable because of Percona's tools. While PostgreSQL replication may be a bit clunkier on the initial setup, it's a dream comparatively.
- jhoechtl 11y agoIf at least temporal table support would be on the TODO list Temporal tables: https://wiki.postgresql.org/images/6/64/Fosdem20150130PostgresqlTemporal.pdf https://wiki.postgresql.org/images/6/64/Fosdem20150130Postgr... TODO: https://wiki.postgresql.org/wiki/Todo https://wiki.postgresql.org/wiki/Todo
- phonon 11y agohttps://github.com/arkhipov/temporal_tables https://github.com/arkhipov/temporal_tables works pretty well.
- emodendroket 11y agoI don't get to use psql much anymore but the documentation is among the best I've ever seen for any project.