I'm currently reading the Amazon Dynamo paper. As an aid to internalising and retaining the concepts, I will attempt to implement them in a piecemeal fashion. The first of these will be a very simple key-value store that I've named Thamani, the Swahili word for "value". It implements a simple API over TCP, consisting of two methods
put(key: byte array, value: byte array) -> timestamp: 64 bit unix timestamp
get(key: byte array) -> value: byte array, timestamp: 64 bit unix timestamp
- The keys and values are simply byte arrays. Thamani does not impose any sort of structure beyond that. Semantics are entirely determined by the client.
- Requests are not authenticated.
- Data is stored on disk.
- The server can handle multiple clients at a time. I haven't yet determined a concurrency model.
- While I haven't fully settled on an implementation language, I'll likely use Kotlin.
- Both
put
andget
operations should be constant-time. - Multiple calls to
put
will overwrite previous versions. Last write wins.
Using this socket server implementation. https://gist.github.com/Silverbaq/a14fe6b3ec57703e8cc1a63b59605876