Overview
The bare router deployment is the simplest way to run SPQR. It’s ideal for testing, development, and scenarios where your sharding rules don’t need to be updated dynamically. In this deployment mode:- You run
spqr-routerwith aninit_sqlfile - The router reads the sharding configuration from this local file on startup
- No external coordinator or etcd cluster is required
- You can run multiple router instances simultaneously
- Each router instance operates independently
Setup
1. Create Router Configuration File
Create a YAML configuration file (e.g.,router.yaml):
router.yaml
2. Create Init SQL File
Create an SQL file with your sharding configuration (e.g.,init.sql):
init.sql
3. Start the Router
4. Connect
Clients can now connect to the router:Considerations
- Configuration changes require updating the
init.sqlfile and restarting the router - No dynamic updates are possible while the router is running
- For persistence you may set
memqdb_backup_path. This feature is deprecated and may be removed in a future release — use at your own risk.