@siddontang siddontang released this Aug 5, 2014 · 580 commits to master since this release

Assets 2

LedisDB is a high performance NoSQL like Redis, may be an alternative for Redis.

LedisDB supports some awesome features, below:

  • Rich advanced data structure: KV, List, Hash, ZSet, Bitmap.
  • Stores lots of data, over the memory limit.
  • Various backend database to use: LevelDB, goleveldb, LMDB, RocksDB, BoltDB.
  • Supports expiration and ttl.
  • Redis clients, like redis-cli, are supported directly.
  • Multi client API supports, including Go, Python, Lua(Openresty), Node.js.
  • Easy to embed in Go application.
  • Restful API support, json/bson/msgpack output.
  • Replication to guarantee data safe.
  • Supplies tools to load, dump, repair database.
  • Linux, Mac OSX, Windows support.

Server Example

ledis-server -config=/etc/ledis.json

//another shell
ledis-cli -p 6380

ledis 127.0.0.1:6380> set a 1
OK
ledis 127.0.0.1:6380> get a
"1"

//use curl
curl http://127.0.0.1:11181/SET/hello/world
→ {"SET":[true,"OK"]}

curl http://127.0.0.1:11181/0/GET/hello?type=json
→ {"GET":"world"}

Package Example

import "github.com/siddontang/ledisdb/ledis"
l, _ := ledis.Open(cfg)
db, _ := l.Select(0)

db.Set(key, value)

db.Get(key)

Benchmark

See benchmark for more.

Todo

See Issues todo

Notice

LedisDB now change the database saved path, it will save data to data_dir/leveldb for LevelDB, data_dir/lmdb for LMDB, and same for others.

So if you used LevelDB before, you must move old data_dir/data to data_dir/leveldb by hand.