Sobes.tech
Senior

What types of replication are there (synchronous and asynchronous)? How does synchronous replication work and what are its drawbacks?

sobes.tech AI

Answer from AI

There are two main types of data replication: synchronous and asynchronous.

Synchronous replication means that a data write is considered complete only after the data has been successfully written to the primary and all replicated nodes. That is, the client receives confirmation only after the data is committed on all replicas.

How it works:

  1. The client sends a write request.
  2. The primary node writes the data and sends it to the replicas.
  3. The replicas confirm receipt and writing of the data.
  4. After receiving confirmations from all replicas, the primary node confirms to the client that the write was successful.

Drawbacks of synchronous replication:

  • Increased write latency, as confirmation from all replicas must be awaited.
  • Potential reduction in throughput due to waiting for replicas.
  • Possible availability issues if one of the replicas is unavailable — the write may be blocked.

Ultimately, synchronous replication provides high data consistency (strong consistency), but at the cost of performance and fault tolerance.

What types of replication are there (synchronous and… - sobes.tech