Replication

Keeping several copies of data: the primary and its replicas, synchronous or asynchronous, replication lag, failover, and why a replica is not a backup.

  • 34 cards
  • 3 topics
  • Free

The outline, topic by topic

Each topic is weighted the way the exam weighs it.

  1. Concepts
  2. Scenarios
  3. Trade-offs and failures

A few cards from the deck

  • Replication: what is it?

    Show the answer

    Keeping copies of the same data on several servers.

    You gain availability and read capacity.

  • The database saturates on reads, writes stay low. What do you do?

    • Add read replicas
    • Shard
    • Switch to synchronous
    • Drop indexes
    Show the answer

    Add read replicas

    Each replica takes its share of the reads.

  • Primary (leader): what is it?

    Show the answer

    The server that accepts writes and passes them to the replicas.

    A single primary avoids two servers writing different versions.

  • With asynchronous replication, the primary fails suddenly. What risk?

    • Losing committed writes not yet copied
    • None
    • Losing all history
    • Blocking reads forever
    Show the answer

    Losing committed writes not yet copied

    What the replica had not received exists nowhere else.