asynchronous personalization   [and CDNs and A/B testing and stuff]               Jon Pliske    Performance Engineering, G...
You might know me from this leaked photo on TechCrunch           Jon PliskePerformance Engineering, Groupon               ...
overview background CDN caching async personalization a/b/multivariate testing /w finch.js
performance anxiety big rails app                 performance issues big team          ===         development process hur...
super bowl partyprelude:jan 1. "btw we have pre/post super bowl commercials"jan 15. "scored an in-game spot, we good?"feb ...
pics or it didnt happen
pics or it didnt happen
CDNs are neatpros                           conslow latency                    dynamic content"edge side nodes"           ...
async personalizationtarget: deal/division pages (> 50% of traffic)approach:1. cache "anonymous" page in CDN2. hide stuff3...
obligatory omnigraffle diagram
"Anonymous" userbefore:initial page response time: 0.8 secrendering time (e.g. loading css/js/images): 1 sectotal: 1.8 sec...
Logged-in User / Subscriberbefore:initial page response time: 3 secrendering time (e.g. loading js/css/images): 1 sectotal...
[wait for applause]
development implicationsless Rails, more JS1 user !== 1 (Rails) requestgoodbye:current_usersessioncookiestesting
onCurrentUserReady(callback)callback when personalize API returns (or callback immediatelyfor anonymous user)before:- if l...
analyticsProblem: Request loggingSolution: Tracking pixel (hit Nginx only, not Rails)Problem: Content changesSolution: Dyn...
a/b testing with FinchProblem: Finch uses view/controller logic to choose and trackexperiments and variants- experiment Tw...
Finch.jsFinch.Experiments.DelayedJSExperiment = {  defer: function() {    var experiment = this;    FinchDemo.onCurrentUse...
Finch.js based on Googles "Overlapping Experiment Infrastructure" written in coffee-script open source soon-ishly ~ 15k of...
the futurepure-JSON API requestsclient-side rendering (/w mustache.js)HTML5 storagedecouple from Railsdevelopment practice...
Thank you!      @jonpliskejpliske@groupon.comgroupon.com/techjobs
Asynchronous Personalization at Groupon - JSConf 2011
Asynchronous Personalization at Groupon - JSConf 2011
Upcoming SlideShare
Loading in...5
×

Asynchronous Personalization at Groupon - JSConf 2011

2,354

Published on

Slides from my talk at JSConf 2011. Covers the usage of asynchronous personalization, CDNs, and A/B testing with Finch.js at Groupon.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,354
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
31
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Asynchronous Personalization at Groupon - JSConf 2011

  1. 1. asynchronous personalization [and CDNs and A/B testing and stuff] Jon Pliske Performance Engineering, Groupon @jonpliske jpliske@groupon.com
  2. 2. You might know me from this leaked photo on TechCrunch Jon PliskePerformance Engineering, Groupon @jonpliske jpliske@groupon.com
  3. 3. overview background CDN caching async personalization a/b/multivariate testing /w finch.js
  4. 4. performance anxiety big rails app performance issues big team === development process hurdles big traffic drinking problems Reaching limit of Rails caching Low-level optimizations too "incremental" Rewriting SQL is boring Improve platform architecture
  5. 5. super bowl partyprelude:jan 1. "btw we have pre/post super bowl commercials"jan 15. "scored an in-game spot, we good?"feb 15. offend the world"spike mode": CDN cache it all! disable login offload geocoding/subscriptions/orders to EC2 limited functionality === unhappy users
  6. 6. pics or it didnt happen
  7. 7. pics or it didnt happen
  8. 8. CDNs are neatpros conslow latency dynamic content"edge side nodes" personalizationhigh capacity complexitystatic content overkill? specifically: personalized content (login menu, deals) analytics tracking a/b testing Rails developers
  9. 9. async personalizationtarget: deal/division pages (> 50% of traffic)approach:1. cache "anonymous" page in CDN2. hide stuff3. make AJAX request for personalized data/content4. show stuffSee Chris Williams "Rails’ Best Caching Method is JavaScript"from GoRuCo 2010
  10. 10. obligatory omnigraffle diagram
  11. 11. "Anonymous" userbefore:initial page response time: 0.8 secrendering time (e.g. loading css/js/images): 1 sectotal: 1.8 secafter:initial page response time: 0.1 secrendering time: 1 sectotal: 1.1 seconly a little bit faster...(1.1 vs 1.8 sec)basically no server load => huge capacity increase!
  12. 12. Logged-in User / Subscriberbefore:initial page response time: 3 secrendering time (e.g. loading js/css/images): 1 sectotal time: 4 secafter:initial page response time: 0.1 secrendering time (include AJAX call:1 sec): 1 sectotal time: 1.1 secCapacity constant: AJAX call still needs to hit Rails300% faster!
  13. 13. [wait for applause]
  14. 14. development implicationsless Rails, more JS1 user !== 1 (Rails) requestgoodbye:current_usersessioncookiestesting
  15. 15. onCurrentUserReady(callback)callback when personalize API returns (or callback immediatelyfor anonymous user)before:- if logged_in? do stuff for logged-in user- else do stuff for anonymous userafter:Groupon.onCurrentUserReady(function(){ if (Groupon.currentUser.isAuthenticated) { do stuff for logged-in user } else { do stuff for anonymous user }});
  16. 16. analyticsProblem: Request loggingSolution: Tracking pixel (hit Nginx only, not Rails)Problem: Content changesSolution: Dynamic tracking pixelProblem: Tracking params (e.g. utm params, affiliate id, etc...)Solution: Store in cookie; append params to API request
  17. 17. a/b testing with FinchProblem: Finch uses view/controller logic to choose and trackexperiments and variants- experiment Two vs. Three Step Subscription do |e| - e.variant Original do %h1 Fill out this form to subscribe now - e.variant Two Step do %h4 Follow these two steps to subscribe - e.variant Three Step do %p Subscribe now - it only takes a few seconds
  18. 18. Finch.jsFinch.Experiments.DelayedJSExperiment = { defer: function() { var experiment = this; FinchDemo.onCurrentUserReady(function() { experiment.deferedRun(this); }); }, before: function() { $(#delayed).hide(); }, after: function() { $(#delayed).show(); }, variants: { original: function() { $(#delayed .original).show(); }, alternate: function() { $(#delayed .alternate).show();}, }};$(function() { Finch.run(window);});
  19. 19. Finch.js based on Googles "Overlapping Experiment Infrastructure" written in coffee-script open source soon-ishly ~ 15k of JS doesnt handle tracking/analytics/analysis side of testing (yet?)
  20. 20. the futurepure-JSON API requestsclient-side rendering (/w mustache.js)HTML5 storagedecouple from Railsdevelopment practices:front/back-end integrationbetter testingbetter monitoring
  21. 21. Thank you! @jonpliskejpliske@groupon.comgroupon.com/techjobs
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×