TreapDB:一个基于Treap的高性能NoSQL数据库

fxsjy 2010-12-10 09:32:54
项目地址:http://code.google.com/p/treapdb/
开发人员:Junyi Sun和Ma Qiang(中科院计算所)

特点:
1. 支持大数据量(1亿以内的key-value pair,在SATA硬盘,64位服务器上8200tps写入,15000tps读取)
2. 不只支持GET和PUT操作,还支持取前缀,取区间(开区间、闭区间),K个最小值,K个最大值
3. 支持主从复制,从而实现读写分离和灾备
4. 同时支持Memcached的协议和基于Thrfit的协议(后者可以支持轻松生成各种语言的客户端)
5. 可以把TreapDB的索引数据结构嵌入自己的代码,就一个jar包,完全可以不用使用服务器

下面是TreapDB提供的服务接口描述:

service specification:
namespace java fx.sunjoy.server.gen

struct Pair {
1: string key,
2: binary value,
}

service TreapDBService{
void put(1:string key, 2:binary value);
binary get(1:string key),
list<Pair> prefix(1:string prefixStr,2:i32 limit),
//fetch keys startswith prefixStr
list<Pair> kmax(1:i32 k), //fetch top k pairs who has the biggest key
list<Pair> kmin(1:i32 k), //fetch top k pairs who has the smallest key
list<Pair> range(1:string kStart, 2:string kEnd,3:i32 limit),
//fetch pairs whose key is less than kEnd and equal or greater than kStart
list<Pair> before(1:string key,2:i32 limit),
//fetch pairs whose key is equal or less than key
list<Pair> after(1:string key,2:i32 limit),
//fetch pairs whose key is equal or greater than key
i32 length(),
// how many pairs in the store, O(1) time complexity.
bool remove(1:string key)
// remove a pair by key
}
...全文
181 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

25,980

社区成员

发帖
与我相关
我的任务
社区描述
高性能WEB开发
社区管理员
  • 高性能WEB开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧