What is database replication and why use it?
basics of copying data across nodes.
replication keeps copies of data on multiple servers; primary benefits are high availability through failover and improved read scalability by spreading reads.
WHAT THIS TESTS This confirms you understand a foundational distributed-data technique and can articulate why teams replicate, distinct from partitioning.
A GOOD ANSWER COVERS Database replication means keeping copies of the same data on more than one database server and keeping those copies in sync as changes occur. The two primary benefits are, first, high availability and fault tolerance: if the primary node fails, a replica holds the data and can be promoted to take over, so the system survives hardware or network failures with minimal downtime. Second, read scalability and reduced latency: read-heavy workloads can be served from multiple replicas, spreading load off the primary, and replicas placed in different regions let users read from a nearby copy, cutting latency. A complete answer notes the synchronous versus asynchronous trade-off, where synchronous replication guarantees replicas are current but adds write latency, while asynchronous is faster but risks replicas lagging and serving slightly stale reads.
COMMON WRONG ANSWERS Confusing replication with sharding; replication copies the entire dataset to multiple nodes, while sharding splits one dataset across nodes. Claiming replication increases write throughput; it primarily helps reads and availability, and synchronous replication can slow writes. Forgetting that asynchronous replicas can return stale data, which matters for consistency. Saying replication alone solves scaling, ignoring that writes still funnel through a primary in single-leader setups.
LIKELY FOLLOW-UPS What is the difference between single-leader, multi-leader, and leaderless replication? How does asynchronous replication cause replication lag and stale reads? How is failover handled and what is split-brain? How does replication relate to backups?
ONE CONCRETE EXAMPLE A web app routes all writes to a primary PostgreSQL node that streams changes to two read replicas. Reporting and most read queries hit the replicas, sparing the primary. If the primary fails, a replica is promoted to primary, so the application keeps serving with only a brief interruption.
Read the original → en.wikipedia.org
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.