This is a proof-of-concept for a PostgreSQL logical+phsyical sharding strategy. Taking advantage of postgres_fdw and table partitioning, this pattern allows for spreading the data from a partition table among multiple physical servers.
Requirements:
Usage:
- Start up the Docker stack:
$ docker-compose up -d-
Wait until you see the
Listening on port 5555...message in theservercontainer logs -
Kick off fake data population:
$ curl http://localhost:5555/populate-
Wait until you see the
Done populating DB!message in theservercontainer logs (this will take a while) -
Browse the DB via:
$ docker-compose exec db_primary psql -U user -d scaling