Logo

First Study: CAP Theorem && Consistency & Availability

Strong Consistency

Idea is to make sure all copies are synchronously updated, and after ACKs, return data
Pasted image 20241030140006.png

  1. Server executes a write in primary DB
  2. Primary Db update -> replica DB
  3. Replica DB ack -> Primary DB
  4. Then Primary DB data -> Server

Eventual Consistency

Aynsc Update (May or may not pass - No ACKs Wait)
Pasted image 20241030140235.png

  1. Server writes -> primary DB
  2. Primary DB updates -> replica DB
  3. Primary no wait for ACK, send data -> server

3. Weak consistency

Pasted image 20241030140615.png

Used for:

  • High availability, low consistency (read >> write)
  • low latency
  1. Server write -> Cache
  2. Cache pass write -> MQ & then send ACK -> server
  3. Db consumes write operation -> perform write

© 2025 All rights reservedBuilt with DataHub Cloud

Built with LogoDataHub Cloud