pgRaft

PostgreSQL Raft Consensus Extension

Embed Raft consensus directly into PostgreSQL. Use these guides to deploy pgRaft, manage multi-node clusters, execute failovers safely, and monitor consensus health with SQL.

Key Capabilities

Raft Consensus

Deterministic leader election, log replication, and commit guarantees implemented inside PostgreSQL.

High Availability

Automatic failover, quorum enforcement, and rolling maintenance procedures for mission-critical deployments.

Low Latency

Configurable heartbeat and election timers with optimized AppendEntries batching for LAN or geo clusters.

SQL Integration

Manage membership, inspect Raft state, and orchestrate maintenance entirely through SQL functions and views.

Documentation Library

Guides & Tutorials

Install pgRaft, bootstrap the first cluster, and learn daily operator workflows.

  • Getting Started

    Enable pgRaft, initialize metadata, and verify leader election.

  • Installation

    Compile from source, install binaries, and confirm shared libraries.

  • Configuration

    postgresql.conf and pg_hba settings for Raft traffic.

  • Cluster Management

    Add/remove nodes, perform rolling upgrades, and monitor health.

Reference & Advanced

Dig into Raft internals, SQL APIs, performance tuning, troubleshooting, and diagnostics.

  • Architecture

    Understand background workers, metadata stores, and networking model.

  • SQL Functions

    Reference for membership, monitoring, and maintenance routines.

  • Performance Tuning

    Consensus timing, batching, WAL optimization, and observability.

  • Troubleshooting

    Resolve election churn, lag, snapshot backlog, and connectivity issues.