Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Supabase 12 min read How-to mediumAdept

When to use Read Replicas vs. bigger compute

Choosing between vertical scaling and Postgres Read Replicas comes down to diagnosing the bottleneck first, using pg_stat_statements, read/write ratio queries, CPU utilization and EXPLAIN ANALYZE. Upgrade compute for write-heavy workloads, simple fixes with no code changes, or when tier headroom remains. Add replicas to isolate analytics, serve distant regions, or scale reads past the 16XL ceiling. Worked cost comparisons show replicas becoming more cost-effective at higher tiers. Long analytics queries on replicas need tuning of max_standby_streaming_delay, with hot_standby_feedback as a last resort because it bloats the primary. Connection pooling, CDC-based Pipelines and Multigres sharding are covered as alternatives.

Related posts

  • Introducing Read Replicas

    Supabase mediumAdept

    Supabase now supports Postgres read replicas in 12 regions, up to two per project, for offloading reads and analytics, serving data closer to users, and redundancy. Replication combines native streaming replication for low lag with file-based WAL shipping as a fallback, reusing their PITR pipeline (WAL-G archiving to S3) so replicas that fall behind past wal_keep_size can still catch up. Each replica gets its own Supavisor connection pool and PostgREST instance, with a round-robin load-balancing endpoint. Pricing covers replica compute and disk plus $0.09/GB WAL transfer, and automatic failover, geo-routing and Supavisor read/write splitting are planned.

  • Rethinking read replicas for the lakebase architecture

    Neon mediumAdept

    Lakebase Postgres implements read replicas as additional read-only computes attached to the same disaggregated storage as the primary, rather than as physical clones with their own volumes. Each replica boots from a slim base backup from the pageserver, streams WAL from Paxos-replicated safekeepers instead of the primary, and reads pages via GetPage@LSN. As a result, creation takes seconds regardless of database size, N replicas still means one copy of the data, and replicas autoscale and scale to zero with no WAL backlog to replay on wake. The post contrasts this with RDS replica provisioning (snapshot, volume hydration, streaming replication catch-up) and lists per-workload uses such as analytics, investigations, read-only agent access and background jobs.

  • Neon Compute Autoscaling Report

    Neon mediumAdept

    Neon's December 2025 fleet data shows production Postgres databases using 2.4x less compute and about 50% lower cost than they would if sized for a provisioned platform using AWS RDS's rightsizing rule (P99.5 utilization + 20%). Even that provisioning level would leave the average production database exhausting resources about 55 times a month. Read replicas, which share storage with the primary and autoscale independently, use 4x less compute. Small scale-to-zero databases cost 7.5x less than running them continuously. The methodology section covers workload classification, how P99.5 sizing and incident counts were derived from autoscaling histories, the provisioned per-CU-hour rates assumed, and why cost savings trail compute savings.

  • Scaling Prisma applications with Neon read-only replicas

    Neon mediumAdept

    Neon read-only replicas are independent compute instances that read from the same shared storage as the read-write compute. Because no data is copied via WAL replay as in traditional Postgres, they add no storage cost and are up to date at startup. Prisma apps can route reads to them with the @prisma/extension-read-replicas Client extension, which picks a random replica when several URLs are given. Writes and $transaction queries go to the primary, and $primary() forces a read against the primary when fresh data is required.

  • PostgresBench: Measuring the impact of High Availability on Managed Postgres performance

    ClickHouse mediumAdept

    PostgresBench now measures the performance cost of high-availability configurations across managed Postgres services, comparing shared-nothing designs (ClickHouse Managed Postgres, RDS, Crunchy Bridge) that use streaming standbys with shared-storage forks (Aurora, Neon) that replicate WAL to a storage layer. On a 16 vCPU/64 GB instance with a 500 GB dataset, ClickHouse's NVMe-backed service dropped to 94% of single-node TPS with one async standby and 79% with two synchronous quorum standbys, with p99 latency rising 1.8x and 2.5x. RDS throughput was roughly flat, but its p99 rose to 1.7x with one sync standby and 6.3x (817 ms) with a two-standby quorum cluster. The vendor-run results claim 2-4x throughput advantages for ClickHouse over the other services at matched compute and comparable durability.

The quest for software engineering knowledge.

Look:
Layout: