Skip to content
/ ssdb Public
forked from ideawu/ssdb

SSDB - A fast database server with zset data type, an alternative to Redis

Notifications You must be signed in to change notification settings

keengo/ssdb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSDB - A LevelDB server with zset data type

SSDB is a high performace key-value(key-string, key-zset, key-hashmap) NoSQL persistent storage server, using Google LevelDB as storage engine.

SSDB's goal is to replace or co-work with Redis.

Features

  • LevelDB client-server support, written in C/C++
  • Persistent key-value, key-zset, key-map('hashmap') storage
  • Client API supports including C/C++, PHP, Python, Cpy, Java
  • Online backup, fast recover
  • Replication(master-slave), load balance [see wiki Replication]
  • Future Features
    • Distributed

PHP client API example

<?php
require_once('SSDB.php');
$ssdb = new SimpleSSDB('127.0.0.1', 8888);
$resp = $ssdb->set('key', '123');
$resp = $ssdb->get('key');
echo $resp; // output: 123

More...

Compile and Install

$ wget --no-check-certificate https://github.com/ideawu/ssdb/archive/master.zip
$ unzip master
$ cd ssdb-master
$ make

# start master
$ ./ssdb-server ssdb.conf

# or start as daemon
$ ./ssdb-server -d ssdb.conf

# start slave
$ ./ssdb-server ssdb_slave.conf

# ssdb command line
$ ./tools/ssdb-cli -p 8888

# stop ssdb-server
$ kill `cat ./var/ssdb.pid`

See Compile and Install wiki

Architecture

ssdb architecture

Performance

Typical performance

Total 1000 requests.

writeseq  :    0.546 ms/op      178.7 MB/s
writerand :    0.519 ms/op      188.1 MB/s
readseq   :    0.304 ms/op      321.6 MB/s
readrand  :    0.310 ms/op      315.0 MB/s

SSDB vs Redis

Benchmark vs Redis

View full SSDB vs Redis benchmark charts...

Concurrency benchmark

======= set =======
qps: 31852, time: 0.031 s

======= get =======
qps: 29103, time: 0.034 s

======= del =======
qps: 33042, time: 0.030 s

======= scan =======
qps: 25871, time: 0.039 s

======= rscan =======
qps: 31181, time: 0.032 s

======= zset =======
qps: 24352, time: 0.041 s

======= zget =======
qps: 27836, time: 0.036 s

======= zscan =======
qps: 10442, time: 0.096 s

======= zrscan =======
qps: 28224, time: 0.035 s

======= zdel =======
qps: 27137, time: 0.037 s

======= hset =======
qps: 31507, time: 0.032 s

======= hget =======
qps: 28388, time: 0.035 s

======= hscan =======
qps: 25319, time: 0.039 s

======= hrscan =======
qps: 30399, time: 0.033 s

======= hdel =======
qps: 29741, time: 0.034 s

See Benchmark

Who's using SSDB?

See Users wiki

Links

Changes made to LevelDB

See Changes-Made-to-LevelDB wiki

About

SSDB - A fast database server with zset data type, an alternative to Redis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published