Categorygithub.com/xiaost/blobcached
repositorypackage
0.1.0
Repository: https://github.com/xiaost/blobcached.git
Documentation: pkg.go.dev

# Packages

Package cache is a generated protocol buffer package.
No description provided by the author
No description provided by the author
No description provided by the author

# README

Blobcached

Blobcached is a memcached protocol-compatible cache server for blob on SSD.

Supported commands

CommandFormat
getget []+\r\n
setset [noreply]\r\n\r\n
deletedelete [noreply]\r\n
touchtouch [noreply]\r\n
statsstats\r\n

How it works

concepts

Name
indexfilean indexfile contains many of items powered by blotdb
datafilea regular file powered by mmap for storing values
iteman item is made up of key, offset, term, size anchoring the value in datafile
termeverytime the datafile is full, the term of datafile is increased

Command: Set

  • get the offset and term of datafile
  • write value to the datafile
  • write item with the offset, term and key to the indexfile

Command: Get

  • get the item by key
  • check term and offset of the item against datafile
  • read value from the datafile

Command: Touch

  • implemented by get & set

GC

  • Blobcached scans and removes expired or invalid items in the indexfile
  • by default, the rate up to 32k items/second