Company
Date Published
Author
Shlomi Noach
Word count
2394
Language
English
Hacker News points
None

Summary

In semi-synchronous replication, a primary waits for acknowledgement from at least one replica before committing a write to the user. This mechanism guarantees durability by ensuring that changes are persisted on multiple servers, but can reduce availability if the replicas are not available or are lagging behind in applying changes. The primary can fall back to asynchronous replication mode if it falls below a certain timeout threshold. Semi-sync is particularly useful for guaranteeing durability and consistency, especially in high-availability solutions where data loss would be catastrophic. However, it also introduces the risk of split brains, which occur when two servers write to the same table simultaneously, leading to divergent data. The geo-distribution of servers plays a crucial role in how tolerant the system is for failure and what outcomes can be expected. In colocated setups, promoting a new primary within the same datacenter minimizes downtime, while cross-site semi-sync replication increases latency but provides more flexibility. Ultimately, the choice depends on operational considerations, such as time, capacity, and load.