Skip to content

Quiz: Database Replication

← Back to quiz index

4 questions

L1 (2 questions)

1. What is the difference between synchronous and asynchronous replication?

Show answer Synchronous: write is acknowledged only after replica confirms — zero data loss but higher latency. Asynchronous: write is acknowledged immediately, replica catches up later — lower latency but risk of data loss on primary failure.

2. What is the operational difference between a read replica and the primary?

Show answer Primary handles all writes and reads. Read replica receives replicated data and serves only read queries — reduces primary load. Replicas have lag (seconds to minutes). Don't read from a replica when you need write-after-read consistency.

L2 (2 questions)

1. A database replica shows increasing replication lag. What do you investigate?

Show answer 1. Replica hardware (CPU, IO, network) may be undersized.
2. Long-running write queries on primary generating huge WAL/binlog.
3. Replica applying single-threaded (enable parallel replication).
4. Network bandwidth between primary and replica.
5. Heavy read queries on replica competing for IO.

2. When should you NOT use a read replica for a query?

Show answer When the query needs up-to-the-second consistency (e.g., reading data just written). Also: when the query is heavy enough to impact replica replication (lag increases). And: for any write operations — replicas are read-only.