📜 ⬆️ ⬇️

Unique Tarantool features


Tarantool is a very interesting database.
An idea about it can be obtained from the report of Konstantin Osipov Tarantool: how to handle 1.5 billion requests per day?

With this note I want to draw attention to the unique features that distinguish Tarantool from other similar solutions and make it a useful tool.
In addition, I will tell you how you can help this open source project and why it's cool :)


What is Tarantool


Keywords for direct loading into the brain
nosql, key-value, in-memory, durable, write-ahead log, snapshot, master-slave replication

Tarantool is a mature project.

Tarantool is developed in Mail.ru and is actively used there.
In a sense, Tarantool can be compared with Nginx, which was developed in Rambler, and only after some time gained its well-deserved fame and recognition of the community, being an open project.
')

Key Tarantool features


First of all, I want to emphasize that Tarantool is not a clone of Redis or, even more so, Memcached.
With Redis, it is congenial, but not very similar in features. For some tasks, Redis is better suited, for others, Tarantool is better.
  1. Key spaces
    Spaces are collections of objects. You can think of spaces as separate tables. This is convenient, because in one collection, as a rule, there are entities of the same type. In the same Redis, for the separation of entities, it is proposed to simply add a prefix to the keys ( "user: 1001", "session: 9994513" ). Each space in Tarantool can have its own set of indexes.

  2. Integer keys
    Along with string keys in Tarantool there is support for integer keys (32 and 64 bits)
    Firstly, it is obvious that access by 32 or 64-bit keys is faster than by keys of arbitrary length. Secondly, it may just be more convenient, for example, when using numeric IDs in a traditional (SQL) database.

  3. Secondary indexes
    Most key-value stores are limited to access by primary key. In Tarantool, you can make selections for individual attributes of the tuple (for this field must be indexed).

  4. Secondary indexes may not be unique.
    This means that a query on a non-unique field can return a set of values. For example: “return all users with country code RUS”

  5. Composite Indexes
    You can include multiple tuple fields in one secondary index. This is a complete analogue of composite indexes in "traditional" (SQL) databases. Composite indexes allow you to make queries on incomplete coincidence (wildcard). When only the first part of the index is known, Tarantool will return all relevant values.

  6. Samples by value range
    Unlike most key-value stores, Tarantool has the ability to extract ranges of values ​​(only for integer keys and only when using an index of type TREE)
    By the way, this is done by a stored function (see below).

  7. Stored Functions on Lua
    In Tarantool, you can write stored functions on Lua. Lua is a very simple language that supports JIT compilation. In short, they are very fast. Stored functions allow you to implement data schemes with a rather complex structure. For example, fifo or some ring buffers.

  8. Background processes within the database
    On Lua, you can do not only the processing of individual requests, but also implement background processors (in the cooperative multitasking mode).

  9. Simple SQL Client
    It should be used primarily for experimentation and introspection during development. Simple SQL queries are supported, such as SELECT * FROM t0 WHERE k0 = 42 .


How to start using Tarantool right now

  1. Tarantool has a simple SQL client.
    With it, you can make any requests and experiment, without writing a single line of code
  2. Tarantool supports Memcached protocol
    Use Tarantool as the best Memcached (with snapshots and transaction logs on disk).
  3. For Tarantool, there are client libraries in python, ruby, perl, php, java and C
    Think about how to use the Tarantool features in your project.


How can I help?


Tarantool is a mature system that has long been in real use.

But as an open project, it exists relatively recently. Therefore, there is little information on the Internet, the community is small, the documentation is not perfect, O'Relly does not publish books ...

And this is good! Indeed, in a project that is already widely known, it is difficult to do something significant - everything is done before us. And here - no!

Therefore, you have a real chance to make a significant contribution to the development of this promising project.
Early followers always win. This project may well become noticeable, for example, as Nginx.

Join now and the glories of glory will touch you :)


Links

Source: https://habr.com/ru/post/133435/


All Articles