UPDATED 14:28 EDT / NOVEMBER 11 2013

NEWS

How Groupon web traffic moves from legacy Ruby on Rails to Node.js

It is well known that Node.js can run locally on Windows and Linux. It interacts with a browser and you can create applications in JavaScript, running locally or remotely and use that with HTML 5 and Canvas interfaces. Node.js tool for webmasters who want a full control over what happens on the remote server, or have some kind of local server for applications operating simultaneously and sharing data.

With the V8 JIT compiler, it can interpret scripts in JavaScript and is protocol-independent, can use HTTP to serve HTML pages or other protocols for other types of applications.

With all these advantages, a number of companies migrated their websites to node.js stack with substantial results. A recent example is Groupon, which recently completed a year-long project to migrate from Ruby on Rail to node.js stack.

Groupon transition to node.js

The daily deals at restaurants, retailers and service provider company entire U.S. web front-end has been running on Rails from its inception. The Chicago-based company since then growing rapidly and its recent third quarter increased 10 percent to $1.34 billion.

Groupon decided to re-architect the entire front-end to small pieces, which can be manageable, expandable and independent from each other. Before replacing the entire front end, Groupon engineering team faced some challenges.

When Rails was introduced for the company’s front end, Groupon was a small company and small number of developers got the site up and running. The advantage of Rails is that it is easy to add new features. All the Rails application were pointing to a single database cluster. The company later added more frontend servers and database replicas and put everything behind a CDN, but the processing orders resulted in a performance issue due to number of database writes.

The large user base made it difficult for the company to expand or introduce new features. At the same time, Groupon also maintain healthy growth in mobile with half of the users accessing the site from mobile phones. Over a short period, the company introduces 48 operations in different countries. In addition, it has acquired a number of other companies such as CityDeal.

The engineering team decided to build a single platform to cater web and mobile users and build an API layer on top of each of backend software platforms with mobile clients connected to whichever API endpoint matched the user’s country.

As a solution to this gigantic monolith, Groupon rebuilt each major section of the website as an independent Node.js application. The solution was perfect because node.js takes HTTP request that flows in large amounts, the API requests processed in parallel, and rendering the results into HTML is easier.

On top of node.js, the team built the Groupon routing service as an nginx module that allows to conduct A/B tests between different implementations of the same app on different servers. The team also built separate services for sharing layouts and style, maintaining shared configuration and managing A/B test treatments.

The new node.js architecture migration resulted in significantly faster web site access and page loads. Groupon says page loads are now faster by 50%. Dependencies between teams are now reduced and development team can now able to deploy changes to their applications independently. In addition, Groupon eliminated redundant implementations of the same features in different countries and they are able to make site-wide feature and design changes much more quickly.

After migration, Groupon will become the world’s largest Node.js deployment products. Groupon engineering team said after the migration, the overall response time is significantly reduced. In the next few months, Groupon will gradually release a new Node.js platform used to enhance a variety of libraries.


A message from John Furrier, co-founder of SiliconANGLE:

Your vote of support is important to us and it helps us keep the content FREE.

One click below supports our mission to provide free, deep, and relevant content.  

Join our community on YouTube

Join the community that includes more than 15,000 #CubeAlumni experts, including Amazon.com CEO Andy Jassy, Dell Technologies founder and CEO Michael Dell, Intel CEO Pat Gelsinger, and many more luminaries and experts.

“TheCUBE is an important partner to the industry. You guys really are a part of our events and we really appreciate you coming and I know people appreciate the content you create as well” – Andy Jassy

THANK YOU