Groupon抛弃Rails,转向Node.js


发布者 ourjs  发布时间 1381454077000
关键字 技术前沿 

知名团购网站Groupon近日在官网宣布目前Groupon已经完成了从Ruby on Rails向Node.js的迁移过程,这一过程历时1年之久。迁移后,Groupon将成为全球最大的Node.js部署产品之一。

Groupon工程师团队表示,迁移后,整体响应时间继续减少。Groupon会在接下来的几个月中,逐步发布驱动其Node.js平台的相关库。

Twitter在2008年将其业务后端代码从Rails迁移到了Scala,而Groupon如今也抛弃了Rails架构,其原因大致相同——在大型系统的可扩展性和性能上,Rails显得捉襟见肘

在过去一年半的时间中,Groupon的后端服务已经全面过渡到了SOA(面向服务架构),并且在前端也应用了这这种模式。这样,每个团队可以只 拥有他们所负责的服务页面或应用,而不是有一个大型的应用程序,共享的逻辑已经被移到了服务和库中,以便团队只需专注于构建自己所负责的功能。

 


 

Geekon: I-Tier
Today is exciting: we’ve completed a year-long project to move Groupon’s web traffic from our legacy Ruby on Rails application to Node.js. We’ve been working hard on this transition and have learned a lot along the way. Groupon will be one of the largest production deploys of Node.js worldwide. We’re currently serving ~50,000rpm and our overall response times have dropped dramatically. Over the next few months we’ll be releasing the libraries we used to power our new Node.js platform and we will be blogging stories about this intense transition.

Some history: Groupon started as a monolithic Ruby on Rails app. Over the last year and a half we’ve been transitioning to a service oriented architecture (SOA) for all of our back-end services. We applied the SOA design pattern to our front-end as well. Instead of having one large web application each internal team can own their own application that only serves the pages for which that team is responsible. Shared logic has moved into services and libraries so teams only need to focus on building the features that their teams own. Groupon is doing cutting edge work in mobile, with nearly 50% of our North American transactions completed on a mobile device in June. Our mobile applications use a JSON API, and our web applications now use the same API, allowing us to focus on maintaining a single contract for all of our consumer web data.