Alexander Kukushkin

Alexander Kukushkin


Principal engineer on the Citus database team at Microsoft, expert in PostgreSQL clustering & HA, maintainer of Patroni, speaker at PGConf EU, PGCon, FOSDEM, KubeCon & lots of PGDays. Loves building things with his hands.

@cyberdemn CyberDem0n

Alexander Kukushkin

Patroni 3.0 & Citus: Scalable, Highly Available Postgres

Written by By Alexander Kukushkin | March 6, 2023 Mar 6, 2023

Citus is a PostgreSQL extension that makes PostgreSQL scalable by transparently distributing and/or replicating tables across one or more PostgreSQL nodes. Citus could be used either on Azure cloud, or since the Citus database extension is fully open source, you can download and install Citus anywhere you like.

A typical Citus cluster consists of a special node called coordinator and a few worker nodes. Applications usually send their queries to the Citus coordinator node, which relays them to worker nodes and accumulates the results. (Unless of course you’re using the Citus query from any node feature, an optional feature introduced in Citus 11, in which case the queries can be routed to any of the nodes in the cluster.)

Anyway, one of the most frequently asked questions is: “How does Citus handle failures of the coordinator or worker nodes? What’s the HA story?”

And with the exception of when you’re running Citus in a managed service in the cloud, the answer so far was not great—just use PostgreSQL streaming to run coordinator and workers with HA and it is up to you how to handle a failover.

In this blog post, you’ll learn how Patroni 3.0+ can be used to deploy a highly available Citus database cluster—just by adding a few lines to the Patroni configuration file.

Keep reading

Page 1 of 1