CI/CD / Cloud Native / Development / DevOps / Monitoring

How Node.js Helped Fashion E-Tailer Net-a-Porter Handle Java-Crushing Sale Traffic

27 Apr 2017 6:00am, by

Yoox Net-a-Porter Group is one of the internet’s foremost fashion purveyors of high-end designer clothing and accessories. The company has a client base of more than 2.9 million high-spending customers, over 29 million monthly unique visitors worldwide and combined 2016 net revenues of over $2 billion.

Given the website’s high-dollar, mega-deluxe merch, traffic is typically steady — that is, until Net-a-Porter holds one of its epic twice-a-year clearance sales. The fashionistas come flocking and traffic surges by a double-digit order of magnitude… right up until the moment everything crashes. Which was pretty how things went for each mega-sale over the past ten years, resulting in lost sales and frustrated customers.

The solution would be to add infrastructure to handle the increased load, right? The site’s engineer’s thought otherwise. “Because of the nature of fashion, getting the bargain before anyone else, it’s like a six-hour insane uplift in otherwise stable traffic,” explained Robin Glen, principal developer for Yoox Net-a-Porter Group, in a recent interview. “Given that we have two main sales, in summer and winter, the traditional solution would give us all this redundant hardware sitting there doing nothing except for literally twelve hours each year.”

The company had started out as a Java shop, using the Spring model-view-controller (MVC) platform. “It was a platform that grew well as the company grew, but the major problem was it could never withstand sale traffic,” explained Glen. There were other less than awesome aspects to having a large, monolithic Java codebase, he added — like a six-week release cycle and no automated test cycle.

Net-a-Porter’s short, sharp traffic spikes were the perfect example of needing infrastructure for the moment, instead of the next ten years. (It’s a tech world trend — just look at the rise of DevOps and microservices). Seeking out-of-the-box ideas, the company formed a task group of engineers and gave them ten weeks to figure out a way to solve the problem — a way that didn’t involve adding physical machines to a data center.

The quest was complicated by the fact that the team didn’t really know how much traffic any new solution would actually need to handle. “Because we had never been able to withstand the traffic, we never actually knew what kind of traffic we could expect — we’d go an hour or two and the website would fall over,” said Glen. Ultimately, the team decided that moving sale traffic away from the website itself — handling their Big Sale traffic — would provide the most gain for the least effort and disruption.

Ultimately, Yoox Net-a-Porter decided Node.js was the solution to its semi-annual sale snafu.

“We looked at Node initially because all our sites are completely stateless, just a list of products,” said Glen. “At the time we also had an abundance of JavaScript developers and few available Java devs. It’s not that simple of a transition, you still need the talent, but the understanding of the syntax, that resource was there.”

Take the JavaScript Challenge

They assembled a small team with an aggressive deadline: 10 weeks to build a Node application, including DevOps deploying to AWS. Things went smoothly and, just before the site’s 2014 winter sale, Net-a-Porter’s IT team pushed the entire sale portion of operations to the new system… which worked exactly as planned.

“It was the first time the sale had not been gunned down in 10 years!” Glen exulted.

The entire transition was a great success, Glen said. Not just because it worked: also because the team took ownership. “Sometimes it’s harder to fix something than to start anew, with all those bad habits and ugly shortcuts wiped away,” he explained. “The devs took more care, invested more because they knew it was clean. The code was yours, without the baggage of reformatting — without the fear that anything you did could break other things.”

After that first taste of Node.js success, Yoox Net-a-Porter wanted more. “We had dipped our toes into breaking part of the website monolith into a microservice, and it was good,” said Glen.

The ultimate goal, Glen said, was building a continuous integration/continuous deployment (CI/CD) workflow. These days there are “a few bits of legacy Java” in the company’s stack but Glen reported that, “Overall, 90 to 95 percent of traffic is handled by Node.js.”

Function graph: This shows three functions written in three different ways ( the example is fizz buzz), within a Net-a-Porter internally created tool to benchmark functions. When Net-a-Porter implements a solution, it always performance tests the code.

Glen is particularly pleased with Node’s performance benchmarking in the CI pipeline: “All automation on our Node stack, that is quite rare.”

This server graph shows a pretend mock service being load tested using the same Net-a-Porter benchmarking tool, the graph again directly printed into terminal. Here you can see some code was introduced that increased the latency and in turn the concurrency went down. Net-a-Porter uses this graph in a pipeline to watch for performance regression.

The company’s goal was complete confidence in the code, to avoid introducing regression — all the while accelerating the production cycle. “Before we would test for weeks or months before release, now we have confidence that the changes we are making will have only the impact that we want,” he said. Previously based on a QA model, the shop now has test specialist engineers to help coach the dev team — but “we don’t have any QAs.”

Ultimately the company would like to get to the point of deploying “headless commerce,” or a bunch of back-end product APIs and data endpoints that can be consumed from any front end via Node, Glenn said.

The move to was changing not only on a technical level but also “a real culture shift for us as a company,” said Glen. Net-a-Porter went from “working with a big tech company, delivery streams with goals” to relying on their developers for responsive, practically real-time, platform iterations. This enables Net-a-Porter, as well as its sibling sites like Mr. Porter, to stay ahead in an extremely competitive market by breaking its front-end team into sub-teams, each focusing on a different micro-aspect of the entire customer experience from browsing to checkout.

“We can put our attention into client-side performance — changing browser paradigms, replicating native apps, and a rich user experience — because we have we have enough confidence in what we’ve done with Node, to trust that everything simply works.”

So, a company founded in 2000 on the specific premise that the new world of online retail could still deliver serious old-world luxury has found that the key to success is to offer a deluxe shopping experience with lavish, personalized and above all seamless service. This business model has made Yoox Net-a-Porter one of the leading players in global e-commerce. In that vein, giving your dev team the bandwidth to focus on the exact thing that makes your company so successful.

Sounds like Node.js is the height of fashion.

Feature image from Net-a-Porter’s Netset.

A newsletter digest of the week’s most important stories & analyses.

View / Add Comments

Please stay on topic and be respectful of others. Review our Terms of Use.