Pull the SPQR docker image
Pull the SPQR docker image
Build the SPQR locally
Build the SPQR locally
Setting up sharding
First, you need to configure the rules by which the router will decide which of the shards to send each request to. For this purpose, SPQR has an administrative console. This is an app that works by PostgreSQL protocol and you can connect to it by usual psql. You can find the console port in your config file.- What tables do you query
- Which columns in each table should the router search for
- Types of these columns
- Mapping from [range of values] to [shard number]
Connect to SPQR router
Now we can connect to proxy a.k.a. router and play with it. Please use psql again, but this time connect to a different port.
NOTICE messages are disabled by default, specify show_notice_messages
setting in the router config to enable them
The order can be found on the first shard:
SELECT * FROM table
but we don’t recommend using it. This feature is implemented in a non-transactional way.