A PostgreSQL extension implementing the Paxos consensus algorithm and Paxos-based table replication for strong consistency across a cluster.
pg_paxos is a PostgreSQL extension that implements the Paxos consensus algorithm in PL/pgSQL, enabling robust table replication across multiple PostgreSQL servers. It ensures strong consistency by logging every INSERT, UPDATE, and DELETE operation through Paxos and applying all preceding queries before reads, making it fault-tolerant to minority node failures.
Database administrators and developers building highly available PostgreSQL clusters who need strong consistency and fault tolerance without external coordination services.
Developers choose pg_paxos for its native integration into PostgreSQL, providing distributed consensus and reliable replication directly within the database using PL/pgSQL, eliminating the need for separate coordination services like ZooKeeper.
Basic implementation of Paxos and Paxos-based table replication for a cluster of PostgreSQL nodes
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements Paxos directly in PL/pgSQL using executor hooks, avoiding the need for external coordination services like ZooKeeper.
Ensures all reads reflect all preceding writes by applying the full Multi-Paxos log before query execution, as described in the consistency model section.
Resilient to failures of a minority of nodes due to the majority-based consensus mechanism of Paxos, supporting scenarios like 2 out of 5 node failures.
Offers both strong and optimistic consistency via session settings, allowing trade-offs between latency and consistency for reads.
The README explicitly warns that pg_paxos is in an early stage and experimental, making it unsuitable for production deployments without extensive testing.
Requires building from source, installing the dblink extension, modifying postgresql.conf for shared_preload_libraries, and manual node joining, which is error-prone and time-consuming.
Every write and read involves Paxos consensus rounds and logging, adding significant latency compared to asynchronous replication methods, especially in high-throughput scenarios.