<!DOCTYPE book [
<!ENTITY % tnt SYSTEM "../tnt.ent">
%tnt;
]>
<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
         xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="preface">
<title>Preface</title>
<section xml:id="tarantool-overview">
  <title>Tarantool: an overview</title>
  <para>
    <productname>Tarantool</productname> is an in-memory NoSQL
    database management system. The code is available for free under the terms of the
    <citetitle
    xlink:href="http://www.gnu.org/licenses/license-list.html#ModifiedBSD">BSD
    license</citetitle>. Supported platforms are GNU/Linux, Mac OS
    and FreeBSD.

  </para>

  <para>
    The server <emphasis role="strong">maintains all its data in
    random-access memory</emphasis>, and therefore has very low read
    latency. The server <emphasis role="strong">keeps persistent copies of
    the data in non-volatile storage</emphasis>, such as disk,
    when users request "snapshots". The server <emphasis role="strong">
    maintains a write-ahead log (WAL)</emphasis> to ensure
    consistency and crash safety of the persistent copies.
    The server <emphasis role="strong">performs inserts and updates atomically</emphasis> --
    changes are not considered complete until the WAL is written.
    The logging subsystem supports group commit.
  </para>

  <para>
    When the rate of data changes is high, the write-ahead log file
    (or files) can grow quickly. This uses up disk space, and
    increases the time necessary to restart the server (because
    the server must start with the last snapshot, and then replay
    the transactions that are in the log). The solution is to
    make snapshots frequently. Therefore the server ensures that
    <emphasis role="strong">snapshots are quick, resource-savvy, and non-blocking
    </emphasis>. To accomplish this, the server uses delayed garbage
    collection for data pages and uses a copy-on-write technique for
    index pages. This ensures that the snapshot process has a
    consistent read view.
  </para>

  <para>
    <emphasis role="strong">Tarantool is lock-free</emphasis>.
    Instead of the operating system's concurrency primitives, such
    as mutexes, Tarantool uses cooperative
    multitasking to handle thousands of connections simultaneously.
    There is a fixed number of independent execution threads.
    The threads do not share state. Instead they
    exchange data using low-overhead message queues. While this
    approach limits the number of cores that the server will use,
    it removes competition for the memory bus and ensures peak
    scalability of memory access and network throughput.
    CPU utilization of a typical highly-loaded
    Tarantool server is under 10%.
  </para>

  <para>
    Unlike most NoSQL DBMSs, Tarantool supports <emphasis role="strong">
    secondary index keys and multi-part index keys</emphasis>
    as well as primary keys. The possible index types are
    HASH, TREE, and BITSET.
  </para>

  <para>
    As its key feature, Tarantool supports <emphasis
    role="strong">Lua stored procedures</emphasis>, which
    can access and modify data atomically.
    Users can create, modify and drop Lua procedures at runtime.
  </para>
  <para>
    There is a role not only for Lua procedures, but also for Lua programs.
    During startup, Lua programs can be used to define
    triggers and background tasks, or interact with networked peers.
    Unlike popular application development frameworks based on
    a "reactor" pattern, networking in server-side Lua is
    sequential, yet very efficient, as it is built on top of the
    cooperative multitasking environment that Tarantool itself uses.
    </para>
    <para>
    Extended with Lua, Tarantool typically replaces
    multiple components of an existing system. Complex
    multi-tier Web application architectures
    become simpler, and performance is good.
  </para>

  <para>
    Tarantool supports <emphasis role="strong">asynchronous replication
    </emphasis>, locally or to a remote host. Replication does not
    cause blocking of writes to the master database.
    If the master becomes unavailable, a replica can assume the
    master role without requiring a restart.
  </para>

  <para>
    Tarantool is <emphasis role="strong">in production today</emphasis>.
    Tarantool was created by and is actively used at
    <citetitle xlink:href="http://api.mail.ru">Mail.Ru</citetitle>,
    one of the leading Russian web content providers. At Mail.Ru
    the software serves the <quote>hottest</quote>
    data, such as online users and their sessions, online application
    properties, mapping between users and their serving shards,
    and so on.
   </para>
   <para>
   Outside Mail.Ru the software is used by a growing
    number of projects in online gaming, digital marketing, and social
    media industries. While product development is sponsored by Mail.Ru, the
    roadmap, the bugs database and the development process are fully
    open. The software incorporates patches from dozens of
    community contributors. The Tarantool community writes and maintains
    most of the drivers for programming languages.
  </para>

</section>
<section xml:id="manual-conventions">
  <title>Conventions</title>
  <para>
    This manual is written in <citetitle
    xlink:href="http://www.docbook.org/tdg5/en/html/docbook.html">DocBook
    5</citetitle> XML markup language and is using the standard <citetitle
    xlink:href="http://docbook.sourceforge.net/release/xsl/current/doc/">DocBook
    XSL</citetitle> formatting conventions:</para>
  <para>
    UNIX shell command input is prefixed with '$ ' and is in
    a fixed-width font:
    <programlisting><prompt>$ </prompt>tarantool_box <option>--background</option></programlisting>
  </para>
  <para>
    File names are also in a fixed-width font:
    <programlisting><filename>/path/to/var/dir</filename></programlisting>
  </para>
  <para>
    Text that represents user input is in boldface:
    <programlisting><prompt>$ </prompt><userinput>your input here</userinput></programlisting>
  </para>
  <para>
    Within user input, replaceable items are in italics:
    <programlisting><prompt>$ </prompt><userinput>tarantool_box <replaceable>--option</replaceable></userinput></programlisting>
  </para>
</section>
<section xml:id="reporting-bugs">
  <title>Reporting bugs</title>
  <para>
    Please report bugs in Tarantool at <link
    xlink:href="http://github.com/tarantool/tarantool/issues"/>. You can
    contact developers directly on
    <link xlink:href="irc://irc.freenode.net#tarantool">#tarantool</link>
    IRC channel or via a mailing list,
    <link xlink:href="https://googlegroups.com/group/tarantool">Tarantool Google group</link>.
  </para>
</section>

</chapter>
<!--
vim: tw=66 syntax=docbk
vim: spell spelllang=en
-->
