i-tier: breaking up the monolith @ philly ete
DESCRIPTION
Groupon recently completed a year-long project to migrate its U.S. web traffic from a monolithic Ruby on Rails application to a new multi-application stack with substantial results. Groupon’s entire U.S. web frontend had been a single Rails codebase from its inception in 2008. The frontend codebase quickly grew large, which made it difficult to maintain and challenging to ship new features. As a solution to this gigantic monolith, we decided to re-architect the frontend by splitting it into small, independent and more manageable pieces. At the center of this project, we rebuilt each major section of the website as an independent application. We also rebuilt the infrastructure to make all the independent apps work together. Interaction Tier (I-Tier) was the result. Learn about how Groupon achieved this great architecture migration and the business results it is driving.TRANSCRIPT
![Page 1: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/1.jpg)
i-tier: breaking up the monolith
sean mccullough
groupon engineering
@mcculloughsean
![Page 2: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/2.jpg)
this presentation is about
4 how Groupon's software stopped working
4 how we rewrote a part of it
4 what went well and what didn't
![Page 3: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/3.jpg)
this presentation isn't about
4 node.js
4 javascript
![Page 4: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/4.jpg)
Problems
![Page 5: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/5.jpg)
simple start
4 monolithic Ruby on Rails app
4 sustained business through hypergrowth
4 small engineering team
4 simple product
![Page 6: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/6.jpg)
acquisitions
4 CityDeal.de (Germany, most of EU)
4 SoSata (India)
4 Needish (South America)
ran as separate platforms
![Page 7: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/7.jpg)
new products
4 Goods
4 Getaways
4 Reserve
![Page 8: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/8.jpg)
improvements
4 Smart Deals
4 Browse and Search
4 Rocketman
![Page 9: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/9.jpg)
one monolithic application
![Page 10: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/10.jpg)
actually, two separate monoliths
![Page 11: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/11.jpg)
move to mobile
4 ~50% of global transactions
4 streamlined user experience
4 mobile uses REST API
![Page 12: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/12.jpg)
two facets of the same monolith
![Page 13: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/13.jpg)
two facets X two monoliths
![Page 14: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/14.jpg)
business was stuck
4 could not build features fast enough
4 wanted to build features worldwide
4 mobile and web lacked feature parity
4 could not change look and feel
![Page 15: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/15.jpg)
The Plan
![Page 16: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/16.jpg)
start with the frontend
4 unify global look and feel
4 REST API already built for mobile
4 backend services are more complicated to unite
![Page 17: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/17.jpg)
design goals
4 decouple teams
4 deploy apps on team schedule
4 allow for global design changes
4 I18n/L13n
4 be small, do the minimum
![Page 18: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/18.jpg)
![Page 19: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/19.jpg)
![Page 20: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/20.jpg)
bakeoff
4 Node
4 MRI Ruby/Rails, MRI Ruby/Sinatra
4 JRuby/Rails, Sinatra
4 MRI Ruby + Sinatra+EM
4 Java/Play, Java/Vertx
4 Python+Twisted
4 PHP
![Page 21: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/21.jpg)
why node
4 vibrant community
4 NPM!
4 frontend developers know javascript
4 performant enough
4 easy scaling (process model)
![Page 22: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/22.jpg)
![Page 23: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/23.jpg)
simple design
main: ( {attributes, renderCallback} ) -> # Presenter that sets the layout view = presenters.page 'subscribe', attributes
# Grab the list of all the divisions grouponAPI.fetch { endpoint: 'divisions' }, (err, {divisions}, details) ->
# If there’s an error, bail and pass the error along return renderCallback err if err?
divisionsPresenter = presenters.divisions divisions, { currentDivision: attributes.query?.division_p }
view.set { divisions: divisionsPresenter }
render.pageHtml view, renderCallback
![Page 24: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/24.jpg)
boundaries
4 apps only talk to api and memcached
4 layout is in a separate application
4 shared common asset bundle
![Page 25: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/25.jpg)
growing pains
4 max sockets
4 breaking our infrastructure
![Page 26: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/26.jpg)
![Page 27: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/27.jpg)
subscribe page
4 simple application
4 partial implementation
4 proved out the concept
![Page 28: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/28.jpg)
![Page 29: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/29.jpg)
new problems
4 user authentication
4 more service calls
4 complicated routing
4 more traffic
4 share look and feel
![Page 30: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/30.jpg)
Part III - Architecture
![Page 31: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/31.jpg)
![Page 32: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/32.jpg)
![Page 33: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/33.jpg)
grout
switchboard for incoming requests to I-Tier applications
![Page 34: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/34.jpg)
grout
Route on:
4 domain
4 locale
4 country
4 experiments
![Page 35: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/35.jpg)
grout
4 groupon.com/deals/my-awesome-deal
4 itier-deal-page-vip.snc1/deals/my-awesome-deal
4 groupon.de/browse/berlin
4 itier-browse-page-vip.lup1/browse/berlin
![Page 36: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/36.jpg)
grout
4 experiments between different applications on the same URL
4 testing between alternative implementations (including the legacy monoliths!)
![Page 37: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/37.jpg)
![Page 38: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/38.jpg)
![Page 39: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/39.jpg)
gconfig
configuration as a service
some config can change on the fly
config can be promoted from uat -> staging -> prod
![Page 40: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/40.jpg)
![Page 41: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/41.jpg)
layout service
maintain consistent look and feel across site
![Page 42: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/42.jpg)
layout service options
4 distribute layout as library
4 use ESIs for top/bottom of page
4 apps are called through a “chrome service”
4 fetch templates from service
![Page 43: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/43.jpg)
layout service
chose a service
4 independent rollouts
4 changes can be shipped without redploying all apps
4 easy to use in development
![Page 44: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/44.jpg)
layout service
4 Uses semantic versioning
4 Roll forward with bug fixes
4 Stay locked on a specific version
4 Enable Site-Wide Experiments
![Page 45: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/45.jpg)
![Page 46: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/46.jpg)
![Page 47: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/47.jpg)
Rewrite All The Things!
![Page 48: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/48.jpg)
rewrite
4 get the whole company to move at once
4 upporting two platforms is hard
4 as of June 2012 - move to I-Tier by September 1st
![Page 49: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/49.jpg)
rewrite
4 ~150 developers
4 global effort
4 feature freeze – A/B testing against mostly the same features
![Page 50: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/50.jpg)
it worked!
![Page 51: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/51.jpg)
webpages got faster
![Page 52: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/52.jpg)
sustained record traffic
![Page 53: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/53.jpg)
![Page 54: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/54.jpg)
what doesn't work
4 increased testing burden
4 tooling needs to catch up
4 increased operational overhead
![Page 55: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/55.jpg)
culture problems
4 changed team workflow
4 teams are silos
4 code quality varies
![Page 56: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/56.jpg)
next steps
4 streaming responses for better performance
4 better resiliency to outages
4 distributed tracing
4 international (launching today!)
4 open source - testium
![Page 57: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/57.jpg)
tl;dr
4 monolith
4 federated frontend
4 service oriented architecture
4 grout
4 gconfig
4 layout service
![Page 58: I-Tier: Breaking Up the Monolith @ Philly ETE](https://reader033.vdocument.in/reader033/viewer/2022060107/554a43eab4c90582328b53ec/html5/thumbnails/58.jpg)
thanks!sean mccullough
groupon engineering
@mcculloughsean