All Projects → recoilme → b52

recoilme / b52

Licence: other
b52 is a fast experimental Key/value database. With support for the memcache protocol.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to b52

Ansible Role Redis
Ansible Role - Redis
Stars: ✭ 176 (+780%)
Mutual labels:  memcached, key-value
Gokv
Simple key-value store abstraction and implementations for Go (Redis, Consul, etcd, bbolt, BadgerDB, LevelDB, Memcached, DynamoDB, S3, PostgreSQL, MongoDB, CockroachDB and many more)
Stars: ✭ 314 (+1470%)
Mutual labels:  memcached, key-value
okdbc
A fast, light-weight key/value store with http & memcache(TCP/UDP) interface.
Stars: ✭ 28 (+40%)
Mutual labels:  key-value, memcache-protocol
Cucache
Fast PUT/GET/DELETE in-memory key-value store for lookaside caching
Stars: ✭ 63 (+215%)
Mutual labels:  memcached, key-value
quitsies
A persisted drop-in replacement for Memcached, respecting the rules of quitsies.
Stars: ✭ 16 (-20%)
Mutual labels:  memcached, key-value
shell-scripts
my-scripts
Stars: ✭ 87 (+335%)
Mutual labels:  memcached
memcached
Memcached Operator for Kubernetes
Stars: ✭ 18 (-10%)
Mutual labels:  memcached
bftkv
A distributed key-value storage that's tolerant to Byzantine fault.
Stars: ✭ 27 (+35%)
Mutual labels:  key-value
fastapi-cache
fastapi-cache is a tool to cache fastapi response and function result, with backends support redis and memcached.
Stars: ✭ 375 (+1775%)
Mutual labels:  memcached
tempdb
Key-value store for temporary items 📝
Stars: ✭ 16 (-20%)
Mutual labels:  key-value
ddos
Simple dos attack utility
Stars: ✭ 36 (+80%)
Mutual labels:  memcached
fast-jepsen
Using "Testing Shared Memories" paper to make Jepsen check linearizability in linear time
Stars: ✭ 21 (+5%)
Mutual labels:  key-value
php-mvc
PHP MVC ⦿ Dockerized • Composer • RESTful API • Memcached • cron • WebSocket
Stars: ✭ 17 (-15%)
Mutual labels:  memcached
Search Ads Web Service
Online search advertisement platform & Realtime Campaign Monitoring [Maybe Deprecated]
Stars: ✭ 30 (+50%)
Mutual labels:  memcached
bitrix-memcached
Bitrix Cache with php-memcached / Кэш Битрикс на Memcached
Stars: ✭ 13 (-35%)
Mutual labels:  memcached
AUTOBOT FIFAX
FIFA SNIPING BOT
Stars: ✭ 31 (+55%)
Mutual labels:  sniper
iris
Distributed streaming key-value storage
Stars: ✭ 55 (+175%)
Mutual labels:  key-value
BuildPhp
php and web env manager for mac,include apache nginx php mysql memcached redis node with mutable version, and SSL make, file info... extend tools
Stars: ✭ 111 (+455%)
Mutual labels:  memcached
elara
Elara DB is an easy to use, lightweight key-value database that can also be used as a fast in-memory cache. Manipulate data structures in-memory, encrypt database files and export data. 🎯
Stars: ✭ 93 (+365%)
Mutual labels:  key-value
bmemcached-rs
Rust binary memcached implementation
Stars: ✭ 24 (+20%)
Mutual labels:  memcached

b-52
b52

GoDoc

b52 is a fast experimental Key/value database. With support for the memcache protocol.

Getting Started

Installing

To start using b52, install Go and run go get:

$ go get -u github.com/recoilme/b52
$ go build or go install

This will retrieve and build the server. Or grab compiled binary version.

Starting

Use ./b52 --help for full list of params. Example:

./b52 -p 11212 -params "sizelru=10&sizettl=10&dbdir="
# Start server on port 11212 with 10Mb lru and ttl cache size, without persistent database.

or just ./b52 - for start with default params

How it work

b52 is a layered database composed of a sniper, evio and freecache. When b52 prepared properly, the ingredients separate into three distinctly visible layers.

It use evio for network communications.

sniper - fast, persistant on disk storage

freecache - in memory, with zero GC overhead cache, for keys with TTL (time to live) and LRU cache

The balance between speed and efficiency is achieved as follows:

New entries go to disk (sniper). As you access them, they are cached in the LRU-cache (freecache). Life-limited records are stored separately, in freecache (without persistance storage).

Memory usage

For minimizing GC and allocations overhead - Sniper stored keys, and value addres/size in plain hash (map[uint32]uint32). HashMaps are fast, but has a memory cost. You must have 2Gb+ memory for storing every 100_000_000 entrys.

In Freecache memory is preallocated and it's size depends from you.

Disk usage

Sniper has a minimum 8 byte overhead on every entry. But it allocate space in power of 2, and try to reuse space, if value grow. Also, sniper will try to reuse space from deleted/evicted records.

Telnet example

telnet localhost 11211
set a 0 0 5
12345
STORED
get a
VALUE a 0 5
12345
END
close

Memcache protocol

b52 use text version of memcache protocol. With this commands:

	cmdAdd       = []byte("add")
	cmdReplace   = []byte("replace")
	cmdSet       = []byte("set")
	cmdGet       = []byte("get")
	cmdGets      = []byte("gets")
	cmdClose     = []byte("close")
	cmdDelete    = []byte("delete")
	cmdIncr      = []byte("incr")
	cmdDecr      = []byte("decr")
	cmdStats     = []byte("stats")
	cmdQuit      = []byte("quit")
	cmdVersion   = []byte("version")

mc-benchmark

mc-benchmark

Database params (running as master/slave, 1Gb lru cache, 100 Mb ttl cache, stats after 3 days using):
stats
STAT version 0.1.3
bytes 2301825272
heap_sys_mb 2103
curr_items 17165174
cmd_get 6660544669
cmd_set 6494641380
file_size 14172392544

test (on production, with ~2k active connections at same time):
./mc-benchmark -p 11222

====== SET ======
  10000 requests completed in 0.10 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

56.39% <= 0 milliseconds
95.39% <= 1 milliseconds
100.00% <= 2 milliseconds
101010.10 requests per second

====== GET ======
  10014 requests completed in 0.08 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

60.25% <= 0 milliseconds
100.00% <= 1 milliseconds
123629.63 requests per second

./mc-benchmark -n 100000 -p 11212
====== SET ======
  100003 requests completed in 1.03 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

49.59% <= 0 milliseconds
99.16% <= 1 milliseconds
100.00% <= 2 milliseconds
96996.12 requests per second

====== GET ======
  100018 requests completed in 0.98 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

51.55% <= 0 milliseconds
99.72% <= 1 milliseconds
99.99% <= 2 milliseconds
100.00% <= 3 milliseconds
101851.33 requests per second

expvar

Contact

Vadim Kulibaba @recoilme

License

b52 source code is available under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].