Blobcached
Blobcached is a memcached protocol-compatible cache server for blob on SSD.
Install / Use
/learn @xiaost/BlobcachedREADME
Blobcached
Blobcached is a memcached protocol-compatible cache server for blob on SSD.
Supported commands
| Command | Format | | ------ | ------ | | get | get <key> [<key>]+\r\n | | set | set <key> <flags> <expiry> <datalen> [noreply]\r\n<data>\r\n | | delete | delete <key> [noreply]\r\n | | touch | touch <key> <expiry>[noreply]\r\n | | stats | stats\r\n |
How it works
concepts
| Name | |
| ------ | ------ |
| indexfile | an indexfile contains many of items powered by blotdb |
| datafile | a regular file for storing values |
| item | an item is made up of key, offset, term, size anchoring the value in datafile |
| term | everytime the datafile is full, the term of datafile is increased |
Command: Set
- get the
offsetandtermofdatafile - write value to the
datafile - write
itemwith theoffset,termandkeyto theindexfile
Command: Get
- get the
itembykey - check
termandoffsetof theitemagainstdatafile - read value from the
datafile
Command: Touch
- implemented by
get&set
GC
- Blobcached scans and removes expired or invalid
itemsin theindexfile - by default, the rate up to 32k items/second
