Optimizing an e-commerce site for Black Friday

Optimizing an e-commerce site for Black Friday

April 25, 2024

Of all our success stories, this is one of our favorites. It began when a client approached us because their e-commerce site was becoming a major drag on their business. They trusted us to come up with an ideal solution.

The client was a major international fashion brand, and its e-commerce site saw millions of sessions on regular days. But on the Black Friday before they reached out to us, they had a massive surge in visitors that virtually collapsed the website. Of around 20 million visits, seven million failed. The error rate surged above 30%, causing million-dollar losses in sales and the total saturation of the customer service call center. Unsurprisingly, the phone lines filled up with angry customers who couldn't take advantage of the deals or had other problems with their orders. Clearly, the company needed a better system, which is why they came to us. To prepare for the next Black Friday, we set the goal of ensuring their website could support 50 million simultaneous sessions while reducing the number of errors that could occur at the peak by 90%.

THE CHALLENGE

As soon as our team got down to business, we realized that the solution would involve rebuilding several key parts of the system. At the same time, the project came with the added challenge of ensuring that the system wouldn't fail, not even for a second, while we were updating the platform. The client's savvy young customers have little patience for stagnation or failures in the competitive retail market. In other words, we had to do all the work while making sure the system continued to run at full throttle.

THE SOLUTION

The work involved a major cleaning of the “dead code” from the legacy part of the system. By major, we mean cleaning dozens of millions of lines of code. In parallel, the team performed a bottleneck analysis to identify and remove what was blocking up the system and hunted down non-optimized systems, which included huge amounts of items without paging, CPU-intensive analytics processes that slowed down the system and giant elements that could be broken down into smaller parts. The result was spectacular, slashing load times by a factor of ten. In turn, this dramatically increased the conversion rate.

The team poured huge amounts of work into refactoring the old code, which was based on throwback technologies like Backbone and Jquery. Meanwhile, the team opted for a light and flexible stack based on JavaScript + LitElement for all the updating and everything that needed to be completely redone. Web Components was also used to boost modularity and allow for technology-agnostic encapsulation and the isolation of different components in a way that would prevent interference. That's because the site contains a lot of components that were developed ad-hoc for specific campaigns by multiple providers.

DEVELOPMENT WITH THE CLIENT

The work methodology was mixed. There were rapid and aggressive sprints using a Kanban intra-sprint that were adapted to the client's work style. A significant amount of reprioritization did occur, but with strict deadlines to ensure the added value was constant and visible. Likewise, a lot of joint work took place between our technical team and the business stakeholders when it came to making critical decisions that would fit with the business's future interests.

THE RESULTS

The results couldn't have been better. During the next Black Friday, the errors in client sessions plummetted even though the number of visits doubled. In total, there were around 40 million sessions and we reported just 4% frontend errors, which were much less severe than in the previous year. In fact, the call center didn't receive a single related complaint.

Thanks to all the hard work, the client eventually decided to add new functionalities to the e-commerce site including advanced analytics, A/B tests, and a very powerful QA system to help prevent new problems that could affect the company that is competing in fast and aggressive cycles. At the same time, the client implemented an automatic testing system that can detect any issues on the website before they become visible to users or affect the business in any way. Our team continues working with this client today to keep evolving and improving one of the most competitive clothing e-commerce websites in the world.