Skip to main content
The SPQR Router configuration can be specified in JSON, TOML, or YAML format. The configuration file passing as a parameter to run command:
Refer to the pkg/config/router.go file for the most up-to-date configuration options.

General Settings

Network Settings

Frontend Rules

Frontend rule is a specification of how clients connect to the router. Refer to the FrontendRule struct in the pkg/config/rules.go file for the most up-to-date configuration options.

Backend Rules

Backend Rule is a global setting that determines how the router connects to every shard. Refer to the BackendRule struct in the pkg/config/rules.go and pkg/config/auth_backend.go file for the most up-to-date configuration options.

Shards

Map of string to Shard objects. Refer to the Shard struct in the pkg/config/router.go file for the most up-to-date configuration options.

Statistics Settings

Collects query execution time statistics at specified percentile levels. The router tracks two independent timing metrics:
  • Router Time (time spent in SPQR router)
  • Shard Time (time waiting for backend database)
When empty, statistics collection is disabled.

Feature Flags

Query Routing Settings

Query routing settings are nested under the query_routing configuration key and control how queries are routed across shards.
Many of these settings can be overridden at runtime using routing hints.
Refer to the QRouter struct in the pkg/config/router.go file for the most up-to-date configuration options.

Transaction Settings

Mode Settings

Debug Settings

DBpool Settings

QDB Settings