Wildberries: Optimizing TCO with Tarantool
Wildberries logo

Optimizing TCO
with reliable Tarantool cache

Wildberries is the most popular Russian online store. The company operates in 7 countries. Wildberries has been recognized as the largest Internet retailer in Russia for four consecutive years. Wildberries has over 30 million customers; 7 million visitors place 780,000 orders per day.

Tasks
and Requirements

In the mid-2010s, Wildberries was technically a .NET application with MS SQL servers. The monolithic backend and frontend had a performance limit, and this limit was slowly but surely approaching. As Wildberries entered the market of Belarus, the application's CPU usage never went below 90%. On Black Friday, there were three times more requests.

The technical team realized that the cost of MS SQL was becoming unacceptable with the increasing workload. They decided to break the monoliths into microservices. When choosing a solution, the team relied on the following requirements:

  • Reliable cache for critical systems
  • Reliability is more important than speed
  • Savings on hardware and licenses as compared to MS SQL
  • Willingness to sacrifice functional capacity (one doesn’t need feature-packed PostgreSQL for simple operations)
  • Data persistency
  • Automatic switching from one data center to another
  • Horizontal scaling

Solution

During the first stage, the developers ruled out any paid services because those costs exceeded the IT budget. That’s where Tarantool appeared. First, the team began transferring high-performance services that required many MS SQL database instances.

Today, the technical team of Wildberries has its own approach to creating reliable distributed systems. Tarantool is ideal for those systems as a universal storage for high-demand data: user profiles, banners, discounts, etc. In total, the company has twelve Tarantool-based microservices.

Solutions diagram
Solutions diagram
Solutions diagram
Solutions diagram
  • The most critical service of the Wildberries website is the User Profile Master Storage, which contains data of 50 million users. MS SQL was been completely discarded in this case.
  • The service that allows saving items for later is the company's most extensive Tarantool-based service. It takes about 120 GB of memory and has 3–4 copies in each data center.
  • In RPS terms, the highest-loaded services are the Promotizer and the User Profile Master Storage, receiving about 6,000 and 12,000 requests per second, respectively.
  • The warehouse system's quick reference materials, where some information can be rechecked, also run on Tarantool.

Here is how Tarantool operates. There are several master instances hosted on virtual or hardware machines in each data center. The connections follow the master-master pattern. Interfaces, or synchronizers, download information and write it onto the masters (e.g. information about discount coupons and their terms and conditions). Replicas hosted on virtual machines or in Kubernetes connect to these masters. On top of that, there are applications that access the replicas.

Each application works with two clusters. In case of a data center failure, an application can access the other cluster. There is a layer that stores the Tarantool Go driver interface and hides the logic. This layer sees all the replicas and can perform reads and writes on the master.

Results

  • 12
    microservices

    Tarantool is the main database for 12 microservices

  • User
    profiles

    The most critical service of the website is the master storage of profiles, which has all the data in Tarantool

  • 12,000
    rps

    12,000 RPS for the profile master storage

Other
success cases

How Yota Changed Architecture with Tarantool-Based Cache
Yota Logo
How Gazprombank speed up internal systems 50 times using the Tarantool
GPB Logo

Get
a consultation

Order
a demo

Thank you for your request

Tarantool experts will contact you shortly

Thanks
Thanks