• Stars
    star
    661
  • Rank 65,589 (Top 2 %)
  • Language
    Go
  • License
    Other
  • Created over 2 years ago
  • Updated 24 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Stateless Postgres Query Router.

Go Go GitHub go.mod Go version Go Report

Stateless Postgres Query Router

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

For more about SPQR, please see docs/ and benchmarks/.

Main features

  • Transaction and session pooling
  • Multiple routers for fault tolerance
  • Sharding
  • Liquid data migrations
  • Limited multi-shard queries
  • Works over PostgreSQL protocol
  • Falling unrouted queries to the world shard
  • Minor overhead for query execution
  • and, of course, TLS support

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 -c path-to-router-config.yaml

Tests

SPQR has regression tests. These tests require Docker Compose, and can be run using make regress. Also, there are stress tests, but it's a work in progress. For more information on testing, please see test and stress sections in Makefile.

License

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