4 ms·
How does this compare to other HA postgres products like stolon or Postgres-XL?
by eicnix 9y ago
How does this compare to other HA postgres products like stolon or Postgres-XL?
- vishesh92 9y agoAs per my understanding, Postgres-XL is not comparable to Patroni. Postgres-XL is comparable to PostgreSQL. Postgres-XL shards the data across multiple data nodes. Where as Patroni uses etcd, consul or zookeeper to provide HA for any Postgres cluster using replication (Data is written only to a single instance and replicated further). I think you meant Stolon. Stolon is quite comparable to Patroni and has more features than Patroni, but I am not sure how many people are using it. I found more resources for Patroni as compared to stolon.
- CyberDem0n 9y ago> Stolon is quite comparable to Patroni and has more features than Patron. Let me as a question, what feature Stolon has and Patroni doesn't? Can you give an example? From my side I can provide list of features available in Patroni, but not in Stolon. For example: * there is no way to do a controlled failover (switchover) in Stolon. * in Patroni it's possible to exclude some nodes from a leader race. * Patroni supports cascading replication * Patroni can take basebackup from replicas if they are marked with a special tag * it's even possible to configure Patroni to use a custom backup/recovery solution instead of pg_basebackup * Patroni can give you a hint that postgres must be restarted to apply some configuration changes * with Patroni it's even possible to schedule switchover or restart restart of postges on some specific time (for example 04:00 am, when traffic is minimal) * with Patroni you can control High-Availability / Durability ratio. I.e.: what to do if master postgres has crashed? Either you will try to start it back or failover to a replica. But start of a crashed postgres may take a long time. With Patroni you can configure that if postgres didn't started in some amount of seconds - please do failover. Stolon provides cloud-native deployment and Patroni doesn't? This is not really true. The main idea of Patroni is to be not dependent on some specific technologies. It can work as on bare-metal with the same success as on Kubernetes. It's very easy to build a custom solution with Patroni for your use-case. For example there is a Spilo project: https://github.com/zalando/spilo https://github.com/zalando/spilo, a docker image build with Patroni and wal-e for a cloud deployments.
- vishesh92 9y agoThanks for this. As I mentioned in previous comment, I couldn't find much about Stolon. One of things I likee in stolon is the proxy, it enforce connections to the right PostgreSQL master and forcibly closes connections to unelected masters. Which is not present in Patroni, but I guess it should be doable using consul's service discovery and dynamic DNS. (I am not sure if this can be done using etcd and zookeper).
- CyberDem0n 9y agoDoesn't HAProxy provide such functionality? Patroni has REST API which can be used by HAProxy for a health-check. patroni:8008/master will return http status code 200 only if the node running as elected master patroni:8008/replica will return http status code 200 if node running as replica. And final missing bit is a automation of generation of haproxy.cfg - it could be done with confd: https://github.com/kelseyhightower/confd https://github.com/kelseyhightower/confd And here is an example of template file: https://github.com/zalando/patroni/blob/master/extras/confd/templates/haproxy.tmpl https://github.com/zalando/patroni/blob/master/extras/confd/...
- vishesh92 9y agoI am not sure, will HAProxy forcibly close connections to old master in case of a failover?
- CyberDem0n 9y agoon-marked-down shutdown-sessions should do the trick
- deleted 9y ago[deleted]
- jsiepkes 9y agoPatroni makes PostgreSQL cloud native; easily add and despose nodes in a self healing postgres cluster. Think of it as nosql style cluster management. PostgreSQL XL is more "classic" (non self healing) clustering.