Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Neon · Const

Read-only compute

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.

How it works

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.

Syntax

neon branches add-compute <branch-id> --type read_replica

Returns

A dedicated read-only compute and its connection string for routing read operations.

Key points

  • It is a separate compute resource intended specifically for read workloads.
  • The read-only compute exposes the same branch data as the primary compute.
  • Creating a read-only compute is quick because Neon starts a compute against existing storage.
  • Additional read-only computes provide extra compute capacity for read traffic.
  • Shared storage means adding the read-only compute does not duplicate storage charges.

Common mistakes

  • A read-only compute is not a second database containing copied data; it reads from the shared storage.
  • Do not assume replica storage provides independent data locality or replication.

Example: Create a read-only compute

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.

When to use it

Offload application reads

Read-heavy production applications

Isolate vector workloads

Vector similarity search

Run ad-hoc queries

Analytics or exploratory SQL

Interview questions

QWhat is a Neon read-only compute?

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.

QWhy use a read-only compute?

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.

QHow do you connect to a read-only compute?

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 replicas
  • neon branches add-compute
  • Create compute

Source: Neon Read Replicas. Checked 2026-10-16.