Tarantool keeps all the data in random-access memory (RAM). Solutions of this class are fast, but they often demonstrate a lack of data integrity. Tarantool solves all these problems. Install Tarantool to prove its speed, flexibility, and reliability!Download
Such solutions are very fast because they work in RAM. You avoid the overhead of caching and uploading. Moreover, the memory-resident approach reduces TCO because the database utilizes the processor more efficiently, and you need a smaller number of servers. There are four main cases where an in-memory database is a good fit for developing an application.
OLTP with the highest possible throughput for many simple requests
Speeding up a slow application or a database by using a caching proxy
Existing message brokers can’t keep up with the workload
You need predictable response time from the system
With the Lua programming language, you can add any data processing logic directly to the database. The code and the database share a single address space, so the applications do not use the network, thus you avoid latency, or operation processing delays. Tarantool uses not only an interpreter, but also a JIT compiler, LuaJIT. During execution, the latter converts the program into machine code.
By default, Tarantool uses the in-memory storage engine (memtx). When the amount of data exceeds the RAM capacity, we recommend that you move historical data that is rarely accessed to the disk storage engine (vinyl). Within this approach, you can optimize your resources: instead of an in-memory database + a traditional one, you only use Tarantool.
You can create indexes for all the data in Tarantool. You can search the indexed fields faster. When you need to select the same data using different criteria, you can create several indexes for a single table. Tarantool supports regular indexes and JSON indexes.
In Tarantool, you choose a data storage model. When the names and number of fields are unknown, you can use the JSON format or tuples; otherwise you can just use tables. For a table, you can specify a format that records data types in columns: for the entire table or only for its part. If you have specified the data format, then the table can be accessed using SQL queries.
Working in RAM does not mean that you risk losing all your data. We have provided mechanisms to ensure the safety of data in Tarantool.
Both in-memory storage engine and disk storage engine use write-ahead logging. The transaction result returns only after it has been saved to disk. This means that even a sudden server restart wouldn’t cause data loss.
When a disk or a server fails, replication helps prevent data loss. In Tarantool, replication lag is typically 100-200 µs, which is equal to network latency and reduces the probability of data loss to virtually zero. When you need guaranteed data persistence, you can configure synchronous replication only for critical data in the tables you need.
ACID stands for atomicity, consistency, isolation, and durability. But in-memory databases often sacrifice the latter. This is related to the very principle of RAM storage, which carries the risk of losing some information in case of failure or restart. To minimize this risk, Tarantool uses the following:
Snapshots of the data state
Synchronous writes onto several replicas