Active/passive replication, eventual consistency, and network partitioning

Active and Passive replication

Снимок экрана 2022-12-03 в 4.32.16 PM.png

Active Replication

⬅️ Example: Primary backup replication

This is active replication because the entire operation has been repeated on every replica where its effect is needed.

Use active replication when the updated state might be large.

Passive Replication

➡️ Example: Primary backup replication

This is passive replication because the operation is executed once on the primary node, and then the resulting state is sent to the backups.

Use passive replication when an operation might be expensive to do on each replica.

Снимок экрана 2022-12-03 в 4.37.38 PM.png

RAFT’s log replication is Active, because ****every server in RAFT is replicated state machine, commands are replicated in the same order in every machine.

Eventual consistency

<aside> 🤔 Eventual consistency is a consistency model used in distributed computing to achieve high availability that informally guarantees that, if no new updates are made to a given data item, eventually all accesses to that item (at all replicas) will return the last updated value.

</aside>

Eventual consistency

Eventual consistency

Eventual consistency is used in Amazon’s Dynamo

Network Partitioning

Network partitioning happens due to many reasons: Link is down, Router is down, Network is slow etc.

Снимок экрана 2022-12-04 в 1.10.47 PM.png

P.S: есть еще такие каракули от Шынназара с онлайн-лекции

2022-12-04 1.22.48 PM.jpg

2022-12-04 1.23.02 PM.jpg

In the presence of a network partition:

Снимок экрана 2022-12-04 в 1.50.29 PM.png

The CAP theorem explains this dilemma.