SSDB supports four main data types, which are key-value, hashmap, sorted set and list. The key-value data type is used to store data with no strong relations. The hashmap is used to store data in different sets with counting and sorting based on the key value. Sorted set sorts all entries based on a score integer, and unlike key-value and hashmap, it cannot be used to store large data. List stores data in the queue structure.
Skip List Log-Structured Merge Tree
SSDB uses LevelDB as its storage engine. SSDB explicitly calls LevelDB's interfaces to insert, update, and delete data. In LevelDB, a Log-Structured Merge Tree is used for indexes. Log-Structured Merge Tree provides a higher write throughput than the B+ tree. For each write operation, it first writes to a data structure called memtable, which will be flushed to disk later. In a memtable, LevelDB uses Skip List to find a position.
SSDB does not support concurrency control, because operations are executed individually and there is no transaction. However, unlike Redis, SSDB supports multi-threads to avoid write operations blocking read operations (since 1.5.2). All write operations are executed in a single thread while read operations are executed in other threads.
SSDB supports data compression using Snappy. Snappy is an open-source data compression library developed by Google. It is used in both Google's internal tools and several famous open-source databases, including Cassandra, MongoDB, and LevelDB. SSDB naturally supports Snappy as it uses LevelDB for low-level storage. In LevelDB, developers should explicitly set parameters to use Snappy in the compile time. Since version 1.6.2, SSDB changes this feature by directly integrating the source code of Snappy to the project. By default, SSDB will use Snappy, but users can explicitly choose to use a non-compression version. SSDB with Snappy compression is compatible with non-compression data.
N-ary Storage Model (Row/Record)
SSDB uses the storage model in LevelDB, where data is saved in sorted key-value pairs.
SSDB is a single-node database management system. Initially, the server does not share anything with other nodes. However, as SSDB supports Redis API, developers can directly use Twemproxy to manage a number of SSDB servers. Besides, it is also workable to use the combination of Redis and SSDB.
Custom API Command-line / Shell
Firstly, SSDB supports a set of shell commands to execute queries. Secondly, SSDB provides custom APIs for a wide range of programming languages, including C#, C++, Erlang, Go, Java, Lua, PHP, Python, Ruby, Swift. Besides, developers can use the Redis client to connect the server with REdis Serialization Protocol. The command set of SSDB is similar to that in Redis.
https://github.com/ideawu/ssdb
Zuyang Wu
2013
C#, C++, Erlang, Go, Java, Lua, PHP, Python, Ruby, Swift
BSD, iOS, Linux, OS X, Windows