DistriCache ๐ is a proof-of-concept distributed in-memory key/value cache implemented implemented using go. It provides several methods for storing, retrieving and deleting values. DistriCache uses a custom byte based communication protocol over TCP.
- ๐ฆ Key/Value data storage
- ๐๏ธ SET, GET and DEL operations
- โฐ Optional TTL for Keys.
- ๐ฅ๏ธ Leader - Follower model
- ๐ค Core functions tested
Start the server with the following command
make server
Run a test client
make client
Running test
make test
Running test + benchmark
make bench
The methods that are available over TCP
Command for inserting values into the cache
SET key value [ttl]
TTL - how long a key/value pair is valid before it's deleted. The TTL is specified in milliseconds. Default value is 0 -> no expiration
OK, the request was successful
Command for retrieving values from the cache
GET key
value, the request was successful (nil), no key found
Command for deleting values in the cache
DEL key
OK, the request was successful.