T + Conf 2019: Tarantool at Aeroflot, or MDM on the fly



Today we publish a transcript of the report of Nikolai Shevtsov and Rustam Kildiev with T + Conf 2019 " Tarantool in Aeroflot, or MDM (Master Data Management) on the fly ." From the report you will learn:

  • Why is MDM needed?
  • Why do i need real time?
  • Data Science is more than just a Jupyter Notebook.
  • Pros of Tarantool.
  • Why Lua is good at selling.

Information technology actively helps our company in attracting customers. Today, we are actively introducing a number of Big Data projects. These are marketing projects that help us in segmenting data and communicating information to customers, social research, dealing with complaints and appeals, and much more. Also, several projects are being implemented that help to increase the profitability and profitability of the business. For example, one of the projects is the analysis of available baggage on board in order to sell surplus on time, or to predict the failure of individual components and spare parts of aircraft for timely maintenance.

It is in the call handling platform that we actively use Tarantool, and a little more about it.

The main value of Big Data for us is the ability to analyze data. We are trying to collect all new sources of information related to Aeroflot in a single information field for further processing.

Nikolay Shevtsov, Aeroflot. Project Manager in the Department of Information Systems.

How do people usually buy a ticket? There is an idea about the trip, a person shares it with friends and relatives, in social networks and forums, and then buys a ticket on the site. There are many sources of information, and our task is to collect all of them and analyze them in order to understand the attitude of passengers to the service and the airline as a whole.

One of our projects is called the Call Platform. We collect all reviews, appeals and complaints from numerous sources. “Platform” is our single collection window on the site or in the mobile application through which we receive information from users. We also collect Aeroflot related social media reviews.

Many Aeroflot divisions are involved in handling complaints and appeals: employees engaged in on-board services, in the departure area, in the arrival area, etc. Most complaints, about 2.5 thousand per day, come from arriving passengers who have any problems. Each complaint needs to be processed, classified and redirected to the appropriate department to a specific employee who can solve the passenger's problem. Identical complaints can be grouped to save time analyzing the situation and making a decision.

The aim of the project is to optimize the processing of applications and reduce the time for their processing. To do this, it was necessary to create a system that, at the time of a complaint, automatically determines its topic and sends it to the appropriate department to the responsible employee. In the process of processing a complaint, the system must find all available information on the client, up to his profile, planned future flights, etc.

At the start of the project, we considered several tools that could help us in this matter and eventually chose Tarantool. Life has shown that this was the right choice: it allows you to comply with SLA requirements and at the same time scales well with increasing load.

Implementation


Aeroflot introduced a platform for handling complaints. This is a repository of unstructured information, on the basis of which the analysis and synthesis of unique customer profiles is carried out.


The information received upon requests must be processed and systematized. Appeals are text that cannot be stored in a raw form, so the entire text is vectorized. A search is made for a set of hits, a map of unique words and phrases is compiled, based on which the initial vector is calculated to convert all subsequent hits. Initially, our data analysis specialists used classic tools - Python and Jupyter Notebook on a cluster or local laptop. The vector has a dynamic size, which creates difficulties.

Unlike many other tools, Tarantool is a complete application server. We can use many libraries, such as SciLua, write logic in a regular programming language, etc. Now we are vectorizing data using the SicLua library in real time directly in Tarantool. Then, using the cosine distance method, the system searches for a similar vector for a three-month period. As a result, we get either a double or similar calls for further processing. In the search process, a lot of mathematical calculations are performed: in 3 months, approximately 100 thousand calls are processed from all available sources. The average processing time is 120 ms.

Rustam Kildiev, CTO at Innodata.

Infrastructure


Our Tarantool database runs on four sixteen-core servers with a large amount of RAM. Thanks to the Vshard module, it was possible to implement a quick search with brute force. The data is divided into parts - buckets, so that query processing is parallelized. The system is easy to scale, just add a server. We have master-master replication implemented, although most DBMSs are now coming to that. Also, we do not need to add modules, there are no problems with administration.

Our amount of data, if we count from RAM, is about 1 TB. At the stage of starting, debugging and fixing errors in the project, problems arose. Almost all tables contain 7-8 indexes, so the Tarantool database for 1 TB took us 20-40 minutes, which is unacceptable. During startup, the system builds indexes and if you remove them, then loading will go much faster. In this situation, the Hot-standby function helped us.

Plans


Both the customer and us, the performers, liked Tarantool. We considered other bases, but in the end we chose Tarantool. Firstly, we needed a very fast base. Secondly, it will have to work a lot with it, write logic, etc., so full-fledged Lua was an advantage for us. Thirdly, Tarantool immediately writes to disk and does not take snapshots, and this is good for us too, because although there are a lot of calls from customers, we cannot afford to lose even one.

Tarantool has proven its usefulness in production, and we will load even more data into it, add business logic. Unlike other databases, it does not need to be constantly tuned and something changed. By the way, the conversion and loading of data into Tarantool from another system is automated and is performed daily.

In the future, we plan to switch to Tarantool Enterprise, which will allow us to conveniently administer and configure several Tarantool instances. There are still few specialists in this database, and the need for them is constantly growing. Our qualifications are sometimes not enough. In such cases, the Tarantool developers internal chat helps, in which you can ask for help. This is not in any other system.

We also plan to upgrade to Tarantool2 and SQL. There are many SQL experts in the labor market, so the transition will not be very difficult.

findings


The main problem of this project was Lua. Few developers know it, but they love it even less. Initially, we wrote using another language, but due to the huge number of requests the system worked slowly. Therefore, we copied everything with Lua for a long time and pain, but as a result, the system works clearly and quickly, with a small number of corrections and releases. Lua is very close to machine code and is one of the fastest languages ​​from the C family. Although it is a small scripting language, it has all the necessary libraries, and we were able to transfer search, vectorization, cosine distance, etc. algorithms.

Tarantool is very fault tolerant and works out of the box. We conducted numerous experiments: turned off Tarantool, lifted, etc. - everything works fine, and intermediate data is written to disk, so we do not lose data.

All Articles