memcached built on bash + socat
Shell
Latest commit 1bb2d34 Jan 3, 2017 @MakeNowJust Release v5.1.0
Permalink
Failed to load latest commit information.
LICENSE.md Update copyright Jan 3, 2017
README.md Release v5.1.0 Jan 3, 2017
bashcached Release v5.1.0 Jan 3, 2017

README.md

bashcached

memcached built on bash + socat

Feature

It is one file script (small, <100 lines!), and it requires only:

  • bash
  • socat

So, you can use it as soon as you download it.

It supports multiple connections and implements almost all memcached commands:

  • set, add, replace, append and prepend
  • get, delete and touch
  • incr and decr
  • gets and cas
  • flush_all
  • version and quit

And, it supports to serve over tcp and unix domain socket.

Install

You could install base64, bash and socat via brew if you use macOS:

$ brew install base64 bash socat

(In fact, bash is installed in the default, however it is too old to run bashcached.)

Or, you could install socat via apt if you use Ubuntu:

$ sudo apt install socat

then, download and chmod.

$ curl -LO https://raw.githubusercontent.com/MakeNowJust/bashcached/master/bashcached
$ chmod +x bashcached

Usage

$ ./bashcached --help
bashcached - memcached built on bash + socat
(C) TSUYUSATO "MakeNowJust" Kitsune 2016 <make.just.on@gmail.com>

USAGE: bashcached [--help] [--version] [--protocol=tcp|unix] [--port=PORT] [--check=CHECK]

OPTIONS:
  --protocol=tcp|unix      protocol name to bind and listen (default: tcp)
  --port=PORT              port (or filename) to bind and listen (default: 25252)
  --check=CHECK            interval to check each cache's expire (default: 60)
  --help                   show this help
  --version                show bashcached's version
$ ./bashcached &
$ telnet localhost 25252
version
VERSION 5.1.0-bashcached
set hello 0 0 11
hello world
STORED
get hello
VALUE hello 0 11
hello world
END
quit

License and Copyright

MIT and 🍣 © TSUYUSATO "MakeNowJust" Kitsune <make.just.on@gmail.com> 2016-2017