{"head":{"title":"What Is a Database Read Replica? Definition | OceanLab","description":"A read replica is a copy of a database that serves read queries, kept in sync with the main one. When it helps, replication lag, an example and mistakes.","canonical":"https://oceanlab.in/glossary/read-replica"},"crumbs":[{"name":"Home","path":"/"},{"name":"Glossary","path":"/glossary"},{"name":"read replica","path":"/glossary/read-replica"}],"slug":"read-replica","term":"Read replica","aka":["replica database","read-only replica"],"category":"System design","short":"A read-only copy of a database that is kept in sync with the main database and takes read queries off it.","body":[["All writes go to the primary database. Changes are copied to one or more replicas, which answer read queries such as reports, search pages and dashboards. Replicas can sit in other regions to serve distant users faster."],["Copying takes time, called replication lag. It is often a fraction of a second, but under load it can grow, so a replica may briefly show slightly old data."]],"why":["Most apps read far more than they write. Replicas let you add read capacity without a bigger primary, keep heavy reports from slowing down users and give a warm copy that can help in recovery."],"example":["A marketplace's seller dashboard runs heavy queries that slow down checkout at month end. Moving dashboard queries to a read replica keeps checkout fast on the primary, and sellers see data that is at most a few seconds old."],"inBuild":["We route only reads that can tolerate slight delay to replicas, keep read-after-write flows (like showing a user what they just saved) on the primary, monitor lag and alert on it, and use ",{"href":"/glossary/connection-pooling","text":"connection pooling"}," for each database."],"mistakes":[["Sending a user's read right after their own write to a replica, so their change seems lost."],["Treating a replica as a backup. A bad delete replicates too."],["Not watching lag, so reports quietly show stale numbers."]],"related":[{"href":"/glossary/sharding","label":"Sharding","detail":"Splitting one large dataset across several databases, called shards, by a key such as customer ID, so each shard holds only part of the data."},{"href":"/glossary/connection-pooling","label":"Connection pooling","detail":"Keeping a set of open database connections and sharing them across requests, instead of opening a new connection for each one."},{"href":"/glossary/data-warehouse","label":"Data warehouse","detail":"A database built for analysis and reporting, where cleaned data from many systems is kept together in one place."},{"href":"/glossary/load-balancer","label":"Load balancer","detail":"A service that spreads incoming traffic across several servers, and stops sending traffic to any that fail their health checks."},{"href":"/glossary/autoscaling","label":"Autoscaling","detail":"Automatically adding or removing computing capacity, such as servers or containers, as the load on a system goes up or down."}],"tools":[],"links":[{"href":"/pricing/categories/databases","label":"Database pricing","detail":"Managed database prices, with sources."}],"sources":[],"legal":false,"updatedAt":"2026-10-25"}