Senior
How to organize geodistribution with three regions while maintaining strict consistency for money operations? What type of replication to use (master-master or master-slave)?
sobes.tech AI
Answer from AI
To organize a geo-distributed system with three regions and strict consistency for monetary operations, it is important to ensure atomicity and data consistency.
It is recommended to use master-master replication with a distributed consensus protocol, such as Raft or Paxos. This allows all regions to accept writes and synchronize changes while maintaining strict consistency.
Features:
- Use of a distributed transactional protocol to coordinate changes between regions.
- Conflict resolution at the application or database level.
- Minimizing latency through network optimization and local caches.
Master-slave replication is not suitable in this case, as it involves a single write point (master), which complicates multi-region operations and reduces fault tolerance.
Example architecture:
Region A <--> Region B <--> Region C
\_____________________________/
Each region is a master, replicating data to others via a consensus protocol.
Thus, master-master with distributed consensus is the optimal choice for strict consistency in a geo-distributed system with monetary operations.