HW 6
  • Introduction
  • Key-Value Store
    • Getting Started
    • Your Tasks
      • Part A
      • Part B
    • References
      • Two Phase Commit
      • Important Existing Code
      • Testing
    • Submitting
Powered by GitBook
On this page
  • Getting Familiar
  • TODO
  1. Key-Value Store

Your Tasks

PreviousGetting StartedNextPart A

Last updated 5 years ago

In this homework, you will build a distributed key-value store with two operations: GET and PUT. Data will be replicated across multiple follower servers to ensure data integrity, and a single leader server will coordinate actions across these follower servers. All nodes in this key-value store will utilize the Two-Phase Commit protocol.

Multiple clients (users) will communicate with a single leader server according to the given Key-Value gRPC API. The leader will forward all GET requests to a random follower. For PUT requests, the leader should follow the Two Phase Commit (2PC) protocol to ensure that: (1) operations are performed atomically across multiple follower servers (2) backup data is consistent across multiple follower servers

The leaders and the followers communicate over a bi-directional gRPC stream. The leader sends a Leader message, which the follower will process and respond with a Response message.

The staff solution for parts A and B combined make the following changes:

 journal/journal.go      |    3 ++
 journal/journal_test.go |   32 +++++++++++++++++++++++++++
 tpc/tpcfollower.go      |   55 +++++++++++++++++++++++++++++++++++++++++++++++-
 tpc/tpcleader.go        |   55 +++++++++++++++++++++++++++++++++++++++++++++---
 4 files changed, 141 insertions(+), 4 deletions(-)

Getting Familiar

You may find it helpful to read through some of the pre existing code before you start implementing. Using as a guide, we suggest that you read through:

  • KVStore and Journal

  • TPC Leader and TPC Follower

  • MessageManager

  • tpc.proto (pkg/tpc/rpc) and kv.proto (api)

TODO

Here is a list of things to do for this homework in the recommended order of completion at a high level - detailed specifications of and follow in the next pages.

Part A

Part B

Read through , , and to get a good sense of the TPC components.

Important Existing Code
Part A
Part B
Testing
Two Phase Commit
Important Existing Code