{% page intro en %}

## What is Tarantool?

Tarantool/Box, or simply Tarantool, is a high performance NoSQL database. The code is available for free under the terms of <em><a href="http://www.gnu.org/licenses/license-list.html#ModifiedBSD">BSD license</a></em>. Supported platforms are GNU/Linux, Mac OS and FreeBSD.

## An overview of the architecture

The server <span class="strong"><strong>maintains all data in random-access memory</strong></span>, and therefore can handle read requests blazingly fast.  At the same time, a copy of the data is kept on non-volatile storage (a disk drive), and inserts and updates are performed atomically.

To ensure atomicity, consistency and crash-safety of the persistent copy, a write-ahead log (WAL) is maintained, and each change is recorded in the WAL before it is considered complete.

If update and delete rate is high, a constantly growing write-ahead log file (or files) can pose a disk space problem, and significantly increase time necessary to restart from disk. A simple solution is employed: the server <span class="strong"><strong>can be requested to save a concise snapshot</strong></span> of its current data. The underlying operating system's <span class="quote">&#8220;<span class="quote">copy-on-write</span>&#8221;</span> feature is employed to take the snapshot in a quick, resource-savvy and non-blocking manner. The <span class="quote">&#8220;<span class="quote">copy-on-write</span>&#8221;</span> technique guarantees that snapshotting has minimal impact on server performance.

<span class="strong"><strong>Tarantool is lock-free</strong></span>. Instead of the underlying operating system's concurrency primitives, Tarantool uses cooperative multitasking environment to simultaneously operate on thousands of connections. While this approach limits server scalability to few CPU cores, in practice it removes competition for the memory bus and sets the scalability limit to the top of memory and network throughput. CPU utilization of a typical highly-loaded Tarantool server is under 10%.

## Main features

A key feature of Tarantool is support for stored procedures, which can
access and modify data atomically. Procedures can be created, modified,
dropped at runtime. With stored procedures, it's possible to
turn Tarantool into a highly flexible and extremely fast social web
application server.

Tarantool supports replication. Replicas may run locally or on a remote host. Tarantool replication is asynchronous and does not block writes to the master. When or if the master becomes unavailable, the replica can be switched to assume the role of the master.

## How stable is the software?

<span class="strong"><strong>The software is
production-ready</strong></span>. Tarantool has been developed and is
actively used at <em><a href="http://api.mail.ru">Mail.Ru</a></em> one of
the leading Russian web content providers, since 2008. At Mail.Ru, the software serves the <span class="quote">&#8220;<span class="quote">hottest</span>&#8221;</span> data, such as online users and their sessions, online application properties, the map between users and their serving shards.

To conclude, Tarantool/Box is ideal for highly volatile and/or highly accessed Web data. With Tarantool, performance overhead on serving data is minimal: a single server can easily deal with tens or even hundreds of thousands of requests per second. Snapshots can be made when Web user activity is at its lowest, for example at night, and thus add little or no restraint on the top throughput of the system.  If the master becomes unavailable, a replica can assume the role of the master with minimal downtime.

{% page intro ru %}

<b>Tarantool</b> &mdash; однопоточный TCP сервер, реализующий кооперативную многозадачность. Разрабатывается с учетом работы под высокими нагрузками (десятки тысяч RPS). Можно выделить две логические составляющие: ядро и модули. В настоящее время подключение модулей производится на этапе компиляции. На уровне ядра реализуется базовый функционал (общение по сети, работа с бинарными логами, репликация по сети, быстрое переключение на резервный сервер и т.п.). В модулях реализуется бизнес логика конкретного приложения с использованием API ядра.

<b>Tarantool/Box</b> &mdash; хранилище данных в памяти, ключ-значение.

Сервер разрабатывался для внутренних целей в компании Mail.Ru. В процессе эксплуатации система хорошо зарекомендовала себя и была внедрена во многих проектах компании. Благодаря высокой производительности и надежности системы в условиях больших нагрузок, удалось повысить стабильность предоставляемых сервисов. Первая версия сервера, ставшего основой для целого семейства хранилищ, появилась в 2008 году. Tarantool &ndash; переработанный и усовершенствованный сервер, предназначенный для построения специализированных хранилищ. Код написан на языке С и использует расширения gcc.

__Характеристики__

* отсутствие фрагментации основной памяти и деградации производительности при работе с множеством маленьких объектов, благодаря иcпользованию собственных аллокаторов;
* возможность работы с большими объемами данных;
* наличие файла snapshot, в котором сохраняется состояние всех данных базы на момент записи на диск;
* способность сохранять все изменения состояния базы данных (логирование транзакций в файлах бинарных логов) и автоматически восстанавливать информацию после перезапуска системы;
* высокая доступность системы (в случае программных или аппаратных сбоев происходит автоматическое переключение на доступную реплику);
* совместимость с протоколом memcached;
* возможность обновлять систему незаметно от клиентских сервисов с помощью применения локальных реплик;
* репликация данных по сети;
* простой бинарный протокол для реализации дополнительной логики;
* Собирается только под gcc и clang;
* Тестировался только под Linux.


