嵌入式 NoSQL 引擎 rlite
时间:2015-03-04 01:48 来源:linux.it.net.cn 作者:IT
rlite 是一个自容器、无服务端、零配置、支持事务和兼容 Redis 的数据库引擎。rlite 对于 Redis 就好像 SQLite 对于 SQL。
使用场景:
-
移动应用
-
在开发环境中替换 Redis 堆栈
-
在测试环境中替换 Redis
-
作为 Redis 的从节点
-
存储客户端应用数据
示例代码:
1
2
3
4
5
require(
'redis'
)
require(
'hirlite/connection'
)
redis = Redis.
new
(:host =>
":memory:"
, :driver => Rlite::Connection::Hirlite)
redis.set
'key'
,
'value'
p redis.get
'key'
# value
(责任编辑:IT)
rlite 是一个自容器、无服务端、零配置、支持事务和兼容 Redis 的数据库引擎。rlite 对于 Redis 就好像 SQLite 对于 SQL。 使用场景:
示例代码:
(责任编辑:IT) |