Offload application reads
Read-heavy production applications
Neon · Const
A read-only compute is an independent Neon compute for read operations against the same storage used by a primary read-write compute. It adds read capacity without duplicating database storage.
A read-only compute is an independent compute attached to the same branch as a primary read-write compute. It serves read operations from the same storage rather than maintaining a copied or replicated dataset, so it can handle read traffic without adding storage.
neon branches add-compute <branch-id> --type read_replicaA dedicated read-only compute and its connection string for routing read operations.
const replica = await neonApi.createProjectEndpoint(projectId, {
branch_id: branchId,
endpoint: {
type: "read_replica"
}
});
console.log(replica.endpoint.host);Creates a Neon read-only compute through the Create compute API endpoint; use its connection details for read queries.
Read-heavy production applications
Vector similarity search
Analytics or exploratory SQL
It is an independent compute dedicated to read operations while the primary compute remains read-write. It uses the same storage as the primary, so adding one does not duplicate the database.
Follow-up: What happens to storage when multiple read-only computes are added? Storage is still shared rather than replicated; the additional resources are compute instances.
Read-only computes let applications direct read traffic away from the primary compute. This can increase throughput for read-heavy workloads while keeping writes on the primary.
Follow-up: How would you use one for vector search? Route the read-only vector similarity workload to the replica so it does not compete with the primary for compute resources.
Create a read replica for the branch, then use its connection string for the read workload. Neon documents both the CLI command neon branches add-compute and the Create compute API endpoint for this operation.
Follow-up: What connection should application code select? Use the read replica connection for reads and retain the primary read-write connection for writes.
Read replicasneon branches add-computeCreate compute