Databases

What is Read Replica?

Definition

A read replica is an asynchronously updated copy of a primary database instance used to offload and scale read-only query traffic without affecting the source database's write performance.

A read replica is a secondary database instance that maintains a near-real-time copy of data from a primary (source) database. The replica is updated asynchronously, meaning the primary does not wait for the replica to receive or apply changes before completing its own write transaction. This design prevents replicas from slowing down write-heavy workloads on the primary, but it introduces a small replication lag typically measured in milliseconds to seconds.

The read replica's primary purpose is to handle read queries such as SELECT statements, reporting, analytics, or data extract jobs. By directing these queries to replicas instead of the primary, operators reduce contention on the primary's CPU, memory, and I/O resources. Read replicas are common in relational database systems (e.g., MySQL, PostgreSQL, Amazon RDS, Azure SQL Database) and are also used in some NoSQL stores (e.g., MongoDB, DynamoDB Global Tables with read-only replicas). Replication is usually log-based or stream-based: the primary streams its transaction log or change data capture (CDC) stream to the replica, which applies the changes in order.

In a cloud or distributed architecture, read replicas can be deployed in different availability zones or geographic regions for better disaster recovery and lower latency for geographically distributed users. However, because the replication is asynchronous, the replica may not reflect the latest writes at any given moment. Applications that require strong consistency should always read from the primary. Some database services allow promoting a read replica to a standalone primary in case of failure, though this may cause some data loss equal to the replication lag.

Key facts

  • Updates propagate asynchronously from the primary to the replica; lag is typically milliseconds to seconds.
  • Read replicas handle only SELECT or read-only queries; writes are rejected on the replica.
  • Fully supported by major cloud RDS services: Amazon RDS, Azure Database, Google Cloud SQL.
  • Promoting a read replica to a primary is possible but may lose unapplied writes from the lag window.
  • Does not improve write throughput or reduce write latency; designed only for read scaling.

How it works in practice

A SaaS company runs a PostgreSQL database for its core application. The primary handles customer signups, orders, and inventory updates. To serve a real-time dashboard with historical sales reports, the team creates two read replicas in different AWS availability zones. The reporting service queries the replicas round-robin, avoiding any query load on the primary. A small lag of under one second is acceptable for the dashboard's accuracy requirements.

Related terms

Primary Database Replication Lag Multi-AZ Deployment Change Data Capture Amazon RDS Read Replica Streaming Replication Aurora Replicas

References

More in Databases

ACID

ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties guaranteeing reliable database transaction processing, ensuring data integrity despite concurrent access or failures.

B-Tree Index

A B-Tree index is a self-balancing tree data structure that maintains sorted data for efficient insertion, deletion, and range queries in database systems.

BASE

BASE is a design philosophy for distributed databases that prioritizes availability and partition tolerance over immediate consistency, making it a looser alternative to ACID in NoSQL systems.

CAP Theorem

CAP theorem states that a distributed data system cannot simultaneously provide consistency, availability, and partition tolerance; it can only guarantee two of the three.

Connection Pool

A managed cache of database connections that applications reuse rather than opening and closing a connection for each query, reducing latency and server load.

Failover

Failover is the process of automatically or manually promoting a replica database to primary when the active node fails, ensuring continued availability.

Foreign Key

A column or set of columns in a database table whose values must match a primary key in another table, ensuring referential integrity between the two tables.

Hash Index

A data structure that maps keys to storage locations using a hash function, providing constant-time equality lookups but no ordered or range scans.

Materialized View

A database object that stores the precomputed result of a query as a table, refreshed periodically or on demand to improve read performance and reduce computational overhead.

NoSQL

NoSQL is a family of non-relational database systems designed for flexible schemas, horizontal scaling, and high-throughput data access that traditional SQL databases cannot easily provide.

Who Is Online

In total there are 54 users online: 0 registered, 48 guests and 6 bots.

Most users ever online was 5,555 on 17 Jul 2026, 3:23 am.

Bots: Applebot Baiduspider Other Bot Other Crawler PetalBot SemrushBot

Users active in the past 15 minutes. Total registered members: 369