It is done, the PostgreSQL community rocks
blog.pgconf.us
blog.pgconf.us
I don't know if logical replication = multi-master but I know it is a major piece of the puzzle.
It is quite easy to setup powerful pg master node (32 CPU threads, fast SSDs) and many slave nodes for read-only queries. That setup can handle quite a lot of transactions.
There can't be sharding if there is only ever one node that performs writes.
- All nodes have all data (no sharding).
- No nodes have all data (sharding).
The most popular hack for PostgreSQL is citusdb https://www.citusdata.com/ , of course it comes with many limitations and drops half of SQL
https://docs.citusdata.com/en/v6.1/reference/sql_workarounds...
Day 0 and 1: https://cloudlock.engineering/pgconf-2017-days-0-1-c897dd90c...
Day 2: https://cloudlock.engineering/pgconf-2017-day-2-8bd7e93404eb
Day 3: https://cloudlock.engineering/pgconf-2017-day-3-54e56ad8eaca
Does anyone know if there videos of the conference available and if the are all listed in a central page?
Is that easy to setup (i.e. has a sequence of documented steps to follow)? https://wiki.postgresql.org/wiki/Multimaster says this HA setup is possible but does not describe it and I'm having trouble finding out if this is fully supported or is just a 'and maybe you could do it if you tried this'.
You can do this with repmgr from 2ndquadrant, see the documentation [0] for details on the configuration. Since repmgrd doesn't require anything other than postgres to be running, it doesn't add any new failure points.
One thing you need to make sure you do right in such a setup is fencing the failed node, pgBouncer or pgPool is a good way to go about this - in your failover script you can modify your configuration on the pgBouncer server to point at the new master before the failover takes place, this will prevent clients from talking to the failed master and prevent a split-brain.
Alternatively, you can use something like keepalived and STONITH, but I'm not comfortable relying on somehow shutting down or cutting off the other machine from the network as it is less reliable than modifying a configuration file if things are going really wrong.
My long answer: After years of experience with highly-available database provision with PostgreSQL, I concluded that I don't want automatic failover. It's more practical to keep a master running and constantly replicated by slaves that can be promoted to master in migration or failure situation. However, when there is a failure situation it's so exceptional that someone really needs to understand what happened before allowing the next victim (er, database) to go on stage.
I would rather not discover afterwards that I was supposed to `ulimit` the postgres process to some CPU in order to be able to successfully kill queries that are jamming the box.
That would be awesome, but stock Postgres only provides some of the building blocks.
For past few days I've been investigating stolon [1]. Conceptually, it makes sense to me. And so far it seems to work. But it's not simple to set up and maintain. For example, for leader election it uses etcd or consul. So initially you had one service that must not go down, --now you have two! ;-)
Bringing the master back live and making it primary is a more difficult task. I would not want to automate this anyway as it would be too easy to shoot your foot off.
Can we have data on these?
Like how much is a record? It could be 1 person more than previous convention.
Having data we can have a better understanding such as growth rate and such. It also let us appreciate the growth and momentum much better.