- Lower latency. Each query skips the network hop through the PlanetScale load balancer.
- Lower cross-zone costs. Per-zone hostnames keep each client’s connections inside its own zone. That avoids cross-zone latency and data transfer charges.
- Private traffic. Traffic stays off the public internet.
VPC peering is available for single-tenant and PlanetScale Managed Neki deployments in AWS and GCP. It is not available in multi-tenant regions. PlanetScale must enable VPC peering for your deployment before you can use it. Contact your PlanetScale Solutions Engineer to enable it. Peering does not disable the public endpoint. Clients must use the private hostnames to connect over the peering connection.
Set up VPC peering
The setup steps depend on your cloud provider: For GCP contact your PlanetScale Solutions Engineer.Compare with private endpoints
Hostnames
Each router group gets one hostname for all of its zones and one hostname per zone:<ROUTER_GROUP>is the router group name such asdefault.<BRANCH_ID>is the branch ID.<ZONE_ID>is the zone ID on AWS such asuse1-az1. It is the zone name on GCP such asus-central1-a. AWS maps zone names to different physical zones in each account, so Neki uses the zone ID there.<DNS_SUFFIX>ends in.direct.psdb.cloud. PlanetScale supplies it.
use1-az1 can:
- Connect to the
use1-az1hostname. - If that fails, connect to the hostname of another zone such as
use1-az2. - If every per-zone hostname fails, connect to the router group hostname.
Connection best practices
The hostnames point at individual routers and not at a load balancer. Neki updates the records when routers drain, restart or move, which happens frequently, especially with router auto-scaling enabled. The records have a short TTL. Follow these best practices in your client:- Resolve the hostname for every new connection and respect the DNS TTL.
- Connect with the hostname. Do not put router IP addresses in configuration or connection strings.
- Spread connections across every address the hostname returns. libpq 16 and later does this with
load_balance_hosts=random. - Set a maximum connection lifetime in your connection pool such as 5 to 15 minutes.
The JVM caches DNS results for 30 seconds by default. Set
networkaddress.cache.ttl=1 and networkaddress.cache.negative.ttl=3 in the java.security file or with java.security.Security.setProperty before the application does its first lookup.Connect
The PlanetScale dashboard shows the host and username for VPC peering connections.1
From the PlanetScale dashboard, select your Neki database.
2
Open Settings, then select Roles.
3
Open the role your application uses.
4
Under Connection details check that the Connection method is VPC peering.
5
Select the Router and the Query target.
6
Copy the Host and Username. To connect to one zone expand Availability zone hostnames and copy the host for that zone.
5432. It requires TLS and refuses plaintext. The routers present a certificate for *.<DNS_SUFFIX>.
sslnegotiation=direct requires PostgreSQL 17 or later. Older clients can omit it and still use TLS.Troubleshooting
If the hostname does not resolve or the connection fails, check the steps for your cloud provider first. Then:- Add
sslmode=verify-fullif Neki refuses the connection for not using TLS. - Check that you use the VPC peering username from the dashboard and not the load balancer username.
- Ask your Solutions Engineer to check the return routes and access controls on the PlanetScale side.

