Back to browse
GitHub Repository

A microservice (sidecar) that helps instantly determine the status of your PostgreSQL hosts including whether they are alive, which one is the master, which ones are replicas, and how far each replica is lagging behind the master.

73 starsC

Pg-status – lightweight HTTP sidecar for PG master/replica discovery

by krylosov-aa·Jun 14, 2026·2 points·0 comments

AI Analysis

●●SolidSolve My ProblemDark Horse

Lightweight C sidecar for PG status avoids heavy orchestrators like Patroni or Consul.

Strengths
  • Written in C using ~9MB RAM, significantly lighter than Python-based orchestrators.
  • Serves status from memory for sub-millisecond responses, avoiding direct database query overhead.
  • Supports read-your-writes consistency checks via LSN filtering on replica selection endpoints.
Weaknesses
  • Adds another moving part to the stack compared to querying system catalogs directly.
  • Lacks built-in failover automation, requiring separate tooling for actual promotion logic.
Target Audience

Backend engineers managing multi-node PostgreSQL clusters

Similar To

Patroni · Consul

Post Description

pg-status polls your PostgreSQL hosts in the background and answers "who's the current master?", "which replica has lag ≤ 100ms?", "which replica has already replayed this LSN?" — all from memory, in under a millisecond. Written in C, ~9MB RAM.

Similar Projects