CRAQ

Chain Replication (CR)

What’s Chain Replication?

  • 系统构成:A list of servers, with a “head” and a “tail”;
  • 写:Client sends to Head, forward “write” till Tail, Tail responses to Client;
  • 读:Client sends to Tail, Tail response.

相对于 Raft,CR 的优点?

  • 相对于 Leader 处理所有请求,将请求分散到 HeadTail 能够提升服务吞吐量;
  • Raft 进行写时需要发送请求到所有 Replicas,然后等待 1/2 的响应,CR 则只需要将请求传递到后继节点,提升了写性能的吞吐量;
  • CR 的写操作只需要一个服务器的介入;
  • 错误恢复的流程更加简单(相当于在链表中删除一个节点);

Chain Replication with Apportioned Queries (CRAQ)

类似于在 ZooKeeper 设计中的思考,可以将 Read 的压力分散到各个不同的 Replicas 中。CRAQ 是一个基于 CR、并且将 Read 分散到各个节点、且满足 Linearizable 性质的分布式系统设计。

How does CRAQ support linearizable reads from any replica in the chain?

  • 系统构成:Each replica stores a list of versions per object;
  • 写:Each Replicas create new dirty version as write pass through, Tail creates clean version, and ACK it back along to Head;
  • 读:Client sends to any node:
    • If latest version is clean, reply with that;
    • If latest version is dirty, ask tail for latest version number.

CRAQ limitation?

  • If a node isn’t reachable, CRAQ must wait, so not immediately fault-tolerant in the way that ZK and Raft are.

  • Split brain problem makes us can’t take over the Head immediately.