Accessible sport territory

Decathlon is a French sporting goods retailer. Its first store appeared in Russia in 2006 and, as of today, the retailer has 58 outlets in 28 Russian cities, including 16 in Moscow and the Moscow region. Since its foundation, the company has followed the motto «Make sport accessible to the many». The majority of goods sold are their own products, created in Decathlon labs in France. The company’s objective is to develop new digital opportunities and create easy-to-use tools for customers who are becoming more and more mobile, are used to using interactive services, and buying products and services online.

Technology for a new platform

The first step in the development of Decathlon Russia as a global sports platform was to launch the All Do Yoga fitness search service. The fitness aggregator and online platform for the sports community fulfilled the ideas of the Decathlon team to create a new service for the company’s customers. Platform users can now find classes, share reviews and achievements, and buy sporting goods online. All Do Yoga detects a person’s location and shows the nearest fitness studios, offers exercise equipment, and lets you immediately purchase whatever you need. The service can be accessed from the website and mobile app.

To implement such a large-scale project, it was important for the team to focus on functionality, while being confident in the reliability of technology and compliance with the requirements for using customers' personal data. To build and launch All Do Yoga, we chose Yandex Cloud, which provided the infrastructure that met the requirements for storing and processing personal data.
From a technical point of view, the project had several objectives:

  • Deploy and manage the entire infrastructure, including development, staging, and production, using the Infrastructure as Code concept. We chose Terraform as the main tool for this.
  • Ensure high availability of the geo-distributed production environment.
  • Be able to quickly scale the load without additional capital expenditures.
  • Minimize maintenance for databases (PostgreSQL, MongoDB, Redis) and Kubernetes application clusters.
  • Ensure compliance with Federal Law No. FZ-152 «On personal data».
As of December 2019, more than 6.5 thousand classes have been available in the All Do Yoga service.

Configuration description via Terraform and load testing

Decathlon Russia started developing the service in 2018. In 2019, the company transferred the development and staging environments to various cloud platforms in Russia and Europe. In June 2019, it carried out migration to Yandex Cloud and launched the production environment. The project was implemented jointly by the Decathlon IT department team and a group of professional service engineers from Yandex Cloud.

The hardest part about the project was that there’re multiple environments (development, staging, and production) in different folders and networks and require access segregation at both the network and cloud level. The infrastructure logic is dictated by the security requirements, which differentiate logical and network access to Decathlon projects.

The development and staging environments are identical to the production environment in terms of services, but reside in the same availability zone. The production environment is distributed across three availability zones. The network load is balanced by Yandex Application Load Balancer. The stack includes:

  • Yandex Object Storage
  • Yandex Container Registry
  • Yandex Load Balancer
  • The Traefik Layer 7 load balancer built on Yandex Compute Cloud
  • A Kubernetes cluster running on Yandex Compute Cloud
  • Managed Service for PostgreSQL
  • Managed Service for MongoDB
  • Managed Service for Redis

When migrating to Yandex Cloud, the infrastructure configuration was described using Terraform. This tool is compatible with Yandex Cloud (to evaluate its usability, see Getting started with Terraform). Different projects were described in different repositories using Terraform and Object Storage.

Before the launch, we performed load testing using Load Testing Tool, our open-source tool (its image is available to anyone on Yandex Cloud Marketplace). Load Testing Tool identified the bottlenecks, which helped ensure the service didn’t fail under the load when launching it. Using Overload, a free service from Yandex, we were able to quickly share the results of Load Testing Tool tests in an easy-to-read format.

The Kubernetes clusters were deployed independently, on top of Yandex Compute Cloud. The Decathlon use case added permanent improvements to the Yandex Managed Service for Kubernetes network stack. They were rolled out in the public version on October 1, 2019, at the Scale Conference.

Ready for new exercises

As a result of the migration, all the objectives we set were met:

  • All environments (development, staging, and production) operate in Yandex Cloud.
  • The high availability of the production environment is ensured and the load can be scaled out with no additional capital expenditures.
  • PostgreSQL database and Kubernetes cluster maintenance happens on the Yandex Cloud side.
  • All data is processed and stored in accordance with the requirements of Russian law.

Yandex Cloud services guarantee website performance under ever-increasing workloads. This way, Decathlon can boost traffic to the All Do Yoga website dozens of times over without a drop in speed.

The next step is to increase the number of sports and launch the All Do Sport service to combine thousands of fitness studios, coaches, and sports fans, instead of just hundreds.

For Yandex Cloud, the migration of Decathlon was another successful test of whether the platform was ready to work with complex architectures and deal with challenges faced by major companies.