# read-replica

Published articles for read-replica.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Detecting Replica Lag That Breaks Read-Your-Writes Consistency

DevFeed: [Detecting Replica Lag That Breaks Read-Your-Writes Consistency](<https://devfeed.tech/articles/the-replica-lag-you-do-not-measure-is-the-one-serving-checkout-39596.md>)

Original publisher: [Read original article](<https://ankit-rana.com/logs/44-replica-lag-read-your-writes/>)

Author: hello@ankit-rana.com

Published: 2026-08-28T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ankit Rana | Mechanical Sympathy](<https://devfeed.tech/sources/ankit-rana-mechanical-sympathy.md>)

Topics: [Replication](<https://devfeed.tech/topics/replication.md>), [Routing (disambiguation)](<https://devfeed.tech/topics/routing.md>)

Tags: [checkout](<https://devfeed.tech/tags/checkout.md>), [consistency](<https://devfeed.tech/tags/consistency.md>), [lag](<https://devfeed.tech/tags/lag.md>), [metric](<https://devfeed.tech/tags/metric.md>), [observability](<https://devfeed.tech/tags/observability.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [primary](<https://devfeed.tech/tags/primary.md>), [read-replica](<https://devfeed.tech/tags/read-replica.md>), [read-replicas](<https://devfeed.tech/tags/read-replicas.md>), [replica-lag](<https://devfeed.tech/tags/replica-lag.md>), [replication](<https://devfeed.tech/tags/replication.md>), [routing](<https://devfeed.tech/tags/routing.md>)

### AI overview

This article explains how read replicas can break read-your-writes behavior when applications do not route related reads to the primary or wait for replication. It compares byte lag with time lag, explains why idle systems can hide failures, and discusses replay delays caused by write bursts and long-running replica queries.

### Source excerpt

Byte lag between primary and replica reads zero on an idle primary even when replication is completely stuck, so the metric that looks healthiest is the one that hides the failure. Time lag measured from the last replayed transaction is the signal that stays honest. Adding a read replica silently removes read-your-writes, which means any flow that writes and then reads back needs either primary routing or an explicit wait for the replica to reach that write's log position.

## Read Replica Migration: Lessons and Query Routing Patterns

DevFeed: [Read Replica Migration: Lessons and Query Routing Patterns](<https://devfeed.tech/articles/don-t-add-a-read-replica-until-you-ve-read-this-11760.md>)

Original publisher: [Read original article](<https://incident.io/blog/dont-add-a-read-replica-until-youve-read-this>)

Author: Johanna Larsson

Published: 2026-07-21T11:00:45Z

Content type: tutorial

Language: en

Sources: [The incident.io Blog](<https://devfeed.tech/sources/the-incident-io-blog.md>)

Topics: [Databases](<https://devfeed.tech/topics/databases.md>), [Database](<https://devfeed.tech/topics/database.md>)

Tags: [incident](<https://devfeed.tech/tags/incident.md>), [incident-channel](<https://devfeed.tech/tags/incident-channel.md>), [incident-management](<https://devfeed.tech/tags/incident-management.md>), [incident-response](<https://devfeed.tech/tags/incident-response.md>), [learnings](<https://devfeed.tech/tags/learnings.md>), [migrations](<https://devfeed.tech/tags/migrations.md>), [outage](<https://devfeed.tech/tags/outage.md>), [patterns](<https://devfeed.tech/tags/patterns.md>), [post-mortem](<https://devfeed.tech/tags/post-mortem.md>), [read-replica](<https://devfeed.tech/tags/read-replica.md>), [slack-incident](<https://devfeed.tech/tags/slack-incident.md>)

### AI overview

The article shares incident.io's experience migrating workload to a read replica, including the benefits, operational complexity, and patterns for routing queries between the replica and primary database.

### Source excerpt

Our learnings from implementing a product-wide read replica migrations, including some useful patterns for routing queries to replica and primary

## From Single Instance to Split-Brain: A Database Scaling Journey

DevFeed: [From Single Instance to Split-Brain: A Database Scaling Journey](<https://devfeed.tech/articles/from-single-instance-to-split-brain-a-database-scaling-journey-22540.md>)

Original publisher: [Read original article](<https://medium.com/walmartglobaltech/from-single-instance-to-split-brain-a-database-scaling-journey-8b6a27a65023?source=rss----905ea2b3d4d1---4>)

Author: Alok Mishra

Published: 2026-03-31T18:40:52Z

Content type: tutorial

Language: en

Sources: [Walmart Global Tech](<https://devfeed.tech/sources/walmart-global-tech.md>)

Topics: [Databases](<https://devfeed.tech/topics/databases.md>), [Replication](<https://devfeed.tech/topics/replication.md>), [MySQL](<https://devfeed.tech/topics/mysql.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Self-hosted](<https://devfeed.tech/topics/self-hosted.md>), [backups](<https://devfeed.tech/topics/backups.md>), [Cloud](<https://devfeed.tech/topics/cloud.md>), [Monitoring](<https://devfeed.tech/topics/monitoring.md>), [Amazon EC2](<https://devfeed.tech/topics/amazon-ec2.md>), [Kubernetes](<https://devfeed.tech/topics/kubernetes.md>)

Tags: [architecture](<https://devfeed.tech/tags/architecture.md>), [backups](<https://devfeed.tech/tags/backups.md>), [bare-metal](<https://devfeed.tech/tags/bare-metal.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [cloud-services](<https://devfeed.tech/tags/cloud-services.md>), [cloud-sql](<https://devfeed.tech/tags/cloud-sql.md>), [cockroachdb](<https://devfeed.tech/tags/cockroachdb.md>), [database](<https://devfeed.tech/tags/database.md>), [ec2](<https://devfeed.tech/tags/ec2.md>), [failover](<https://devfeed.tech/tags/failover.md>), [google](<https://devfeed.tech/tags/google.md>), [google-cloud](<https://devfeed.tech/tags/google-cloud.md>), [google-cloud-sql](<https://devfeed.tech/tags/google-cloud-sql.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [production](<https://devfeed.tech/tags/production.md>), [read-replica](<https://devfeed.tech/tags/read-replica.md>), [recovery](<https://devfeed.tech/tags/recovery.md>), [software-architecture](<https://devfeed.tech/tags/software-architecture.md>), [software-development](<https://devfeed.tech/tags/software-development.md>), [software-engineering](<https://devfeed.tech/tags/software-engineering.md>)

### AI overview

This article explains how database scaling commonly uses a single-leader architecture with asynchronous read replicas. It discusses replication lag, stale reads, split-brain risks, read/write traffic separation, and the operational responsibilities of self-managed versus fully managed database services.

### Source excerpt

I used to think adding a 'Read Replica' was a magic button for scaling applications. I was wrong. While splitting read and write traffic is a standard system design pattern, implementing it introduces a world of pain - from stale reads to the dreaded Split-Brain problem. Here is how database replication actually works, and how to survive the transition. When people talk about "scaling databases" or "adding read replicas", they are almost always thinking about one specific architecture: Single-leader (Primary-Replica) architecture with asynchronous replication This is the architecture used by: MySQL + replicas PostgreSQL + streaming replication Google Cloud SQL PlanetScale, Neon, Supabase, etc. There is exactly one node that accepts writes -> called the Primary (or Leader/Master). All other nodes are Read Replicas -> they apply changes from the primary as fast as they can, but always with some delay (replication lag). This is the default and dominant model in 99% of applications today. Alternative architectures exist (multi-primary, leaderless, CRDTs, etc.), but they are rare and come with their own very different trade-offs. The second axis that actually matters in practice is: Who manages the replicas and failover for you?1. Self-hosted / Self-managed You run MySQL or PostgreSQL yourself (on EC2, Kubernetes, bare metal, etc.). You are 100% responsible for: Setting up replication Promoting a new primary when the old one dies Routing traffic correctly Handling replication lag Monitoring, backups, point-in-time recovery, etc. 2. Fully-managed cloud services RDS, Aurora, PlanetScale, Neon, Supabase, CockroachDB, Spanner, YugabyteDB, etc. The provider gives you a single connection string (or two: one for writes, one for reads) and magically keeps it pointing to healthy nodes, handles failover in seconds, and often hides (or eliminates) replication lag headaches. This second axis is the one that determines how much pain you will actually feel in production. Now, suppose yo

## When SIGTERM Does Nothing: A Postgres Mystery

DevFeed: [When SIGTERM Does Nothing: A Postgres Mystery](<https://devfeed.tech/articles/when-sigterm-does-nothing-a-postgres-mystery-5569.md>)

Original publisher: [Read original article](<https://clickhouse.com/blog/sigterm-postgres-mystery>)

Author: Kevin Biju Kizhake Kanichery

Published: 2025-07-08T14:29:41Z

Content type: article

Language: en

Sources: [ClickHouse Blog](<https://devfeed.tech/sources/clickhouse-blog.md>)

Topics: [bug](<https://devfeed.tech/topics/bug.md>), [Replication](<https://devfeed.tech/topics/replication.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [clickhouse](<https://devfeed.tech/topics/clickhouse.md>), [Cloud](<https://devfeed.tech/topics/cloud.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [bug](<https://devfeed.tech/tags/bug.md>), [clickhouse](<https://devfeed.tech/tags/clickhouse.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [community](<https://devfeed.tech/tags/community.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [production](<https://devfeed.tech/tags/production.md>), [read-replica](<https://devfeed.tech/tags/read-replica.md>), [real-time](<https://devfeed.tech/tags/real-time.md>), [replication](<https://devfeed.tech/tags/replication.md>), [stream](<https://devfeed.tech/tags/stream.md>)

### AI overview

The article investigates a Postgres bug affecting logical replication slot creation on read replicas. It explains how an unusually long-running query became impossible to terminate, how the issue was diagnosed, and how the ClickPipes team fixed it while working with the Postgres community.

### Source excerpt

A story about a bug with logical replication slot creation on Postgres read replicas

## Data API Routes to Nearest Read Replica

DevFeed: [Data API Routes to Nearest Read Replica](<https://devfeed.tech/articles/data-api-routes-to-nearest-read-replica-352.md>)

Original publisher: [Read original article](<https://supabase.com/blog/data-api-nearest-read-replica>)

Author: José Ledesma

Published: 2025-04-04T07:00:00Z

Content type: article

Language: en

Sources: [Supabase Blog](<https://devfeed.tech/sources/supabase-blog.md>)

Topics: [API](<https://devfeed.tech/topics/api.md>), [Latency](<https://devfeed.tech/topics/latency.md>), [Database](<https://devfeed.tech/topics/database.md>), [Algorithms, Complexity](<https://devfeed.tech/topics/algorithms-complexity.md>), [networking](<https://devfeed.tech/topics/networking.md>)

Tags: [algorithms](<https://devfeed.tech/tags/algorithms.md>), [api](<https://devfeed.tech/tags/api.md>), [data](<https://devfeed.tech/tags/data.md>), [geospatial](<https://devfeed.tech/tags/geospatial.md>), [latency](<https://devfeed.tech/tags/latency.md>), [load-balancer](<https://devfeed.tech/tags/load-balancer.md>), [mapping](<https://devfeed.tech/tags/mapping.md>), [network](<https://devfeed.tech/tags/network.md>), [read-replica](<https://devfeed.tech/tags/read-replica.md>), [round-robin](<https://devfeed.tech/tags/round-robin.md>)

### AI overview

Supabase is releasing geo-routing for Data API requests, directing each request to the geographically nearest read replica. The feature uses network-edge geolocation, regional coordinate mapping, distance calculations with the Haversine formula, and round-robin distribution when multiple databases share a region. It is available by default through a load balancer endpoint and requires only a project URL update.

### Source excerpt

Route your Data API (PostgREST) requests to the nearest Read Replica

## Scaling Nextdoor's Datastores: Part 2

DevFeed: [Scaling Nextdoor's Datastores: Part 2](<https://devfeed.tech/articles/scaling-nextdoor-s-datastores-part-2-20341.md>)

Original publisher: [Read original article](<https://engblog.nextdoor.com/scaling-nextdoors-datastores-part-2-513922e4b4b1?source=rss----5e54f11cdfdf---4>)

Author: Tushar Singla

Published: 2025-03-19T15:08:32Z

Content type: article

Language: en

Sources: [Nextdoor](<https://devfeed.tech/sources/nextdoor.md>)

Topics: [Database](<https://devfeed.tech/topics/database.md>), [Replication](<https://devfeed.tech/topics/replication.md>), [Django](<https://devfeed.tech/topics/django.md>), [Object-relational mapping](<https://devfeed.tech/topics/orm.md>), [consistency](<https://devfeed.tech/topics/consistency.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Transactions](<https://devfeed.tech/topics/transactions.md>)

Tags: [consistency](<https://devfeed.tech/tags/consistency.md>), [database](<https://devfeed.tech/tags/database.md>), [database-scalability](<https://devfeed.tech/tags/database-scalability.md>), [django](<https://devfeed.tech/tags/django.md>), [orm](<https://devfeed.tech/tags/orm.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [rdbms](<https://devfeed.tech/tags/rdbms.md>), [read-replica](<https://devfeed.tech/tags/read-replica.md>), [replication](<https://devfeed.tech/tags/replication.md>), [transactions](<https://devfeed.tech/tags/transactions.md>)

### AI overview

The second installment of Nextdoor's datastore-scaling series examines the consistency problems caused by database read replicas. It describes how routing decisions became obscured by Django ORM abstractions, leading to read-after-write races, and explains how transactions were used as a workaround with negative effects on database load.

### Source excerpt

In the second installment of Nextdoor's "Scaling Nextdoor's Datastores" blog series, the Core-Services team discusses challenges faced after implementing database read replicas. Adding read replicas to an existing database is a very common pattern as applications or products evolve to handle increased demand. Typically, the implementation details are hand waved and it's assumed that this strategy will work. However, that is rarely the case, and we'll dive into some more of the intricacies around the implementation. Initial Attempt When replicas were first introduced in the Nextdoor stack, we gave the product engineers latitude to choose when they wanted to have their query routed to a read replica or to the primary. This was done by leveraging the existing routing mechanism in our ORM, Django. This seemed like the right idea at the time because the product engineers had the most context around consistency requirements within their changes and load characteristics of their product feature. Therefore, they would have the best ability to judge which node to send their query to. However, as our business logic evolved and became more feature-rich, product engineers began to add abstraction layers to help abstract complex operations away from business logic. In this design evolution there is a high frequency read, followed by a low frequency conditional write, followed by a read. The read performed after the write should be routed to the primary, but that may get buried in abstractions and this requirement regressed. The explicit routing decisions engineers made became buried and subsequently created a serious problem for users of these abstractions. If one abstraction method was performing a write and another a read, they could not safely be used together due to read-after-write consistency issues. Due to replication lag between the primary and replica databases, a race condition arises when the application attempts to read data from a replica after performing a write. W

## Failover Replication Slots with Postgres 17

DevFeed: [Failover Replication Slots with Postgres 17](<https://devfeed.tech/articles/failover-replication-slots-with-postgres-17-18816.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/failover-replication-slots-with-postgres-17/>)

Published: 2024-12-03T00:00:00Z

Content type: article

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [Replication](<https://devfeed.tech/topics/replication.md>), [Availability](<https://devfeed.tech/topics/availability.md>), [Database](<https://devfeed.tech/topics/database.md>), [data-platforms](<https://devfeed.tech/topics/data-platforms.md>)

Tags: [availability](<https://devfeed.tech/tags/availability.md>), [data](<https://devfeed.tech/tags/data.md>), [data-platforms](<https://devfeed.tech/tags/data-platforms.md>), [database](<https://devfeed.tech/tags/database.md>), [debezium](<https://devfeed.tech/tags/debezium.md>), [failover](<https://devfeed.tech/tags/failover.md>), [read-replica](<https://devfeed.tech/tags/read-replica.md>), [replication](<https://devfeed.tech/tags/replication.md>)

### AI overview

This article explains how Postgres 17 introduces built-in failover slots. Replication slots created on a primary are automatically propagated to read replicas, allowing consumers such as Debezium to continue after failover without missing change events or creating a new initial snapshot.

### Source excerpt

Table of Contents Hello, Failover Slots! Failover Slots in Decodable Wrapping Up This post originally appeared on the Decodable blog. All rights reserved. Postgres read replicas are commonly used not only to distribute query load amongst multiple nodes, but also to ensure high availability (HA) of the database. If the primary node of a Postgres cluster fails, a read replica can be promoted to be the new primary, processing write (and read) requests from thereon.

## Introducing Read Replicas

DevFeed: [Introducing Read Replicas](<https://devfeed.tech/articles/introducing-read-replicas-408.md>)

Original publisher: [Read original article](<https://supabase.com/blog/introducing-read-replicas>)

Author: Angelico de los Reyes

Published: 2023-12-15T07:00:00Z

Content type: release

Language: en

Sources: [Supabase Blog](<https://devfeed.tech/sources/supabase-blog.md>)

Topics: [Databases](<https://devfeed.tech/topics/databases.md>), [Replication](<https://devfeed.tech/topics/replication.md>), [autoscaling](<https://devfeed.tech/topics/autoscaling.md>), [Latency](<https://devfeed.tech/topics/latency.md>), [Cloud](<https://devfeed.tech/topics/cloud.md>)

Tags: [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [compute](<https://devfeed.tech/tags/compute.md>), [latency](<https://devfeed.tech/tags/latency.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [read-replica](<https://devfeed.tech/tags/read-replica.md>), [replication](<https://devfeed.tech/tags/replication.md>), [scale](<https://devfeed.tech/tags/scale.md>), [transactions](<https://devfeed.tech/tags/transactions.md>)

### AI overview

Supabase is launching Postgres Read Replicas, which asynchronously copy data from a primary database and serve read-only traffic. Replicas can distribute load, support redundancy and complex queries, and reduce latency by running in regions closer to users. The article also discusses replication lag, scaling limits, recovery complexity, and application changes needed to use replicas effectively.

### Source excerpt

We are launching support for Postgres Read Replicas

## Examining Postgres 9.4 - A first look

DevFeed: [Examining Postgres 9.4 - A first look](<https://devfeed.tech/articles/examining-postgres-9-4-a-first-look-41160.md>)

Original publisher: [Read original article](<https://www.craigkerstiens.com/2014/02/02/Examining-PostgreSQL-9.4/>)

Author: Map

Published: 2014-02-02T20:55:56Z

Content type: article

Language: en

Sources: [Craig Kerstiens](<https://devfeed.tech/sources/craig-kerstiens.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Caching](<https://devfeed.tech/topics/caching.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [functions](<https://devfeed.tech/topics/functions.md>)

Tags: [aggregate-functions](<https://devfeed.tech/tags/aggregate-functions.md>), [cache](<https://devfeed.tech/tags/cache.md>), [failover](<https://devfeed.tech/tags/failover.md>), [pg-stat-statements](<https://devfeed.tech/tags/pg-stat-statements.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [read-replica](<https://devfeed.tech/tags/read-replica.md>)

### AI overview

A first look at PostgreSQL 9.4 while it is still in its final commit fest. The article discusses pg_prewarm for loading data into memory, concurrent materialized-view refreshes, and ordered-set aggregates, while noting that additional features may still change before release.

### Source excerpt

PostgreSQL is currently entering its final commit fest. While its still going, which means there could still be more great features to come, we can start to take a look at what you can expect from it now. This release seems to bring a lot of minor increments versus some bigger highlights of previous ones. At the same time there's still a lot on the bubble that may or may not make it which could entirely change the shape of this one. For a peek back of some of the past ones: Highlights of 9.2 pg_stat_statements Index only scans JSON Support Range types Huge performance improvements Highlights of 9.3 Postgres foreign data wrapper Materialized views Checksums On to 9.4 With 9.4 instead of a simply list lets dive into a little deeper to the more noticable one. pg_prewarm I'll lead with one that those who need it should see huge gains (read larger apps that have a read replica they eventually may fail over to). Pg_prewarm will pre-warm your cache by loading data into memory. You may be interested in running pg_prewarm before bringing up a new Postgres DB or on a replica to keep it fresh. Why it matters - If you have a read replica it won't have the same cache as the leader. This can work great as you can send queries to it and it'll optimize its own cache. However, if you're using it as a failover when you do have to failover you'll be running in a degraded mode while your cache warms up. Running pg_pregwarm against it on a periodic basis will make the experience when you do failover a much better one. Refresh materialized view concurrently Materialized views just came into Postgres in 9.3. The problem with them is they were largely unusable. This was because they 1. Didn't auto-refresh and 2. When you did refresh them it would lock the table while it ran the refresh making it unreadable during that time. Materialized views are often most helpful on large reporting tables that can take some time to generate. Often such a query can take 10-30 minutes or even more to run.