Skip to main content

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-router with an init_sql file
  • 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

Connect to the admin console to verify the configuration:
Check the configured shards and key ranges:

4. Connect

Clients can now connect to the router:
The router will automatically route queries to the appropriate shard based on the sharding key.

Considerations

  • Configuration changes require updating the init.sql file 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.
For configuration reference, see the Router Configuration reference.