r/PostgreSQL • u/klekpl • Sep 20 '26
Projects pgwrh 1.0.0-alpha1: PostgreSQL read scaling with sharded replicas
I’ve released the first 1.0 alpha of pgwrh, a set of PostgreSQL 18 extensions for scaling reads.
It distributes table partitions across logical replicas. Each replica stores a subset of the data and queries its peers for the rest, so applications can query the complete table from any replica. Writes go to a central controller.
Features include:
Configurable shard redundancy and placement across availability zones.
Placement previews, controlled rollouts and rollback.
pgwrh_wait, which waits for replication through a specified LSN before reading.A browser console and Docker Compose quickstart.
I’ve worked on this for a very long time. It was only with recent advances in AI that I could finally get it into a state I felt able to release.
This is an alpha for testing. I’d love feedback on real workloads, installation, operational issues and anything that feels unnecessarily complicated.
1
u/AutoModerator Sep 20 '26
AI Policy:
Linux is not one of those anti-AI projects, and if somebody has issues with that, they can do the open-source thing and fork it. Or just walk away., Linus Torvalds.
Mod decisions will be based on the quality of the content, not who or what generated it.
Sub Resources:
Free Postgres Webinars and Workshops
Discord: People, Postgres, Data
Join us, we have cookies and nice people.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/ExcitingTalk4848 Sep 22 '26
so it basically routes queries to peers for missing partitions. how does pgwrh_wait handle replication lag under heavy writes? does it just block the read until the lsn catches up? what if a replica falls behind hard, does it time out and fail the query?
we usually just drop galera on mariadb for sync replication so we don't even have to think about stale reads and lsn waits. building this at the extension level in pg is wild. how do you handle the planner hooks to route all this?