Introduction

Tarantool is a NoSQL database running inside a Lua program. It combines the network programming power of Node.JS with data persistency capabilities of Redis. It's open source, BSD licensed. The latest release is Tarantool 1.6.3, published on July 20, 2014.

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,
  • MsgPack data format and MsgPack 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.

Our online shell gives a taste of these features and is a Tarantool Lua script.

News

  • Meet with Tarantool developers at Lua Workshop 2014!
  • 2014-08-01 Tarantool 1.5.4 is released
  • 2014-07-20 Tarantool 1.6.3 is released

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', { parts = {1, 'STR'} })
 8 end
 9 
10 local function handler(self)
11     local host = self.req.peer.host
12     local response = {
13         host = host;
14         counter = hosts:inc(host);
15     }
16     self:render{ json = response }
17 end
18 
19 httpd = require('http.server')
20 server = httpd.new('127.0.0.1', 8080)
21 server:route({ path = '/' }, handler)
22 server:start()

Learn more

Follow on GitHub