Course contentsShow
← System Design
Lesson 1357 of 1,91934. Data Replication StrategiesFree lesson

Semi-Synchronous Replication

A hybrid approach where at least one replica acknowledges writes synchronously before others receive them async.

Semi-Synchronous Replication

What You'll Learn

You'll learn how semi-synchronous replication balances the consistency guarantees of synchronous replication with the speed benefits of asynchronous replication.

The Core Idea

Semi-synchronous replication is a hybrid approach that requires at least one replica to acknowledge a write synchronously before the client receives confirmation, while allowing additional replicas to receive updates asynchronously afterward.

Think of it like sending an important email: you wait for confirmation that at least one backup recipient got it (synchronous), but you don't wait for everyone on the CC list to acknowledge receipt (asynchronous). You've achieved some redundancy without maximum delay.

How It Works

When a write operation occurs:

  1. The primary node sends the data to all replicas
  2. It waits for acknowledgment from at least one replica (the synchronous part)
  3. Once that single acknowledgment arrives, the write is confirmed to the client
  4. Other replicas receive the update asynchronously in the background

This approach provides a middle ground between the strong durability of synchronous replication (where you wait for all replicas) and the speed of asynchronous replication (where you wait for none).

The Tradeoffs

Benefits:

  • Faster than fully synchronous (you only wait for one replica)
  • More durable than fully asynchronous (at least one copy is confirmed)
  • Reduces risk of total data loss if the primary fails

Costs:

  • Still slower than pure asynchronous replication
  • Not all replicas are guaranteed consistent at any moment
  • More complex to configure and monitor than either pure approach

Key Takeaway: Semi-synchronous replication provides a practical compromise—ensuring at least one confirmed replica copy while avoiding the performance penalty of waiting for all replicas, making it popular for systems that need reasonable durability without maximum latency.