AnnouncementIntroducing MongoDB 8.0, the fastest MongoDB ever! Read more >>

L’Oréal Improves App Performance and Velocity with MongoDB Atlas

A diverse group of individuals is gathered and discussing.

INDUSTRY

Manufacturing/Retail (cosmetics)

PRODUCT

MongoDB Atlas

USE CASE

Artificial Intelligence

CUSTOMER SINCE

2022
INTRODUCTION

The world leader in beauty, championing the ‘Beauty Tech’

L’Oréal is the world leader in beauty — the sole focus of their expertise and passion for the past 115 years. In 2018, L’Oréal transitioned into a new era, introducing the term ‘Beauty Tech’, seizing the potential of new technologies.

With unprecedented speed and scale, tech has revolutionized lives and social interactions, opening new business opportunities to seize. To face this new paradigm, L’Oréal pioneered Beauty Tech, championing personalized, inclusive, and responsible beauty at scale with the motto: “Beauty for Each, powered by Beauty Tech.” Beauty Tech and Digital encompass all the augmented products and beauty devices, augmented marketing, online and offline services and digital platforms, powered by tech/IT, data and artificial intelligence. The company is committed to creating innovative solutions that both enhance beauty experiences and contribute to a future where beauty is inclusive, sustainable, and caters to the diverse needs and preferences of all individuals worldwide.

Skin Screen image by Lancôme

Skin Screen by Lancôme © L'Oréal Groupe 1

Tech Accelerator is an internal department dedicated to catalyzing digital innovation at L’Oréal. It has two divisions: Services and Solutions. Services create products for retailers and consumers. ModiFace is part of the Services division, for example. It’s the world-leader in the field of virtual try on (VTO) and gives customers the power to try on hundreds of new looks in minutes using virtual reality.

The Solutions division designs products to help L’Oréal staff be more efficient and productive. For example, it has created an AI-powered tool to make it easier to remove certain ingredients from formulas without changing the effectiveness, texture, or smell of the product.

“Our applications need to be fast, high performing, and able to process huge volumes of data seamlessly,” explained Moutia Khatiri, Tech Accelerator’s CTO. “That’s challenging to achieve, and MongoDB Atlas was the perfect database platform for the job.”

THE CHALLENGE

Complex calculations on vast volumes of data—without causing latency

One of the internal solutions needed to connect to multiple sources of data and look for correlations to advise staff on how to make more efficient business decisions. This involves storing large volumes of data while conducting real-time calculations and analytics.

“Users run simulations to forecast the outcomes of different business decisions, for example,” said Moutia. “These are complex calculations that need to retrieve and restructure large amounts of data from our data warehouse. The entire process can take 20 to 25 clicks, so if there was five second latency per click it would become unworkable.”

This solution was built on top of another NoSQL database to support the app, but it wasn’t powerful enough to handle the level of data required for calculations. It also had limited out-of-the-box functionalities, which made the performance and implementation agility very limited.

“The database wasn’t designed for calculations, so we had to do a lot of code-based calculations in the backend,” explained Mia Nasr Khneisser, Lead Full-Stack Developer, Tech Accelerator. “We ended up doing calculations through scripts instead of directly in the database and needed to add JavaScript code for even simple queries.”

This approach was unsustainable and unscalable. As the application generated more data and broadened in scope, performance continued to suffer.

“Performance is the most visible issue for users. They don’t care what’s causing it, they just want their apps to work,” added Mia. “Our database wasn’t suitable for high velocity iterations, so we needed to replace it quickly.”

“MongoDB Atlas doesn’t just solve our performance issues. It makes life easier for web developers who can build and maintain simpler, more straightforward code.”

Moutia Khatiri, CTO, Tech Accelerator, L’Oréal

THE SOLUTION

Simplifying management and maintenance while boosting performance

The Solutions team ran a proof of concept with MongoDB Atlas on Google Cloud. As Moutia revealed, “We knew MongoDB Atlas was the right solution because it’s a document-oriented database designed to support large scale projects with complex data structures while delivering high performance. We also already had the in-house skills to manage it.”

During the proof of concept, MongoDB Atlas latencies were almost 40 times better, and the backend code became easier to maintain, more scalable, and more efficient. The team also liked MongoDB Atlas features such as index autocreation, and the aggregation simulator.

“Data manipulation and operations are much simpler and easier to manage with MongoDB,” added Mia. “We can test things before we implement them, and if we find a bug we can just disable or hide parts of the aggregation. Previously we had to read the code from start to finish to understand which process the bug disrupted.”

Tech Accelerator needed to migrate the app to MongoDB without disrupting the user experience or causing performance issues. The team started by adding integration tests to make sure that migrating to MongoDB was not generating regressions in the application.

Next, they created MongoDB models with the same properties that they had on the existing database. With these models in place, they created migration scripts to pass the data from the existing database to MongoDB. With everything set up, they started refactoring the code by modifying the controllers and services, adding aggregations to adapt to MongoDB models while making sure that the integration tests are always successful.

“MongoDB Atlas is a versatile and powerful NoSQL database. It’s well suited for applications that require flexibility and scalability. Moving to MongoDB was like switching from a family car to a Ferrari, it’s the right solution to help us innovate at speed.”

Mia Nasr Khneisser, Lead Full-Stack Developer, Tech Accelerator, L’Oréal

THE RESULTS

Reducing latency from seconds to just 10 milliseconds

User experience did improve a lot, the application is highly available, and it takes just a few milliseconds per step through the user journey.

And app users aren’t the only team benefitting from the migration, as Moutia explained, “MongoDB Atlas doesn’t just solve our performance issues It makes life easier for web developers who can build and maintain simpler, more straightforward code.”

In fact, MongoDB Atlas simplifies the entire application architecture, which previously had a very complex data access layer that was difficult and time-consuming to implement and maintain. This is good news for the backend team who have less to manage, and for the DevOps team, since MongoDB aligns perfectly with their infrastructure-as-a-code stack.

“We have a hyper agile DevOps model and want to release as many times as possible per month. With MongoDB we’re not going back to the drawing board every time. We can quickly find and resolve issues with code and the modules can be shared with other product teams to help them accelerate” said Moutia.

Tech Accelerator was set up to get new products and solutions to market quickly. As the application grows more complex over time and handles increasing volumes of data, MongoDB Atlas will scale with it. And where adding new features might have taken days previously, it will now take a couple of hours.

“MongoDB Atlas is a versatile and powerful NoSQL database. It’s well suited for applications that require flexibility and scalability,” concluded Mia.

Learn how to build modern customer experiences with MongoDB for retail.

What will your story be?

MongoDB will help you find the best solution.