Рейтинг@Mail.ru
Follow on

Tarantool

A NoSQL database running in a Lua application server

Tarantool combines the network programming power of Node.JS with data persitence capabilities of Redis.

Features

  • A drop-in replacement for Lua 5.1, based on LuaJIT 2.0;
    simply use #!/usr/bin/tarantool instead of #!/usr/bin/lua in your script
  • Lua packages for non-blocking I/O, fibers and HTTP
  • MessagePack data format and MessagePack based client-server protocol
  • two data engines: 100% in-memory with optional persistence and a 2-level disk-based B-tree, to use with large data sets
  • secondary key and index iterators support
  • asynchronous master-master replication
  • authentication and access control

Support

 

Example

 1 #!/usr/bin/env tarantool
 2 
 3 box.cfg{}
 4 hosts = box.space.hosts
 5 if not hosts then
 6     hosts = box.schema.create_space('hosts')
 7     hosts:create_index('primary',
 8             {parts = {1, 'STR'}})
 9 end
10 
11 local function handler(self)
12     local host = self.peer.host
13     local response = {
14         host = host;
15         counter = hosts:inc(host);
16     }
17     return self:render{ json = response }
18 end
19 
20 httpd = require('http.server')
21 server = httpd.new('127.0.0.1', 8080)
22 server:route({ path = '/' }, handler)
23 server:start()
 

Our benchmarks (YCSB)

Workload A

Our users