Package craq-python implements CRAQ (Chain Replication with Apportioned Queries)
as described in the CRAQ paper. MIT Licensed.
CRAQ is a replication protocol that allows reads from any replica while still maintaining strong consistency. CRAQ should provide better read throughput than Raft and Paxos. Read performance grows linearly with the number of nodes added to the system. Network chatter is significantly lower compared to Raft and Paxos.
Chain Replication: How to Build an Effective KV Storage
MIT 6.824 Distributed Systems Lecture on CRAQ (80mins)
+------------------+
| |
+-----+ Coordinator |
| | |
Write | +------------------+
|
v
+---+----+ +--------+ +--------+
| +---->+ +---->+ |
| Node | | Node | | Node |
| +<----+ +<----+ |
+---+-+--+ +---+-+--+ +---+-+--+
^ | ^ | ^ |
Read | | Read | | Read | |
| | | | | |
+ v + v + v
There are 3 packages that should be started to run the system. The node and coordinator
implementation in processes uses the Flask for communication and dbm for storage. The client for interacting with the CRAQ system is implemented using cmd.
Facilitates new writes to the chain; allows nodes to announce themselves to the
chain; manages the order of the nodes of the chain. One Coordinator should be
run for each chain. For better resiliency, you could run a cluster of
Coordinators and use something like Raft or Paxos for leader election, but
that's outside the scope of this project. Run using python coordinator.py.
--port # Port to run the coordinator process on. Default: 5200Represents a single node in the chain. Responsible for storing writes, serving
reads, and forwarding messages along the chain. In practice, you would probably
have a single Node process running on a machine. Each Node should have it's own
storage unit. Run using python node.py.
--port # Port to run the node process on. Default: 5201
--coordinator # Port of the coordinator process. Default: 5200Basic CLI tool for interacting with the chain. Allows writes and reads. The one
included in this project uses the cmd package. Run using python client.py.
--coordinator # Port of the coordinator process. Default: 5200
--read # Port of the node process to read from. Default: 5201