Skip to content

DistriCache ๐ŸŒ is a proof-of-concept distributed in-memory key/value cache implemented implemented using go.

License

Notifications You must be signed in to change notification settings

0xLaurens/districache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

26 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

DistriCache

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.

Features

  • ๐Ÿ“ฆ Key/Value data storage
  • ๐ŸŽš๏ธ SET, GET and DEL operations
  • โฐ Optional TTL for Keys.
  • ๐Ÿ–ฅ๏ธ Leader - Follower model
  • ๐Ÿค– Core functions tested

Running

Start the server with the following command

make server

Run a test client

make client

Running test

make test

Running test + benchmark

make bench

Methods

The methods that are available over TCP

SET

Command for inserting values into the cache

SET key value [ttl]

Options

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

Response

OK, the request was successful

GET

Command for retrieving values from the cache

GET key

Response

value, the request was successful (nil), no key found

DEL

Command for deleting values in the cache

DEL key

Response

OK, the request was successful.

About

DistriCache ๐ŸŒ is a proof-of-concept distributed in-memory key/value cache implemented implemented using go.

Topics

Resources

License

Stars

Watchers

Forks