i tier dismantling the monolith
play

I-Tier: Dismantling the Monolith Brian McCallister - PowerPoint PPT Presentation

I-Tier: Dismantling the Monolith Brian McCallister brianm@groupon.com @brianm 2012 North America CDN nginx Backend Rails DB Service Backend DB MySQL Service Cluster CDN nginx Rails Backend DB Service Backend DB


  1. I-Tier: Dismantling the Monolith Brian McCallister � � brianm@groupon.com @brianm

  2. 2012 North America CDN nginx Backend Rails DB Service Backend DB MySQL Service Cluster

  3. CDN nginx Rails Backend DB Service Backend DB Service MySQL Cluster

  4. Mobile Transaction Mix (% of transactions) � Monthly, January 2011 to September 2013 100% 75% March ‘13 October ’12 50% April ’12 October ‘11 April ’11 June ‘13 25% January ‘13 July ’12 January ’12 July ’11 January ‘11 0% North America

  5. Web Mobile Rails API Backend DB Service MySQL Cluster Backend DB Service

  6. Web Mobile Web Mobile NA WebApp NA API EU WebApp EU API Backend Backend DB DB Service Service MySQL PostgreSQL Cluster Backend Backend DB DB Service Service

  7. Could not build features fast enough � Wanted to build features worldwide � Mobile and web lacked feature parity � Could not change look and feel!

  8. CDN nginx Backend DB Service Backend DB Service MySQL Cluster

  9. CDN nginx Backend DB Service Backend DB Service MySQL Cluster

  10. Web routing Subscribe Flow Rails API Config Backend Backend Service Service MySQL Cluster DB DB

  11. ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- CoffeeScript 10 88 251 203 make 1 12 18 25 Bourne Shell 1 1 2 5 Javascript 3 3 3 3 SASS 1 0 0 2 ------------------------------------------------------------------------------- SUM: 16 104 274 238 -------------------------------------------------------------------------------

  12. 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 � } � � # Add divisions to the page presenter � view.set { divisions: divisionsPresenter } � � render.pageHtml view, renderCallback

  13. Within two hours we had a major site outage

  14. Web grout Subscribe Browse Page Page Rails API Config Backend Backend Service Service MySQL Cluster DB DB

  15. Web grout Subscribe Browse Page Page Rails API Config Backend Backend Service Service MySQL Cluster DB DB

  16. Web grout Subscribe Browse Page Page Rails API Config Backend Backend Service Service MySQL Cluster DB DB

  17. (cc) Newfrontiers http://flic.kr/p/9u346u

  18. Web grout Subscribe Browse Deal Page Page Page Layout Config Rails API Backend Backend Service Service MySQL Cluster DB DB

  19. Web grout Subscribe Browse Deal Another More Yep Lots Page Page Page Page Page Page Page Layout Config Rails API Backend Backend Service Service MySQL Cluster DB DB

  20. Web grout Subscribe Browse Deal Page Page Page Layout Config Rails API Backend Backend Service Service MySQL Cluster DB DB

  21. GET /layout/v3.8/gig_application_layout HTTP/1.1 Accept: */* Accept-Encoding: gzip, deflate, compress Host: uat.groupon.com User-Agent: HTTPie/0.7.2 � � HTTP/1.1 200 OK Cache-Control: public, max-age=1800 Content-Encoding: gzip Content-Type: application/json; charset=utf-8 Date: Sun, 02 Mar 2014 18:31:01 GMT Transfer-Encoding: chunked � { "templateName": “remote_gig_application_layout_main@v3_8”, "html": "<!DOCTYPE html>\n<!-- : gig_application_layout@v3.8.3 -- >\n<!--[if lt IE 7]> <html class=\"lt-ie10 lt-ie9 lt-ie8 lt- ie7\"{{#htmlAttr}} {{{htmlAttr}}}{{/htmlAttr}}> <![endif]-->\n<!--[if IE 7]> <html class=\"lt-ie10 lt-ie9 lt-ie8\"{{#htmlAttr}} {{{htmlAttr}}}{{/htmlAttr}}> <![endif]-->\n<!--[if IE 8]> <html class=\"lt-ie10 lt-ie9\"{{#htmlAttr}} {{{htmlAttr}}}{{/htmlAttr}}> <! [endif]-->\n<!--[if IE 9]> <html class=\"lt-ie10\"{{#htmlAttr}} {{{htmlAttr}}}{{/htmlAttr}}> <![endif]-->\n<!--[if gt IE 9]><!--> <html class=\"\"{{#htmlAttr}} {{{htmlAttr}}}{{/htmlAttr}}> "data": { … } }

  22. Finish It! ~2 months ~150 Developers

  23. Forward Looking Statements A Tale of Two Monoliths

  24. Web Mobile Rails API Backend DB Service MySQL Cluster Backend DB Service

  25. Web Mobile Web Mobile NA WebApp NA API EU WebApp EU API Backend Backend DB DB Service Service MySQL PostgreSQL Cluster Backend Backend DB DB Service Service

  26. Web Mobile Europe EU WebApp EU API Backend DB Service PostgreSQL Backend DB Service Web grout Subscribe Browse Deal Another More Yep Lots Page Page Page Page Page Page Page Layout Config Rails API Backend Backend North America Service Service MySQL Cluster DB DB

  27. API Proxy /users/{user-id}/giftcodes Global API /deals/{deal-id}/breakdowns.json /users/{user-id}/shipping_addresses /users/{user-id}/billing_records /deals/{deal-id} /users/{user-id}/orders/{order-id} Legacy API … … …

  28. API Proxy Global API /users/{user-id}/giftcodes /deals/{deal-id}/breakdowns.json Customer /users/{user-id}/shipping_addresses Facing Service /users/{user-id}/billing_records /deals/{deal-id} /users/{user-id}/orders/{order-id} … … Legacy API …

  29. Web grout Subscribe Browse Deal Another More Yep Lots Page Page Page Page Page Page Page Layout Config EU Webapp EU API Backend Backend Service Service PostgreSQL DB DB

  30. Thank You! Brian McCallister � � brianm@groupon.com @brianm

Recommend


More recommend