Postrep, a basic PostgreSQL custering tool

Postrep uses a fixed replication strategy (streaming replication), a fixed leader election tool (Etcd 3), to achieve proper failover when the cluster leader fails.

The problem this solves

PostgreSQL has multiple ways to operate in a "leader-replicae" mode. However, failover isn't automatic, and requires another protocol to decide which of the replicae becomes the leader when the previous leader fails.

This crate solves this problem, in the particular configuration where one has an Etcd v3 server running, for example because of requirements from another server running on the same service.