






















Plurk.com在今年2月28日开源了LightCloud这个分布式的键-值数据库,根据官方网站的信息,有以下特性
Memcached是缓存服务器,而LightCloud内存储的数据是持久的(到底是数据库嘛)。
MySql和其他关系数据库服务器存储键-值对时效率不高(肯定没LightCloud这种专用的高)。
对LightCloud和Memcached做10,000次set和get
Elapsed for 10000 gets: 1.74538516998 seconds [memcache] Elapsed for 10000 gets: 3.57339096069 seconds [lightcloud] Elapsed for 10000 sets: 1.88236999512 seconds [memcache] Elapsed for 10000 sets: 9.23674893379 seconds [lightcloud]
值得注意的一点是Memcached是完全在内存中操作的,而LightCloud是会读写硬盘的。
而Tokyo Tyrant官网提供的数据更加惊人(LightCloud在Tokyo Tyrant上增加了网络和Python语言执行开销)
1 million GETS in < 0.5 seconds
1 million SETS in < 0.5 seconds
Lua扩展貌似是由Tokyo Tyrant提供的
下面是一个简单的扩展,扩展出一个incr命令
function incr(key, value)
value = tonumber(value)
if not value then
return nil
end
local old = tonumber(_get(key))
if old then
value = value + old
end
if not _put(key, value) then
return nil
end
return value
end
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。