> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pg-sharding.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Multiple servers and failover

In the router configuration, it is possible to specify multiple servers for one shard. Then the router will distribute read-only queries among the replicas. However, in addition to the automatic routing, you also have the option to explicitly define the destination for a specific query by using the `target-session-attr` parameter within the query. See [Routing hints](/routing/hints#target-session-attrs) for more information.

```sql theme={null}
-- you could specify target-session-attrs anywhere in your query
SELECT pg_is_in_recovery(), id FROM tsa_test WHERE id = 22 /* target-session-attrs: read-write */;
NOTICE: send query to shard(s) : sh1
 pg_is_in_recovery | id 
-------------------+----
 f                 | 22
(1 row)
```

## Availability zone preferences

SPQR can prefer hosts in the router's availability zone and fall back to other zones when no suitable local host is available. See [Availability Zone Settings](/configuration/router#availability-zone-settings) for configuration details and an example.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.