
We open Avito's techno blog. Many people know the brand, but not so many who know how the service is arranged from the technical side. In our blog we will open the veil of the unknown and tell you about the technical kitchen service.
Let's start with a little story about what the project is today, what the team of engineers is doing, and what we plan to do in the near future. We have also collected in this post many links to already published materials, reports and presentations of our team, which we have long wanted to share. Want to know where your ads live? Welcome under the cut!
Start
It is very difficult to start a short story about a company with a rich history so that nothing is forgotten and not much to go into details. We will leave the details for future articles, in which we will try to disclose these or other issues in more detail. If you have special or interesting topics that you would like to hear from Avito developers, write about them in the comments - we will definitely touch on these questions.
')
As with many large projects, Avitoβs story began with a small team. The first version of the site was launched in the 2007th year, and the first steps were full of trial and error. In its current form, the site was formed only two years later. The service began to be created by only 4 developers who were engaged in absolutely everything, from the infrastructure to the client side. The site of the year 2009 could hardly be sent to the contest βThe best site for something or somethingβ. But this result still causes a feeling of nostalgia among those involved in it. Like a certain pride, because it was done with a small amount of resources, but enough to express itself and lay the foundation for a successful company.
It is difficult to imagine, but until 2012, the size of the development team remained almost unchanged. However, the project became more and more, and it became a necessity. Since 2012, the team has begun to grow actively, increasing at times. There was a division into specializations, areas, projects, teams, groups. Now Avito employs a technical department of more than 250 specialists.
Avito today
Today Avito consistently ranks among the
top 5 runet sites , the
world's top 3 classifiers from
various sources . Every month, through the web and mobile applications, the service serves more than 35 million users who daily publish about a million new announcements (more than a billion have accumulated in the βback officeβ) and make more than 100 thousand transactions. According
to Yandex , in some cities of Russia (for example, in Moscow), Avito is ahead of everyone in the number of page views, including social networks.

Avito is a high load project. Some numbers to estimate the scale: 300+ servers, 10TB in postgres, 270TB pictures, 13Gbit / s traffic in the evening at the peak, about a million requests to backend per minute. Therefore, expertise in data processing is one of the most critical for our business processes. It should be understood that such amounts of data need not only to accumulate and store, but also to process, filter, classify and search for them. A single tool cannot effectively cope with all tasks, because a number of solutions are used, such as: PostgreSQL, Tarantool, Vertica, MongoDB, Redis and other storage systems. We will certainly share stories about the features of architecture in future articles. In the meantime, you can read the reports in which our colleagues share their experiences:

A lot of data is good for the service, but a big problem for the user is how to find the right one? This helps to systematize ads and search for them. Search is the most difficult task. And the problem here is not so much in the data volumes as in the human factor. The fact is that users are constantly mistaken, both in the description of ads and in the search line. One of the main tasks is to level the errors in the description and understand what the user meant.
To eliminate errors in the descriptions, various reference books and correction algorithms are used, as well as more advanced approaches such as computer vision. The latter, for example, with a very high probability (
in some categories more than 95% ) determines whether the user has chosen the category correctly. In addition, Avito regularly attracts machine learning specialists to participate in contests (on the
machinelearning.ru ,
boosters and
kaggle platforms ), the purpose of which is to search for the most efficient algorithms for solving various applied problems.
For full-text search, Sphinx is used, and we regularly share our experience in using it, and we actively participate in the development of technology.
As already mentioned, users add around a million new ads every day. But few people know that more than half of them are spam. Traditionally used for this moderation. Interesting fact: the first version of the moderation system was written in just one week, and so successfully that since then it has never been necessary to rewrite it somehow. But, despite the improvements, it is obvious that it is difficult to handle this amount of information manually. Therefore, more advanced methods are used, for example, neural networks that are constantly trained based on the actions of moderators. Nevertheless, the confrontation between spammers and the moderation system is endless, and we will devote a separate post to this.

A minute of advertising ... or rather, let's talk about her show. Economic and ethical issues leave for other blogs. Here the technical component of this question is interesting. The fact is that advertisers and sites are interested only in the target audience. To define it, audience segmentation is used. The problem is that there are a huge number of users and their requests, and in order to determine the category of a user, many criteria must be taken into account. At the same time, the time for determining the category is limited, because then it will be transferred to advertising sites, an auction will take place between them, and only then will the advertising block be determined for display. All this is due to the large amount of data and the requirement that everything happen in a split second. We already talked more about this at conferences and meetings.
Data is not the only hard place. Business and the market dictate all the new conditions that are turning into an increasingly complex business logic. Historically, the business logic of the service is implemented in PHP. Last year we switched to a new version of it - PHP7, and we already feel how the servers exhaled and began to strain three times less. Today, PHP is not the only server language used in Avito. Initially, the project was monolithic, but it has long been developing towards microservices. Depending on the task and workload, different languages ββare used, such as Python and Go.
Whatever complex tasks are solved on the server side, this is all hidden from the average user. And what users see when working with the service is done by the front-end team. Initially, the site was created on the traditional technologies of that time, server rendering and jQuery. But not so long ago, we completely abandoned jQuery in favor of browser-based APIs and small libraries that solve specific problems. Frontend development is trying to keep up with the times, to use the latest technologies and approaches. For example, a new version of JavaScript has been used since the specification was approved (ECMA2016 is being used now). In addition, more and more web applications (SPA) appear, which are implemented on
React and
basis.js . Front-end developers also participate in open source projects (such as, for example,
CSSO ), create tools and share their experience at conferences:
- Video recording of the report β How to make your JavaScript faster β, Roman Dvornov (Highload ++, 2016)
- Video recording of the β Frontend in Avito β report, Alexander Lobashev (WSD Moscow, 2015)
- Video recording of the report β MRI for data β, Anastasia Goryacheva (WSD Ekaterinburg, 2016)
- Video recording of the report β Compress CSS β, Roman Dvornov (DUMP, 2016)
- Video recording of the report β How not to test β, Ivan Strelkov (FrontTalks, 2016)
- Video record of the β Instruct It β report, Roman Dvornov (FrontTalks, 2015)
- Video recording of the report β Glitter and poverty of proxy-browsers β, Alexander Zubov (Mobile Frontend Meetup, 2015)

Avito company appeared practically together with the birth of a mobile platform, as we know it today. Of course, at first there was only a web version, then a web version appeared, adapted for mobile devices. But native applications are native applications, and they have their own specificity, which depends on the platform. Today, mobile applications receive a lot of attention - and we are confident that this trend will continue. Separate teams develop several applications for
iOS and
Android . The guys approach the issue of development responsibly, share their experiences at conferences and developments on
GitHub .
Both teams, both iOS and Android, use the most advanced technology stack. First, it is Swift and Kotlin, which have almost completely replaced the heavy legacy of Java and Objective-C in our products. Secondly, it is investing in the development and promotion of engineering practices - CI, CD, Code Review, testing automation. Thirdly, it is a clean and scalable architecture that allows several groups of developers to develop a large project without collisions and quickly respond to the needs of users.
Initially, Avito was painted by managers and developers, but with the advent of mobile applications, it became clear that this direction should be developed in the company. We now have 15 interface designers: the Avito team and the Acti professional tools team.
The design and development of interfaces for such a large product is a very complicated, but interesting process. All work is being built in tight interaction with the development, as there are many restrictions on the part of the platform that need to be considered. Designers are always trying to find the best solution in terms of user convenience, business, development and timing.
Designers not only draw mockups, but also write their own applications, plug-ins, develop complex interactive prototypes, and participate in the development of a design platform. Some tricky questions guys
answered in the article on vc.ru.Testing in Avito did not appear immediately, the first QA-specialists joined the team in 2012. Today there are more than 40 specialists in it, one third of whom are automatizers. The toolkit is fairly standard: PHP + PHPUnit, Selenium, Selendroid. To organize the interaction between testers and developers, the Avito.Cthulhu hand-written tool is used, which allows you to store test cases, distribute tasks and track those that were returned for testing.
Here is the development of Avito, if briefly. Of course, much is still behind the scenes. We will try to fix this shortcoming soon!
Instead of conclusion
You can learn more about Avito technical kitchen from the reports of our developers at leading conferences and meetings. In addition, we regularly organize meetings of developers in our office and host events of independent communities, such as MoscowJS, CocoaHeads, PostgreSQLRussia, Tarantool, Moscow SPA meetup and others. Announcements of all events and news, we publish in our technology
channel AvitoTech , there we also publish links to the final materials. Records from meetings held in our office can be found on our
Youtube channel . Write in the comments, from which side you would be interested to learn about Avito, and we will definitely take into account your wishes when preparing the next posts. See you again!