SSDB’s network protocol is very simple, you can connect to a SSDB server with telnet and interact with commands:
$ telnet 127.0.0.1 8888 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. 3 set 1 a 2 hi 2 ok 3 get 1 a 2 ok 2 hi
SSDB’s network protocol is very simple, you can connect to a SSDB server with telnet and interact with commands:
$ telnet 127.0.0.1 8888 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. 3 set 1 a 2 hi 2 ok 3 get 1 a 2 ok 2 hi
SSDB Java client is released since version 1.2.5, here’s a simple example:
SSDB ssdb = new SSDB("127.0.0.1", 8888); ssdb.set("a", "123"); byte[] val = ssdb.get("a");
The SSDB Java client API doc: http://www.ideawu.com/ssdb/java-doc/
zset is a very usefull data structure, to store real world data collection, such as User List, News List, Feeds, etc. zset can be considered as a two-column table in relational database. One column is ‘key’ of UNIQUE, the other is ‘score’ of float type.
zset has one limitation, the ‘key’ column could not store very large data, it usually stores a string of no more than 100 bytes.