Concepts
Tarantool is a NoSQL database. It stores data in spaces, which can be thought of as tables in a relational database, and tuples, which are analogous to rows. There are six basic data operations in Tarantool.
The platform allows describing the data schema but does not require it.
Tarantool supports highly customizable indexes of various types.
To ensure data persistence and recover quickly in case of failure, Tarantool uses mechanisms like the write-ahead log (WAL) and snapshots.
For details, check the Data model page.
Tarantool executes code in fibers that are managed via cooperative multitasking. Learn more about Tarantool’s thread model.
For details, check the page Fibers, yields, and cooperative multitasking.
Tarantool’s ACID-compliant transaction model lets the user choose between two modes of transactions.
The default mode allows for fast monopolistic atomic transactions. It doesn’t support interactive transactions, and in case of an error, all transaction changes are rolled back.
The MVCC mode relies on a multi-version concurrency control engine that allows yielding within a longer transaction. This mode only works with the default in-memory memtx storage engine.
For details, check the Transactions page.
Using Tarantool as an application server, you can write applications in Lua, C, or C++. You can also create reusable modules.
To increase the speed of code execution, Tarantool has a Lua Just-In-Time compiler (LuaJIT) on board. LuaJIT compiles hot paths in the code – paths that are used many times – thus making the application work faster. To enable developers to work with LuaJIT, Tarantool provides tools like the memory profiler and the getmetrics module.
For details on Tarantool’s modular structure, check the Modules page.
To learn how to use Tarantool as an application server, refer to the guides in the How-to section.
Tarantool implements database sharding via the vshard
module.
For details, go to the Sharding page.
Tarantool allows specifying callback functions that run upon certain database events. They can be useful for resolving replication conflicts. For details, go to the Triggers page.
Replication allows keeping the data in copies of the same database for better reliability.
Several Tarantool instances can be organized in a replica set. They communicate and transfer data via the iproto binary protocol. Learn more about Tarantool’s replication architecture.
By default, replication in Tarantool is asynchronous. A transaction committed locally on the master node may not get replicated onto other instances before the client receives a success response. Thus, if the master reports success and then dies, the client might not see the result of the transaction.
With synchronous replication, transactions on the master node are not considered committed or successful before they are replicated onto a number of instances. This is slower, but more reliable. Synchronous replication in Tarantool is based on an implementation of the RAFT algorithm.
For details, check the Replication section.
A storage engine is a set of low-level routines that store and retrieve values. Tarantool offers a choice of two storage engines:
For details, check the Storage engines section.