https://github.com/xiaost/blobcached
Blobcached is a memcached protocol-compatible cache server for blob on SSD.
https://github.com/xiaost/blobcached
cache memcached
Last synced: about 1 year ago
JSON representation
Blobcached is a memcached protocol-compatible cache server for blob on SSD.
- Host: GitHub
- URL: https://github.com/xiaost/blobcached
- Owner: xiaost
- License: mit
- Created: 2017-03-29T08:18:21.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-11-29T16:14:12.000Z (over 7 years ago)
- Last Synced: 2025-03-25T07:41:38.306Z (over 1 year ago)
- Topics: cache, memcached
- Language: Go
- Size: 30.3 KB
- Stars: 12
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Blobcached
=====
Blobcached is a memcached protocol-compatible cache server for blob on SSD.
### Supported commands
| Command | Format |
| ------ | ------ |
| get | get []+\r\n |
| set | set [noreply]\r\n\r\n |
| delete | delete [noreply]\r\n |
| touch | touch [noreply]\r\n |
| stats | stats\r\n |
### How it works
#### concepts
| Name | |
| ------ | ------ |
| indexfile | an indexfile contains many of `items` powered by [blotdb](https://github.com/boltdb/bolt) |
| 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 `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