SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
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 Pliske
Performance 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 party
prelude:
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 didn't happen
pics or it didn't happen
CDNs are neat
pros                           cons
low latency                    dynamic content
"edge side nodes"              personalization
high capacity                  complexity
static content                 overkill?


        specifically:
        personalized content (login menu, deals)
        analytics tracking
        a/b testing
        Rails developers
async personalization
target: deal/division pages (> 50% of traffic)

approach:
1. cache "anonymous" page in CDN
2. hide stuff
3. make AJAX request for personalized data/content
4. show stuff


See Chris Williams' "Rails’ Best Caching Method is JavaScript"
from GoRuCo 2010
obligatory omnigraffle diagram
"Anonymous" user
before:
initial page response time: 0.8 sec
rendering time (e.g. loading css/js/images): 1 sec
total: 1.8 sec

after:
initial page response time: 0.1 sec
rendering time: 1 sec
total: 1.1 sec

only a little bit faster...(1.1 vs 1.8 sec)
basically no server load => huge capacity increase!
Logged-in User / Subscriber
before:
initial page response time: 3 sec
rendering time (e.g. loading js/css/images): 1 sec
total time: 4 sec

after:
initial page response time: 0.1 sec
rendering time (include AJAX call:1 sec): 1 sec
total time: 1.1 sec

Capacity constant: AJAX call still needs to hit Rails
300% faster!
[wait for applause]
development implications

less Rails, more JS
1 user !== 1 (Rails) request

goodbye:
current_user
session
cookies

testing
onCurrentUserReady(callback)
callback when personalize API returns (or callback immediately
for anonymous user)

before:
- if logged_in?
   do stuff for logged-in user
- else
   do stuff for anonymous user

after:
Groupon.onCurrentUserReady(function(){
 if (Groupon.currentUser.isAuthenticated) {
   do stuff for logged-in user
 } else { do stuff for anonymous user }
});
analytics
Problem: Request logging
Solution: Tracking pixel (hit Nginx only, not Rails)

Problem: Content changes
Solution: Dynamic tracking pixel

Problem: Tracking params (e.g. utm params, affiliate id, etc...)
Solution: Store in cookie; append params to API request
a/b testing with Finch
Problem: Finch uses view/controller logic to choose and track
experiments 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.js
Finch.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 Google's "Overlapping Experiment Infrastructure"
 written in coffee-script
 open source soon-ishly
 ~ 15k of JS
 doesn't handle tracking/analytics/analysis side of testing
 (yet?)
the future
pure-JSON API requests
client-side rendering (/w mustache.js)
HTML5 storage
decouple from Rails

development practices:
front/back-end integration
better testing
better monitoring
Thank you!




      @jonpliske
jpliske@groupon.com
groupon.com/techjobs

Más contenido relacionado

La actualidad más candente

HTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedHTML5 Web Workers-unleashed
HTML5 Web Workers-unleashed
Peter Lubbers
 

La actualidad más candente (20)

The Mysteries Of JavaScript-Fu (RailsConf Ediition)
The Mysteries Of JavaScript-Fu (RailsConf Ediition)The Mysteries Of JavaScript-Fu (RailsConf Ediition)
The Mysteries Of JavaScript-Fu (RailsConf Ediition)
 
Ci of js and apex using jasmine, phantom js and drone io df14
Ci of js and apex using jasmine, phantom js and drone io   df14Ci of js and apex using jasmine, phantom js and drone io   df14
Ci of js and apex using jasmine, phantom js and drone io df14
 
Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!
 
Service worker - Offline Web
Service worker - Offline WebService worker - Offline Web
Service worker - Offline Web
 
HTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedHTML5 Web Workers-unleashed
HTML5 Web Workers-unleashed
 
Automating your plugin with WP-Cron
Automating your plugin with WP-CronAutomating your plugin with WP-Cron
Automating your plugin with WP-Cron
 
Retrofitting Continuous Delivery
Retrofitting Continuous Delivery Retrofitting Continuous Delivery
Retrofitting Continuous Delivery
 
BDD / cucumber /Capybara
BDD / cucumber /CapybaraBDD / cucumber /Capybara
BDD / cucumber /Capybara
 
DevOps and Hybrid Applications: What You Need to Know
DevOps and Hybrid Applications: What You Need to KnowDevOps and Hybrid Applications: What You Need to Know
DevOps and Hybrid Applications: What You Need to Know
 
Selenium with protractor
Selenium with protractorSelenium with protractor
Selenium with protractor
 
Kickstart Jpa
Kickstart JpaKickstart Jpa
Kickstart Jpa
 
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Optimising Your Front End Workflow With Symfony, Twig, Bower and GulpOptimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
 
JavaScript Task Runners - Gulp & Grunt
JavaScript Task Runners - Gulp & GruntJavaScript Task Runners - Gulp & Grunt
JavaScript Task Runners - Gulp & Grunt
 
SQL Server - CLR integration
SQL Server - CLR integrationSQL Server - CLR integration
SQL Server - CLR integration
 
Packing for the Web with Webpack
Packing for the Web with WebpackPacking for the Web with Webpack
Packing for the Web with Webpack
 
Alexander Mostovenko "'Devide at impera' with GraphQL and SSR"
Alexander Mostovenko "'Devide at impera' with GraphQL and SSR"Alexander Mostovenko "'Devide at impera' with GraphQL and SSR"
Alexander Mostovenko "'Devide at impera' with GraphQL and SSR"
 
CSS Regression Tests
CSS Regression TestsCSS Regression Tests
CSS Regression Tests
 
Testing Mobile JavaScript
Testing Mobile JavaScriptTesting Mobile JavaScript
Testing Mobile JavaScript
 
Bundle your modules with Webpack
Bundle your modules with WebpackBundle your modules with Webpack
Bundle your modules with Webpack
 
Search 500-video-clips
Search 500-video-clipsSearch 500-video-clips
Search 500-video-clips
 

Destacado

The math-behind-ab-testing
The math-behind-ab-testingThe math-behind-ab-testing
The math-behind-ab-testing
Amit Sawhney
 

Destacado (6)

A/B Testing with Air Patriots - GDC 2014
A/B Testing with Air Patriots - GDC 2014A/B Testing with Air Patriots - GDC 2014
A/B Testing with Air Patriots - GDC 2014
 
Overlapping Experiments Infrastructure
Overlapping Experiments InfrastructureOverlapping Experiments Infrastructure
Overlapping Experiments Infrastructure
 
4 Steps Toward Scientific A/B Testing
4 Steps Toward Scientific A/B Testing4 Steps Toward Scientific A/B Testing
4 Steps Toward Scientific A/B Testing
 
The math-behind-ab-testing
The math-behind-ab-testingThe math-behind-ab-testing
The math-behind-ab-testing
 
Optimizely Workshop: Take Action on Results with Statistics
Optimizely Workshop: Take Action on Results with StatisticsOptimizely Workshop: Take Action on Results with Statistics
Optimizely Workshop: Take Action on Results with Statistics
 
Debugging node in prod
Debugging node in prodDebugging node in prod
Debugging node in prod
 

Similar a Asynchronous Personalization at Groupon - JSConf 2011

Tips for a Faster Website
Tips for a Faster WebsiteTips for a Faster Website
Tips for a Faster Website
Rayed Alrashed
 

Similar a Asynchronous Personalization at Groupon - JSConf 2011 (20)

ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
ForwardJS 2017 -  Fullstack end-to-end Test Automation with node.jsForwardJS 2017 -  Fullstack end-to-end Test Automation with node.js
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
 
JavaScript Performance Patterns
JavaScript Performance PatternsJavaScript Performance Patterns
JavaScript Performance Patterns
 
JavaScript performance patterns
JavaScript performance patternsJavaScript performance patterns
JavaScript performance patterns
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web apps
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
Operational API design anti-patterns (Jason Harmon)
Operational API design anti-patterns (Jason Harmon)Operational API design anti-patterns (Jason Harmon)
Operational API design anti-patterns (Jason Harmon)
 
Take Your XPages Development to the Next Level
Take Your XPages Development to the Next LevelTake Your XPages Development to the Next Level
Take Your XPages Development to the Next Level
 
Continuous Deployment: The Dirty Details
Continuous Deployment: The Dirty DetailsContinuous Deployment: The Dirty Details
Continuous Deployment: The Dirty Details
 
Tips for a Faster Website
Tips for a Faster WebsiteTips for a Faster Website
Tips for a Faster Website
 
Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)
 
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
 
Performance on the Yahoo! Homepage
Performance on the Yahoo! HomepagePerformance on the Yahoo! Homepage
Performance on the Yahoo! Homepage
 
Building performance into the new yahoo homepage presentation
Building performance into the new yahoo  homepage presentationBuilding performance into the new yahoo  homepage presentation
Building performance into the new yahoo homepage presentation
 
Scaling 101 test
Scaling 101 testScaling 101 test
Scaling 101 test
 
Scaling 101
Scaling 101Scaling 101
Scaling 101
 
Serverless in production, an experience report (IWOMM)
Serverless in production, an experience report (IWOMM)Serverless in production, an experience report (IWOMM)
Serverless in production, an experience report (IWOMM)
 
Антон Серпутько “Testing and optimization of client-side performance”
Антон Серпутько “Testing and optimization of client-side performance” Антон Серпутько “Testing and optimization of client-side performance”
Антон Серпутько “Testing and optimization of client-side performance”
 
Web Development Foundation & Team Collaboration
Web Development Foundation & Team CollaborationWeb Development Foundation & Team Collaboration
Web Development Foundation & Team Collaboration
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
 
Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)
 

Último

Último (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Asynchronous Personalization at Groupon - JSConf 2011

  • 1. asynchronous personalization [and CDNs and A/B testing and stuff] Jon Pliske Performance Engineering, Groupon @jonpliske jpliske@groupon.com
  • 2. You might know me from this leaked photo on TechCrunch Jon Pliske Performance Engineering, Groupon @jonpliske jpliske@groupon.com
  • 3. overview background CDN caching async personalization a/b/multivariate testing /w finch.js
  • 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. super bowl party prelude: 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. pics or it didn't happen
  • 7. pics or it didn't happen
  • 8. CDNs are neat pros cons low latency dynamic content "edge side nodes" personalization high capacity complexity static content overkill? specifically: personalized content (login menu, deals) analytics tracking a/b testing Rails developers
  • 9. async personalization target: deal/division pages (> 50% of traffic) approach: 1. cache "anonymous" page in CDN 2. hide stuff 3. make AJAX request for personalized data/content 4. show stuff See Chris Williams' "Rails’ Best Caching Method is JavaScript" from GoRuCo 2010
  • 11.
  • 12.
  • 13. "Anonymous" user before: initial page response time: 0.8 sec rendering time (e.g. loading css/js/images): 1 sec total: 1.8 sec after: initial page response time: 0.1 sec rendering time: 1 sec total: 1.1 sec only a little bit faster...(1.1 vs 1.8 sec) basically no server load => huge capacity increase!
  • 14. Logged-in User / Subscriber before: initial page response time: 3 sec rendering time (e.g. loading js/css/images): 1 sec total time: 4 sec after: initial page response time: 0.1 sec rendering time (include AJAX call:1 sec): 1 sec total time: 1.1 sec Capacity constant: AJAX call still needs to hit Rails 300% faster!
  • 16. development implications less Rails, more JS 1 user !== 1 (Rails) request goodbye: current_user session cookies testing
  • 17. onCurrentUserReady(callback) callback when personalize API returns (or callback immediately for anonymous user) before: - if logged_in? do stuff for logged-in user - else do stuff for anonymous user after: Groupon.onCurrentUserReady(function(){ if (Groupon.currentUser.isAuthenticated) { do stuff for logged-in user } else { do stuff for anonymous user } });
  • 18. analytics Problem: Request logging Solution: Tracking pixel (hit Nginx only, not Rails) Problem: Content changes Solution: Dynamic tracking pixel Problem: Tracking params (e.g. utm params, affiliate id, etc...) Solution: Store in cookie; append params to API request
  • 19. a/b testing with Finch Problem: Finch uses view/controller logic to choose and track experiments 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
  • 20. Finch.js Finch.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); });
  • 21. Finch.js based on Google's "Overlapping Experiment Infrastructure" written in coffee-script open source soon-ishly ~ 15k of JS doesn't handle tracking/analytics/analysis side of testing (yet?)
  • 22. the future pure-JSON API requests client-side rendering (/w mustache.js) HTML5 storage decouple from Rails development practices: front/back-end integration better testing better monitoring
  • 23. Thank you! @jonpliske jpliske@groupon.com groupon.com/techjobs