Logo

C - Consistency A - Availability

Single Node Architecture

Pasted image 20240915173055.png

Single node architecture models are inefficient as they cause a single point of failure, hence there is the use of distributed replicas (ref: Distributed Consensus DB)

Multiple Nodes System

Pasted image 20240915173830.png

Storing data in multiple nodes makes it more reliable, but data can be inconsistent.
Suppose, we want to lock operations until it becomes consistent, then it can be unavailable for that time.

Hence Consistency is inversely proportional to Availability

This is the Consistency Trade off

Then there's Master - Slave Distributed System, as seen in Distributed Consensus DB

2- Phase commit

Similar to the TCP-IP protocol

Pasted image 20240915174345.png

To ensure consistency on saves, we use a 2-way ACK,

  1. First a "prepare" req is send from master -> slave
  2. If failure at any point -> rollback the system
  3. Once prepare is done, ask to commit, after commit -> master updates itself as it knows it is consistent to save data now.

© 2025 All rights reservedBuilt with DataHub Cloud

Built with LogoDataHub Cloud