.. _tarantool-server-config:
``findface-tarantool-server``
---------------------------------
The ``findface-tarantool-server`` service provides interaction between the ``findface-sf-api`` service and the Tarantool-based feature vector database in the following way:
.. tip::
See `Tarantool official documentation `_ for details.
* From ``findface-sf-api``, ``findface-tarantool-server`` receives data, such as information of detected objects, to write into the feature vector database.
* By request from ``findface-sf-api``, ``findface-tarantool-server`` performs database searches and returns search results.
Multiple ``findface-tarantool-server`` shards can be created on each Tarantool host to increase search speed. Their running concurrently leads to a remarkable increase in performance (70x-100x).
Functionality:
* saving object data to the feature vector database,
* database search,
* implementation of direct API requests to the database (see :ref:`tarantool-api`).
The ``findface-tarantool-server`` configuration is done through the ``/etc/tarantool/instances.available/.lua`` configuration file. You can find its default content :download:`here <_scripts/shard.lua.txt>`.
.. important::
In a multi-shard environment, the configuration has to be done for each shard.
When configuring ``findface-tarantool-server``, refer to the following parameters:
+--------------------------+------------------------------------------------------------------------------------------------------------+
| Parameter | Description |
+==========================+============================================================================================================+
| ``force_recovery`` | Enables automatic database recovery. In this case, each time an error occurs while reading a snapshot or |
| | xlog file, Tarantool will skip invalid records, read as much data as possible, and re-build the file. |
+--------------------------+------------------------------------------------------------------------------------------------------------+
| ``license_ntls_server`` | IP address and port of the ``findface-ntls`` license server. |
+--------------------------+------------------------------------------------------------------------------------------------------------+
| ``memtx_memory`` | Maximum RAM that can be used by a Tarantool shard. Set in bytes, depending on the number of objects the |
| | shard handles. Consult our experts by support@ntechlab.com before setting this parameter. |
+--------------------------+------------------------------------------------------------------------------------------------------------+
| ``meta_scheme`` | A database structure to store the object recognition results. The structure is created as a set of fields. |
| | Describe each field with the following parameters: ``id``: field id; ``name``: field name, must be the |
| | same as the name of a relevant object parameter; ``field_type``: data type; ``default``: field default |
| | value, if a default value exceeds ‘1e14 – 1', use a string data type to specify it, for example, |
| | ``"123123.."`` instead of ``123123..``. |
+--------------------------+------------------------------------------------------------------------------------------------------------+
The default database structure is passed from ``/etc/findface-security/tnt_schema.lua`` to the ``meta_scheme`` parameter. See :ref:`modify-schema` for details.