兼容 Redis 的嵌入式 NoSQL 引擎:rlite

jopen 9年前

rlite 是一个自托管、无服务端、零配置、支持事务和兼容 Redis 的数据库引擎。rlite 对于 Redis 就好像 SQLite 对于 SQL。

使用场景:

  • Mobile. If you are used to Redis data structure, and it is better suited for your mobile application than sqlite, you can use rlite as a database.

  • Replace Redis in development stack. By being embedded, rlite does not need a separate database process, and since it is compatible with Redis you can use it while developing, even if you use Redis instead in production.

  • Replace Redis in tests. The test stack can use rlite instead of Redis if you use the latter in production. It can simplify the CI stack, and the distribution of fixtures by being in binary form, and it will not require to load completely in memory to run each test.

  • Slave of Redis. You can run rlite-server as a slave of a master Redis instance. It works as third alternative to Redis's snapshot and append-only file.

  • Store client-side application data. Alternatively to a propetary format or sqlite, command line or simple applications can store its data using rlite.

示例代码:

require('redis')  require('hirlite/connection')  redis = Redis.new(:host => ":memory:", :driver => Rlite::Connection::Hirlite)  redis.set 'key', 'value'  p redis.get 'key' # value

项目主页:http://www.open-open.com/lib/view/home/1425343053790