[go: up one dir, main page]

DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

Database Entry

Tarantool: Version Comparison


Logo v1 logo v2 logo
Description
Tarantool is an integration of a Lua application server and a database management system. The DBMS was originally developed as an in-memory NoSQL DBMS, and later it was extended with a disk storage engine option. Tarantool's in-memory engine is lock-free. It uses cooperative multitasking to handle thousands of connections simultaneously. There is a fixed number of independent execution threads and they do not share state. The disk-based storage engine exploits the advantage of single-threaded requests too and hence avoid unnecessary locks. Tarantool supports asynchronous replication.
Tarantool is an integration of a Lua application server and a database management system. The DBMS was originally developed as an in-memory NoSQL DBMS, and later it was extended with a disk storage engine option. Tarantool's in-memory engine is lock-free. It uses cooperative multitasking to handle thousands of connections simultaneously. There is a fixed number of independent execution threads and they do not share state. The disk-based storage engine exploits the advantage of single-threaded requests too and hence avoid unnecessary locks. Tarantool supports asynchronous replication.
History
Tarantool’s creator and biggest user is Mail.Ru, which is the largest internet company in Russia. Although Mail.Ru is the sponsor for product development, the development is open-sourced, incorporating patches from dozens of community contributors. Most of its components are written from scratch, and the DBMS is still under improvement.
Tarantool’s creator and biggest user is Mail.Ru, which is the largest internet company in Russia. Although Mail.Ru is the sponsor for product development, the development is open-sourced, incorporating patches from dozens of community contributors. Most of its components are written from scratch, and the DBMS is still under improvement.
Start Year 2005 2005
End Year
Twitter URL
Countries Russia Russia
Former Names
Website URL https://tarantool.org/ https://tarantool.org/
Docs URL https://www.tarantool.io/en/doc/1.10 https://www.tarantool.io/en/doc/1.10
Source Repo URL https://github.com/tarantool/tarantool https://github.com/tarantool/tarantool
Blog URL
Wikipedia URL
Tags
Licenses
BSD License
BSD License
Operating Systems
Linux
Linux
Governance
Project Types
Commercial Open Source
CommercialOpen Source
Supported Languages
Lua
Written In
C
C
Coding Agents
Developer Orgs
Tarantool
Tarantool
Derived From
SQLite
SQLite
Embedded Systems
Inspired By
Compatible With
Hosted Services
Acquisitions
Checkpoints
Non-Blocking
Tarantool uses write ahead logging (WAL), thus checkpoints are necessary. In the docs, checkpoints are mentioned as snapshots. Users can either force the DBMS to take a snapshot, or enable automatic creation of snapshot files. Users can control the number of snapshots stored and the snapshot interval. During a snapshot, copy-on-write and multi-version concurrency control is used. When the master process changes part of a primary key, the snapshot process obtains an old copy of the page.
  1. https://www.tarantool.io/en/doc/1.10/book/box/data_model
  2. https://www.tarantool.io/en/doc/1.10/reference/configuration#book-cfg-checkpoint-daemon
  3. https://www.tarantool.io/en/doc/1.10/reference/reference_lua/box_snapshot#box-snapshot
Non-Blocking
Tarantool uses write ahead logging (WAL), thus checkpoints are necessary. In the docs, checkpoints are mentioned as snapshots. Users can either force the DBMS to take a snapshot, or enable automatic creation of snapshot files. Users can control the number of snapshots stored and the snapshot interval. During a snapshot, copy-on-write and multi-version concurrency control is used. When the master process changes part of a primary key, the snapshot process obtains an old copy of the page.
  1. https://www.tarantool.io/en/doc/1.10/book/box/data_model
  2. https://www.tarantool.io/en/doc/1.10/reference/configuration#book-cfg-checkpoint-daemon
  3. https://www.tarantool.io/en/doc/1.10/reference/reference_lua/box_snapshot#box-snapshot
Compression
Concurrency Control
Optimistic Concurrency Control (OCC)
Tarantool uses one single thread for processing all transactions of a database instance, which is called 'transaction processor thread'. Thus the design is *lock-free*. Transactions occur in *fibers* on that single thread. A fiber is a set of instructions that may contain “yield” signals (yield can be either explicit or implicit, e.g., system calls). The transaction processor thread will execute all computer instructions until a yield, and then schedule a switch to another potentially ready fiber. This scheduling scheme is called *cooperative scheduling*. It means that unless a running fiber deliberately yields control, it cannot be preempted by other fibers. Thus, a transaction's author has the responsibility not to write long-running computations without a yield. When transaction commits, a yield happens and changes are written to WAL. A simple optimistic scheduler is used: the first transaction to commit wins. Any active transaction that has read a value modified by a committed transaction will be aborted. Moreover, Tarantool's cooperative scheduler implementation ensures that, in absence of yields, a multi-statement transaction is not preempted and thus will never be aborted.
  1. https://www.tarantool.io/en/doc/1.10/book/box/atomic
Optimistic Concurrency Control (OCC)
Tarantool uses one single thread for processing all transactions of a database instance, which is called 'transaction processor thread'. Thus the design is **lock-free**. Transactions occur in **fibers** on that single thread. A fiber is a set of instructions that may contain “yield” signals (yield can be either explicit or implicit, e.g., system calls). The transaction processor thread will execute all computer instructions until a yield, and then schedule a switch to another potentially ready fiber. This scheduling scheme is called **cooperative scheduling**. It means that unless a running fiber deliberately yields control, it cannot be preempted by other fibers. Thus, a transaction's author has the responsibility not to write long-running computations without a yield. When transaction commits, a yield happens and changes are written to WAL. A simple optimistic scheduler is used: the first transaction to commit wins. Any active transaction that has read a value modified by a committed transaction will be aborted. Moreover, Tarantool's cooperative scheduler implementation ensures that, in absence of yields, a multi-statement transaction is not preempted and thus will never be aborted.
  1. https://www.tarantool.io/en/doc/1.10/book/box/atomic
  2. https://www.tarantool.io/en/doc/1.10/reference/reference_lua/fiber#fiber-fibers
Data Model
Key-Value
The basic unit is a **tuple**, composed of fields. A tuple means a 'row' or 'record'. Tuples must have a primary index, and can have secondary indexes (can be non-unique). Fields are similar to regular 'record fields', except that (1) they can be composite structures, (2) they do not need to have names. Any tuple may have an arbitrary number of fields, and the fields may be of different types. Tuples are stored as MsgPack arrays. A space is a container for tuples, and a space should have a unique identifier and a designated storage engine.
  1. https://en.wikipedia.org/wiki/Tarantool
  2. https://www.tarantool.io/en/doc/1.10/book/box/data_model
Foreign Keys
Not Supported
Tarantool is a NoSQL DBMS that do not support foreign keys.
Hardware Acceleration
Indexes
B+Tree BitMap R-Tree
B+TreeBitMapR-Tree Hash Table
Tarantool has two storage engines: (1) memtx, the in-memory storage engine (2) vinyl, the on-disk storage engine. The in-memory storage engine memtx is the default engine and first to be developed. Memtx engine's supported indexes are TREE, HASH, RTREE and BITSET. Vinyl only supports TREE index. The underlying implementation is LSM trees.
  1. https://www.tarantool.io/en/doc/1.10/book/box/data_model#index
  2. https://www.tarantool.io/en/doc/1.10/book/box/engines
Isolation Levels
Joins
Logging
Query Compilation
Query Execution
Query Interface
Storage Architecture
Storage Model
Storage Organization
Stored Procedures
System Architecture
Views