Difference between memtx and vinyl storage engines
The primary difference between memtx and vinyl is that memtx is an in-memory engine while vinyl is an on-disk engine. An in-memory storage engine is generally faster (each query is usually run under 1 ms), and the memtx engine is justifiably the default for Tarantool. But on-disk engine such as vinyl is preferable when the database is larger than the available memory, and adding more memory is not a realistic option.
Option | memtx | vinyl |
---|---|---|
Supported index type | TREE, HASH, RTREE or BITSET | TREE |
Temporary spaces | Supported | Not supported |
random() function | Supported | Not supported |
alter() function | Supported | Supported starting from the 1.10.2 release (the primary index cannot be modified) |
len() function | Returns the number of tuples in the space | Returns the maximum approximate number of tuples in the space |
count() function | Takes a constant amount of time | Takes a variable amount of time depending on a state of a DB |
delete() function | Returns the deleted tuple, if any | Always returns nil |
yield | Does not yield on the select requests unless the transaction is committed to WAL | Yields on the select requests or on its equivalents: get() or pairs() |