pg-sharding/spqr

Stateless Postgres Query Router.

Go

1,480

2,757 commits

updated Oct 9, 2026

See the code

README

Go Go Docs Telegram Chat

Stateless Postgres Query Router

Stateless Postgres Query Router is a production-ready system for horizontal scaling of PostgreSQL via sharding.


PostgreSQL is awesome, but it's hard to manage a single database with some terabytes of data and 105+ queries per second. Current sharding solutions focus on analytical and hybrid workloads (OLAP, HTAP). Moreover, most of those solutions do not provide a smooth path for monolith to sharded transitions, which is why Yandex Cloud's Data Platform team developed SPQR.

SPQR is a production-ready system for horizontal scaling of PostgreSQL via sharding. We appreciate any kind of feedback and contribution to the project.

Get started

To get started, please visit our documentation. The full list of features is available here.

Development

You can use make run for a quick example using Docker. For local development, you need the latest Go version.

How to build:

make
make build

How to run:

spqr-router run --config path-to-router-config.yaml

Tests

SPQR has all types of tests: unit, regress, and end-to-end. These tests require Docker Compose, and can be run using make. For more information on testing, please see unittest, regress, and feature sections in Makefile.

Support

We have a Telegram chat to discuss SPQR usage and development. If you're missing a feature or have found a bug, please open a GitHub Issue. We appreciate any kind of feedback and contribution to the project.

License

The SPQR source code is distributed under the PostgreSQL Global Development Group License.

go
pooler
postgres
postgresql
proxy
sharding

pg-sharding/spqr

Stateless Postgres Query Router.

Go

1,480

2,757 commits

updated Oct 9, 2026

See the code

README

Go Go Docs Telegram Chat

Stateless Postgres Query Router

Stateless Postgres Query Router is a production-ready system for horizontal scaling of PostgreSQL via sharding.


PostgreSQL is awesome, but it's hard to manage a single database with some terabytes of data and 105+ queries per second. Current sharding solutions focus on analytical and hybrid workloads (OLAP, HTAP). Moreover, most of those solutions do not provide a smooth path for monolith to sharded transitions, which is why Yandex Cloud's Data Platform team developed SPQR.

SPQR is a production-ready system for horizontal scaling of PostgreSQL via sharding. We appreciate any kind of feedback and contribution to the project.

Get started

To get started, please visit our documentation. The full list of features is available here.

Development

You can use make run for a quick example using Docker. For local development, you need the latest Go version.

How to build:

make
make build

How to run:

spqr-router run --config path-to-router-config.yaml

Tests

SPQR has all types of tests: unit, regress, and end-to-end. These tests require Docker Compose, and can be run using make. For more information on testing, please see unittest, regress, and feature sections in Makefile.

Support

We have a Telegram chat to discuss SPQR usage and development. If you're missing a feature or have found a bug, please open a GitHub Issue. We appreciate any kind of feedback and contribution to the project.

License

The SPQR source code is distributed under the PostgreSQL Global Development Group License.

go
pooler
postgres
postgresql
proxy
sharding

Project health

Overall

6.2/10

Maintained

10/10

Code review

10/10
OpenSSF Scorecard

Significant stargazers

(top 24 of 36)

Alec Thomas

1,436 followers · starred Apr 2024

Adrian Garcia Badaracco

689 followers · starred Feb 2025

Pavel Zloi

417 followers · starred Mar 2026

Denis Malinochkin

368 followers · starred Aug 2024