A simple key-value service, with variations demonstrating different failure recovery strategies.
Client command line interface:
| Command | Description |
| get(id) | returns value for id |
| set(id,val) | sets value for id |
| testset(id,testVal,newVal) | if id has testVal as its value, set to newVal |
| exit | shuts down client |
A simple client/server system in which clients can send requests to read/write key-values.
A simple key-value service with data replication across a chain of N back-end servers.
- Client interacts with the front-end server exactly as in Variation 1
- A chain of N back-end servers store identical copies of all key-values
- Key-value write operations are performed on each back-end server, passed from one to the next until all are updated
- Key-value read operations are performed on the first back-end server in the chain
- Back-end nodes may join or leave the network at any time
Failure recovery strategy:
- Each server is aware of the next two nodes in the chain
- If one back-end server fails, its predecessor links to the next known node to reconnect the chain
Design properties:
- Robust to one back-end failing at a time, up to a maximum of N-1 back-end failures
- Not robust to the front-end server failing
- If two adjacent back-end nodes fail simultaneously, then subsequent back-end nodes will be stranded. However, if at least one of the first two back-end nodes survives the failure, we can continue operating without a break in service.
This project was developed for educational purposes, and comes without warrantee or support. However, feel free to copy and modify its code and ideas as you wish.
