tstdb


A fast key-value store based on TST(Ternary Search Tree)

Welcome to use TSTDB V2

tstdb is based on a data structure called "Ternary Search Tree",and it is compatible with memcached. Moreover, it supports prefix searching and range searching.

what's "Ternary Search Tree"

Feature

  1. memcached protocol compatible (get/set/delete/incr/decr/cas/gets)
  2. no third-party library dependencies
  3. pipeline requests support
  4. high performance & data persistence ability
  5. prefix searching
  6. range searching: less and greater

Usage demo

This should give you a feel for how this module operates:: ``` import pytst tst = pytst.TSTClient(host='localhost',port=8402)

tst.set("some_key", "Some value") value = tst.get("some_key") print value

tst.set("another_key", 3) tst.delete("another_key")

tst.set("key", "1") tst.incr("key") tst.decr("key")

tst.set('haha/1',123) tst.set('haha/2',456) tst.set('haha/5','xyz') print tst.prefix('haha') print tst.less('haha/2') print tst.greater('haha/2')

```

output will be

```

Some value ['haha/1', 'haha/2', 'haha/5'] ['haha/2', 'haha/1'] ['haha/2', 'haha/5', 'key', 'some_key']

```

Welcome your valuable suggestions. My microblog: http://www.weibo.com/treapdb

Project Information

The project was created on Apr 10, 2011.

Labels:
key-value tst Database nosql datastore memcached range-query prefix