• Like
  • Save
Asynchronous Personalization at Groupon - JSConf 2011
Upcoming SlideShare
Loading in...5
×
 

Asynchronous Personalization at Groupon - JSConf 2011

on

  • 2,435 views

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

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

Statistics

Views

Total Views
2,435
Views on SlideShare
2,392
Embed Views
43

Actions

Likes
1
Downloads
28
Comments
0

1 Embed 43

http://lanyrd.com 43

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Asynchronous Personalization at Groupon - JSConf 2011 Asynchronous Personalization at Groupon - JSConf 2011 Presentation Transcript

    • asynchronous personalization [and CDNs and A/B testing and stuff] Jon Pliske Performance Engineering, Groupon @jonpliske jpliske@groupon.com
    • You might know me from this leaked photo on TechCrunch Jon PliskePerformance Engineering, Groupon @jonpliske jpliske@groupon.com
    • overview background CDN caching async personalization a/b/multivariate testing /w finch.js
    • 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
    • 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
    • pics or it didnt happen
    • pics or it didnt happen
    • 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
    • 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
    • obligatory omnigraffle diagram
    • "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!
    • 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!
    • [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 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 }});
    • 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
    • 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
    • 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);});
    • 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?)
    • the futurepure-JSON API requestsclient-side rendering (/w mustache.js)HTML5 storagedecouple from Railsdevelopment practices:front/back-end integrationbetter testingbetter monitoring
    • Thank you! @jonpliskejpliske@groupon.comgroupon.com/techjobs