barge icon indicating copy to clipboard operation
barge copied to clipboard

Simple key-value store

Open abailly opened this issue 11 years ago • 3 comments

The purpose of barge-store is to make it easy to test barge with jepsen. By exposing a simple put/get interface we can implement a simple client that will be used by jepsen to check linearizability of barge.

Main program is now barge-store.jar (replacing barge-http.jar) which launches server in the background. Server can be stopped by POSTing empty string to URI /control/shutdown. Store is available under namespace /store and is dead simple:

  • Use PUT /store/my/key with arbitrary byte input to store data. This must be sent to current leader and waits for Raft protocol synchronisation before returning to client,
  • Use GET /store/my/key to retrieve stored data or a 404 error. Data is read from current state machine so reading from non-Leader might provide stale data.

abailly avatar Jul 14 '14 17:07 abailly

Looks good. Since this is a new module I'm not going to nit-pick. Feel free to merge when you're ready or point out places you'd like me to take a harder look at.

mgodave avatar Jul 14 '14 20:07 mgodave

Well, on the contrary, given this is a new module, better nitpick when there are few lines of code! If there are things that looked suspicious or with which you are not at ease with, I would greatly appreciate your comments. Bear in mind however the overall idea is not to provide a full-fledged DB but merely a simple tool to exercise barge. But simple does not mean simplistic of course.

abailly avatar Jul 14 '14 20:07 abailly

OK, fair enough. I'll give it a more thorough look.

mgodave avatar Jul 14 '14 20:07 mgodave